You are not logged in.
I've setup my Apache today, but it doesn't work as expected.
When I go to http://ztjuh.supersik.net (the last one in the config file) it comes out in "/srv/http" instead of "/home/ztjuh/test". What is the mistake I made? I can't figure it out, it's like it doesn't find the last one in the config file.
File: /etc/httpd/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/srv/http"
</VirtualHost>
<VirtualHost *:80>
ServerName ztjuh.zapto.org
DocumentRoot "/home/ztjuh/public_html"
</VirtualHost>
<VirtualHost *:80>
ServerName ztjuh.supersik.net
DocumentRoot "/home/ztjuh/test"
</VirtualHost>File: /etc/hosts
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost arch
127.0.0.1 ztjuh.zapto.org
127.0.0.1 ztjuh.supersik.net
::1 localhost.localdomain localhostLast edited by Ztjuh (2013-03-02 14:49:29)
Offline
first change to debug from warn
second, try 127.0.0.13 in /etc/hosts & virtualhost and see whats happen
tail -f logs to catch any errors
https://balaskas.gr
Linux System Engineer - Registered Linux User #420129
Offline
I fixed it.
ServerName ztjuh.supersik.net
changed to
ServerName 192.168.0.150
in httpd.conf.
Thanks alot, because if you wouldn't have said about the debug thing I would never have looked in httpd.conf and see it!
Offline
iirc, the order of the vhosts is very important: the first one matches the request, and thus it is served.
More info: http://wiki.apache.org/httpd/CommonMisconfigurations/ - in short: the first has no serverName included, and thus is served as the default.
Offline
Yeah I already knew that, but because I set ztjuh.supersik.net to default in httpd.conf it served that one instead of the one in vhosts.conf!
Offline