Hi, I am hosting two sites, site1 and site2, on my droplet. Both domains directed to the appropriate content until I restarted apache.
I believe there is something incorrect with the conf files but I cannot identify the error. Can anyone assist with pointing it out?
site1 conf file: <VirtualHost *:80> ServerAdmin admin@site1.com ServerName site1.com ServerAlias www.site1.com/ DocumentRoot /var/www/wordpress ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/wordpress/> AllowOverride All </Directory>
RewriteEngine on RewriteCond %{SERVER_NAME} =site1.com [OR] RewriteCond %{SERVER_NAME} =www.site1.com/ [OR] RewriteCond %{SERVER_NAME} =www.site1.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost>
site2 conf file: <VirtualHost *:80> ServerAdmin admin@site2.com ServerName site2.com ServerAlias www.site2.com/ DocumentRoot /var/www/site2.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/site2.com/> AllowOverride All </Directory> </VirtualHost>
DNS settings are: site1: A *.site1.com directs to serverIP A site1.com directs to serverIP A www.site1.com direts to serverip NS1 NS2 NS3
site2: A *.site2.com directs to serverIP A site2.com directs to serverIP NS1 NS2 NS3
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!
Try removing the trailing slash in both ServerAlias directive and restart Apache.
Regards
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.