sfahey
09-22-2002, 04:26 PM
Hello group
I have been trying to figure out Vitural-Hosting, and i think i'm getting it.
but something a bit odd is going on ! Can anybody please help ?
A bit of nfo you may need
my documentRoot is"/usr/local/httpd/htdocs"
within the 'root dir' is the default suse 7.2 linux index.html
my IP address is 192.168.0.1
I have 2 questions, the first is this
I have 3 vitural hosts they are, sfahey.com, iws.com, and, myphp.com.
When i type http://sfahey.com OR iws.com OR myphp.com, all is fine and well :)
all the indexes show up (cool)
When i type http://192.168.0.1 i see the default suse 7.2 linux index.html (cool)
When i type http://linux.local i see the default suse 7.2 linux index.html (cool)
BUT, when i type When i type http://localhost i see the index page for iws.com (not cool) ?
so whats up here then ?
Part of httpd.conf
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/iws.com
ServerName iws.com
# ErrorLog var/log/httpd/iws_log
# CustomLog var/log/httpd/iws_log
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/sfahey.com
ServerName sfahey.com
Options +ExecCGI +Indexes
# ErrorLog var/log/httpd/sfahey_log
# CustomLog var/log/httpd/sfahey_log
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/myphp.com
ServerName myphp.com
# ErrorLog var/log/httpd/myphp_log
# CustomLog var/log/httpd/myphp_log
</VirtualHost>
the /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
# special IPv6 addresses
127.0.0.1 localhost
127.0.0.1 localhost.localdomain iws.com sfahey.com myphp.com
192.168.0.1 linux.local linux
I hope somebody can help because its driving me a bit mad
my second question is this
i have a second PC on my network, which i develop on, using macromedia stuff ect. Its IP address is 192.168.0.2
also this is a windows box, so i have 1 client, and 1 server.
when i access the apache from my windows box, i have to use its IP 192.168.0.1 (as above)
when i type http://192.168.0.1 i see the default suse 7.2 linux index.html
but i have to type http://192.168.0.1/myphp.com/index.php to view all of the VirtualHosts ?
how do i overcome this ? Is it something to do with DNS ? If so, i,m not having much luck :)
thanks for your time shaun
I have been trying to figure out Vitural-Hosting, and i think i'm getting it.
but something a bit odd is going on ! Can anybody please help ?
A bit of nfo you may need
my documentRoot is"/usr/local/httpd/htdocs"
within the 'root dir' is the default suse 7.2 linux index.html
my IP address is 192.168.0.1
I have 2 questions, the first is this
I have 3 vitural hosts they are, sfahey.com, iws.com, and, myphp.com.
When i type http://sfahey.com OR iws.com OR myphp.com, all is fine and well :)
all the indexes show up (cool)
When i type http://192.168.0.1 i see the default suse 7.2 linux index.html (cool)
When i type http://linux.local i see the default suse 7.2 linux index.html (cool)
BUT, when i type When i type http://localhost i see the index page for iws.com (not cool) ?
so whats up here then ?
Part of httpd.conf
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/iws.com
ServerName iws.com
# ErrorLog var/log/httpd/iws_log
# CustomLog var/log/httpd/iws_log
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/sfahey.com
ServerName sfahey.com
Options +ExecCGI +Indexes
# ErrorLog var/log/httpd/sfahey_log
# CustomLog var/log/httpd/sfahey_log
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs/myphp.com
ServerName myphp.com
# ErrorLog var/log/httpd/myphp_log
# CustomLog var/log/httpd/myphp_log
</VirtualHost>
the /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
# special IPv6 addresses
127.0.0.1 localhost
127.0.0.1 localhost.localdomain iws.com sfahey.com myphp.com
192.168.0.1 linux.local linux
I hope somebody can help because its driving me a bit mad
my second question is this
i have a second PC on my network, which i develop on, using macromedia stuff ect. Its IP address is 192.168.0.2
also this is a windows box, so i have 1 client, and 1 server.
when i access the apache from my windows box, i have to use its IP 192.168.0.1 (as above)
when i type http://192.168.0.1 i see the default suse 7.2 linux index.html
but i have to type http://192.168.0.1/myphp.com/index.php to view all of the VirtualHosts ?
how do i overcome this ? Is it something to do with DNS ? If so, i,m not having much luck :)
thanks for your time shaun