I have a https domain (https://wpqa.net) and I’d trying to add a subdomain demo.wpqa.net.
I think I’m lost somewhere as my subdomain is now pointing to the main domain, that is subdomain is having the same content as the main.
My /etc/apache2/sites-enabled/default-ssl.conf is as follow
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerAdmin webmaster@WPQA
DocumentRoot /var/www/demo
Servername demo.wpqa.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@WPQA
DocumentRoot /var/www
Servername 104.131.35.241
ServerAlias WPQA www.WPQA
Not too sure if my config is right.
Any input is greatly appreciated.
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!
First question: do you have NameVirtualhost enabled? I’m guessing this is ubuntu, so it should be. This means that you’ll want to modify your SSL domain to this:
<VirtualHost *:80>
ServerName demo.wpqa.net
ServerAlias www.demo.wpqa.net
ServerAdmin webmaster@WPQA
DocumentRoot /var/www/demo
Servername demo.wpqa.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin webmaster@WPQA ServerName wpqa.net ServerAlias www.wpqa.net DocumentRoot /var/www Servername 104.131.35.241 ServerAlias WPQA www.WPQA
This will tell the server "if they are asking for demo.wpqa.net, send them here"
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.