Need to simulate webdomains
Posted 02 November 2003 - 02:23 PM
Any way I need for a PHP script to simulate url adresses on my Localhost.
Now i acces a webpage on my locahost by 127.0.0.1
but 127.0.0.1 should become www.onno.org for example
and www.tom.org etc...
How do I put this in my httpd.conf script. Remember this is on my local host without any bind
Using Red Hat 9.0
And apache 2.x
Posted 14 November 2003 - 03:17 AM
Something like this should do:
127.0.0.1 www.onno.org127.0.0.1 www.tom.org
Test, and make sure that the names resolve locally. In BSD, changing /etc/resolv.conf to instruct the resolver to check the hosts file before the nameserver is simply a matter of which line comes first. Like I said, not sure about RH.....
Secondly, you need to enable Name-based virtual hosting in httpd.conf. Here\'s an example:
## Use name-based virtual hosting.#NameVirtualHost *:80# VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for requests without a known# server name. <VirtualHost *> ServerName www.onno.org DocumentRoot /www/onno ServerAdmin me@localhost</VirtualHost>Restart apache, voila!
Posted 14 November 2003 - 08:51 AM
Just vi /etc/hosts and edit it...
If you don\'t know you never know unless somebody tells you
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users