my machine is debian sarge 3.1
# uname -a
2.4.27-2-386
I would like to use virtual host in apache2,it is quiet diff w/ other version.
I did the following steps:-
-added my ip ...
-add ServerName...
-make a file /var/ww/dn1/index.html
-make symbolic link
-restart apache2
2)
/etc/apache2/sites-available# ls
default domain1
/etc/apache2/sites-available# cat domain1
----------
NameVirtualHost 203.x.x.x
ServerAdmin webmaster@localhost
ServerName www.domain1.com
DocumentRoot /var/www/dn1/
.
.
.
-----
cd /var/www/dn1# ls
index.html
-----
3) I make a file of domain1
dns:/etc/apache2/sites-available# ls
default domain1
4) create symbolic link
ln -s /etc/apache2/sites-available/domain1
/etc/apache2/sites-enabled/domain1.com
5)tail /var/log/apache2/error.log
[warn] NameVirtualHost 203.x.x.x. has no VirtualHosts
6) At client,
open a browser, and try to go http://www.domain1.com
Result:-
Not Found
The request URL / was not found on this server.
p.s. I have tried to find the answer in apache's manual for 2 weeks, but still couldn't find my need.
Thanks for any reply.
what ip now you bind ?
I have not experience configure apache virtual host. That 203.x.x.x ip now is bind to your server not private ip may be "192.168.x.x." I mean your server know whereis 203.x.x.x
Virtural Hosting - MCD
Apache VH could be ran on two modes:
>>>IP Host or Name Host.
IP host bind the ip to the delicated website. Like //home/www/web01. = 123.123.123.123
"Name base host" had been widely used because it can save IP addresses. The apache will use 'detecter' to check the requesting website name and forward to the delicated website. It is very simple. Just edit the //etc/httpd/conf/httpd.conf close to the end. Adding the virtual host to it. It have sample at [##] section inside the httpd.conf file. just copy and edit a bit will work.
** Don't forget to edit your BIND to make sure the right name resolve.**