Hi,
I have already one wordpress site on my droplet and want to get one more.
I have done this:
touch /etc/apache2/sites-available/a-c-d.net.conf
<VirtualHost *:80> ServerName a-c-d.net DocumentRoot /var/www/html/a-c-d.net/public_html RewriteEngine on RewriteCond %{SERVER_NAME} =a-c-d.net RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> <VirtualHost *:80> ServerName www.a-c-d.net
RewriteEngine on RewriteCond %{SERVER_NAME} =www.a-c-d.net RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost>
sudo mkdir -p /var/www/html/a-c-d.net/public_html
sudo chown -R $USER:$USER /var/www/html/a-c-d.net/public_html
sudo chmod -R 755 /var/www/html/
sudo a2ensite a-c-d.net
sudo service apache2 reload
And then I did this beacuse it don’t work:
nano /var/www/html/a-c-d.net/public_html/index.html
<html> <head> <title>Welcome to Test.com!</title> </head> <body> <h1>Success! The test.com virtual host is working!</h1> </body> </html>
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
sudo service apache2 restart
My /etc/hosts/
127.0.1.1 benja2 benja2 127.0.0.1 localhost 165.227.175.xxx benjaminthompson.org
I have an A and AAAA dns record for a-c-d.net using same IP as my first site.
www-a-c-d.net redirects to my first site.
What am I missing? Thanks !!
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!
Accepted Answer
| And then I did this beacuse it don’t work:
Can you clarify here? What happened when you restarted apache? Was an error reported? I would recommend reviewing your error log /var/log/apache2/error.log as this file will contain further details on what went wrong.
Hi, ryanpg,
I have solved the problem.
The caching plugin w3 did I could only access the site from /wp-admin because I had deleted w3’s file in wp-config.php to avoid caching. I had no error code, page was not there.
The error log showed problems with w3 and was what pointed me in the correct direction.
Deactivating the plugin w3 and getting SSL-certificate on both virtual hosts did the trick.
Further more I changed my second virtual host to a virtual host not being encrypted. (before getting the SSL-certificate.)
Thanks for helping.
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.