Im trying to setup virtual host under open suse. Im in Yast->Http server, when i check "Determine Request Server by HTTP Headers" I got error message To use name-based virtual you must designate the ip adress on the server(...)
I did some googling and according to what i found i uncommmented the NameVirtualHost *:80
line in /etc/apache2/listen.conf
and restarted apache but it id not help. How can i setup it propely(maybe I should do it through yast without manually editing conf files but i can't find that option)
The problem I encountered was occurring because I have NameVirtualHost *:80
in listen.conf
and example.com:80
in ServerName but they must be exactly the same.
PS it's still not working as expected when I set NameVirtualHost example.com:80
and then try to add server with ServerName example.com:80 I still get mentioned error message. Of course I got example.com in my hosts file pointing to 127.0.0.1
Quite outdated question but in case someone encounters it:
1) I added
NameVirtualHost my_virtual_hostname_here.tld:80
before <VirtualHost ...
section
2) changed <VirtualHost *:80>
to <VirtualHost my_virtual_hostname_here.tld>
That did the trick for me. Of course as mentioned @Lord_JABA don't forget to add 127.0.0.1 my_virtual_hostname_here.tld
to /etc/hosts
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.