Problem with domain and subdomain - APache2 on Ubuntu 16

November 17, 2016 2.5k views
Apache Ubuntu 16.04

Hello! I got a little problem atm with my server/domain…
I have been trying to set up a subdomain, but every time i do it, it some how does not work as it should..

When i visit my site with https i come to my main domain( but with http it show the folder/content of my subdomain(
My subdomain works just fine, with showing the content of the subdomain folder

They are both placed in www/html and www/nightdriver
I have 2 sites enabled with virutel host files, pointg in the diffrent folders

I hope some one can help me..

1 comment
  • It appears that now your domain is working but your subdomain is not.

    If you can share your configuration in /etc/apache2/sites-enabled and the DNS records you’ve set up for your domain we can help you get to the bottom of this and get things working the way you want.

1 Answer

Sorry for the late reply, i have been bussy with my school.
Here is my conf file for my main domain:

<VirtualHost *:443>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/

    SSLEngine on
    SSLCertificateFile /root/
    SSLCertificateKeyFile /root/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

And here it is for my subdomain:

<VirtualHost *:80>

    DocumentRoot /var/www/nightdriver/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

Have another answer? Share your knowledge.