Hi,
I try to set a second virtual host up on the same droplet. I have a LAMP stack.
The second virtual host points to the first site which I don’t want it to.
My /etc/apache2/sites-available/artctrldel.shop.conf
:
<VirtualHost *:80>
ServerName www.artctrldel.shop
ServerAlias artctrldel.shop
DocumentRoot /var/www/html/artctrldel.shop
RewriteEngine on
RewriteCond %{SERVERNAME} =www.artctrldel.shop [OR]
RewriteCond %{SERVERNAME} =artctrldel.shop
RewriteRule ^ https://%{SERVERNAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
My DNS records: A to IP, A to IP with www, 3 ns to Digital Ocean, AAAA to IP, AAAA to IP with www.
I have pointed my DNS from namecheap (my domain) to Digital Oceans nameservers.
Any help on how to get my second site up will be greatly appreciated, thanks!
Ben
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
Hi there,
It looks like that you have an HTTP to HTTPS redirect defined in your Vhost, however, the domain name does not have a SSL certificate installed.
You would need to first remove these lines here:
RewriteEngine on
RewriteCond %{SERVERNAME} =www.artctrldel.shop [OR]
RewriteCond %{SERVERNAME} =artctrldel.shop
RewriteRule ^ https://%{SERVERNAME}%{REQUEST_URI} [END,NE,R=permanent]
Then restart Apache:
sudo systemctl restart apache2
After that follow the steps from this tutorial here on how to install a Let’s Encrypt SSL certificate:
After that during the installation certbot
will ask you if you want to setup the redirect again.
Hope that this helps! Regards, Bobby
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.