You need separated virtual host for each of your project
Take a look at apache's document https://httpd.apache.org/docs/2.4/vhosts/examples.html
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
I have 3 projects on laravel which were developed on my local environments. When I decided to deploy the projects on AWS I found EC2 to be the best choice. Simply because the free tier can host my application upto a year without spending any money on it.
Anyways I faced a challenge while deploying my second project on the same EC2 machine. In my EC2's apache configurations I had to point the default root to my first applications public directory.
Now I've read up a lot but I can't get multiple laravel applications set up on the same ec2 machine. Can anyone think of a work around to this? possibly with some code in htaccess or maybe some sort of redirection which allows me to point multiple domain names to the same ec2 and then grant me power to choose which laravel directory it should point to.
Example i have domain names of www.project1.com www.project2.com
In both their dns records I point them to my ec2 server : 192.168.xx.xx( dummy ip )
in my www directory I have two laravel applications named project1 and project2.
Do let me know if any more clarification is required. Also I'm not looking to spend money on a laravel specific hosting and that is why I'm trying to figure this out.
Thank you guys, Any help would be appreciated :)
Please or to participate in this conversation.