Page 1 of 1

Some of the virtual hosts are not working?

PostPosted: 23. August 2020 23:11
by Kevin2046
I'm using Ubuntu 18.04 and just upgraded XAMPP to 7.4.9. I have several subdomains, for example www.mysite.com would point to /opt/lampp/htdocs/main and sub.mysite.com would point to /opt/lampp/htdocs/sub. The httpd-vhosts.conf file includes:

<VirtualHost *:80>
ServerAdmin webmaster@mysite.com
DocumentRoot "/opt/lampp/htdocs/main"
ServerName mysite.com
ServerAlias mysite www.mysite.com m.mysite.com
ErrorLog "logs/mysite.com-error_log"
CustomLog "logs/mysite.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@mysite.com
DocumentRoot "/opt/lampp/htdocs/sub"
ServerName sub.mysite.com
ServerAlias sub.mysite.com
ErrorLog "logs/sub.com-error_log"
CustomLog "logs/sub.com-access_log" common
</VirtualHost>

I have also uncommented the Include etc/extra/httpd-vhosts.conf in the httpd.conf file.

Now the sub.mysite.com is working as expected. But the www.mysite.com just always only point to /opt/lampp/htdocs. But it was working ok in my previous installed XAMPP. What am I missing?

Re: Some of the virtual hosts are not working?

PostPosted: 24. August 2020 10:55
by Nobbie
for example www.mysite.com would point to /opt/lampp/htdocs/main and sub.mysite.com would point to /opt/lampp/htdocs/sub


Why "for example" and why "would point"? Does it, or does it not? And what is meant by "for example"? Is this your configuration (the original code) or is it not?

Code: Select all
ServerName sub.mysite.com
ServerAlias sub.mysite.com


Why twice the same? I dont know if that is a problem, but anyway its strange.