By itayperry91
That’s what I was trying to do (using Apache 16) I have two enabled config files.
<VirtualHost *:80>
ServerAdmin admin@something.com
ServerName mydomain.com/project_1
ServerAlias www.mydomain.com/project_1
DocumentRoot /var/www/project1/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
And the other one (for an entirely different project) would be:
<VirtualHost *:80>
ServerAdmin admin@something.com
ServerName mydomain.com/project_2
ServerAlias www.mydomain.com/project_2
DocumentRoot /var/www/project2/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I’ve tried it and it didn’t really work.
Do I need to change my domain droplet records to make it work? Because there’s no option for routes there…
I assume I did something stupid and that this question is very unprofessional, but still, I would love to get some help please :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello friend!
Great question! What you would do here is use only one of these, and make it like this:
<VirtualHost *:80>
ServerAdmin admin@something.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Now create these two folders: /var/www/project1 /var/www/project2
So traffic to mydomain.com/project1 or www.mydomain.com/project1 loads the contents of /var/www/project1, and so on for each project you need :)
Kind Regards, Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.