By ajburch11
Hello all,
I’ve come to a stand still while trying to configure multiple sites on one droplet in addition to a Wordpress site that was already in existence, but is now gone due to madness and insanity.
Okay, so I originally installed Wordpress for one domain on the droplet. No problems there. I then created another domain and added it to the same droplet. No problems.
The second domain will not have any Wordpress, it will be used for hosting simple landing pages.
The problems began when I created a my2nddomain.com in the /var/www/html folder which housed my Wordpress files for the first website, thus sending me to the same site as my1stdomain.com.
I then checked out the httpd.conf file and remembered the virtual hosts thing and tried to create two different virtual hosts, with the <virtualhost *:80></virtualhost> lines in the original httpd.conf file. That worked…kind of. When trying to access my1stdomain.com it wasn’t recognizing the Wordpress files located in the DocumentRoot directory that I’d named; it was sending me to the index.html file.
So, my final grasp for a semblance of something…I decided to configure everything based off of the tut on creating apache virtual hosts on centos 7.
Please keep in mind, I put the Wordpress files in the my1stdomain.com/public_html folder.
Any help is greatly appreciated!!
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!
if your WordPress files are at
/var/www/html/my1stdomain.com/public_html
Then you need 1 virtual host configuration with a DocumentRoot pointed at /var/www/my1stdomain.com/public_html
If your Html files are at
/var/www/html/my2nddomain.com/
then you will need a 2nd virtual host configuration with DocumentRoot pointed at /var/www/my2nddomain.com/
Here are simple virtual hosts confs, they are brief will need more configuration for WordPress
<VirtualHost *:80>
ServerName www.my1stdomain.com
ServerAlias my1stdomain.com
DocumentRoot /var/www/html/my1stdomain.com/public_html
ErrorLog /var/log/httpd/my1stdomain.com/error.log
CustomLog /var/www/my1stdomain.com/requests.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName www.my2nddomain.com
ServerAlias my2nddomain.com
DocumentRoot /var/www/html/my2nddomain.com/
ErrorLog /var/log/httpd/my2nddomain.com/error.log
CustomLog /var/log/httpd/my2nddomain.com/requests.log combined
</VirtualHost>
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.