0

i have problems with my subdomain on apache2. I have domain "propaniusz.tk" pointing at my server and it works. But im trying to make subdomain with virtualhost "wybudzenie.propaniusz.tk" doesn't work at all. Here's my config files.

wybudzenie.propanek.tk.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/wybudzenie

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

        SSLCertificateFile /etc/letsencrypt/live/propaniusz.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/propaniusz.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        ServerName wybudzenie.propaniusz.tk
    </VirtualHost>
</IfModule>

main page propanek.tk as 000-default-le-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

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

        SSLCertificateFile /etc/letsencrypt/live/propaniusz.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/propaniusz.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        ServerName www.propaniusz.tk
        ServerAlias propaniusz.tk
    </VirtualHost>
</IfModule>

apache2ctl -S

VirtualHost configuration:
*:80                   propaniusz.tk (/etc/apache2/sites-enabled/000- 
default.conf:1)
*:443                  is a NameVirtualHost
     default server www.propaniusz.tk (/etc/apache2/sites-enabled/000- 
default-le-ssl.conf:2)
     port 443 namevhost www.propaniusz.tk (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
     alias propaniusz.tk
     port 443 namevhost wybudzenie.propaniusz.tk (/etc/apache2/sites-enabled/wybudzenie.propaniusz.tk.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"

I have no idea what's Im doing wrong, can someone help me?

1 Answers1

0

Are you tried calling https://wybudzenie.propaniusz.tk, since you have only configured for the port 443, the site/app will works while you call using https else it will return the default conf, if you need to load in wybudzenie.propaniusz.tk, you have to configure redirection/virtual host conf for 80.