Click to See Complete Forum and Search --> : V-Hosting, i have one small fault to fix please!!


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

Supa' Penguin
09-23-2002, 02:41 PM
Good afternoon,
Your order of the v-hosts 4 the 127.0.0.1 address is what's screwing u up. What doc root would u like to see when u browse to http://localhost? which ever you would like to see should be defined first. Is it the suse 7.2 root dir? then u must define that v-host too and it must appear first for the 127.0.0.1 address. As your main server the suse 7.2 root dir is only used then a undefined address is used(192.168.1.0 is undefined!)

With regards to your browsing from the win box you must define CNAMES 4 your linux box and use your linux box 4 DNS(have win use linux 4 resolution) if u want to just type sfahey.com OR iws.com OR myphp.com. or use the rewrite engine to resolve the varoius sites (ie. 192.168.1.0/sfahey/ resolves to your sfahey.com site)

J.
:)

Supa' Penguin
09-23-2002, 03:53 PM
Hello again,

Try this if your DNS is set up with CNAMES 4 your ip and the win box uses it to resolve.
J.
:)


port 80
NameVirtualHost 127.0.0.1
NameVirtualHost 192.168.1.0

<VirtualHost 127.0.0.1 192.168.1.0>
ServerAdmin root@linux.local
DocumentRoot /usr/local/httpd/htdocs
ServerName linux.local
# ErrorLog var/log/httpd/iws_log
# CustomLog var/log/httpd/iws_log
</VirtualHost>

<VirtualHost 127.0.0.1 192.168.1.0>
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 192.168.1.0>
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 192.168.1.0>
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>

sfahey
09-23-2002, 04:28 PM
Thanks for that, it works fine now!!

On the subject of question 2
In my SuSe Linux control centre under DNS I have the following

Host Name: this is set to (linux)
Domain Name: this is set to (local)

I can also enter 3 ‘name server list’ and ‘domain search list’ entries

Name Server List Domain Search List
127.0.0.1 local
192.168.0.1

Could you expand on this? Have I put the correct entries in?
also were is the script that these entries refer to?

have a nice day !!

shaun

sfahey
09-23-2002, 04:34 PM
hello m8 !

on you last posting you said

NameVirtualHost 192.168.1.0

did you mean 192.168.0.1 ??

if that is correct, why is it that way round ?


thanks for replying

shaun

sfahey
09-23-2002, 04:40 PM
sorry it took the formating out , the word 'local' should be under the 'Domain Search List'


Domain Search List
local


see ya !

Supa' Penguin
09-24-2002, 09:14 AM
First let me appoligize as I have not had a chance to respond.(Too darn busy) :(

Your are correct 192.168.1.0 should be repalced with 192.168.0.1.
Sorry about the typo. I was in a rush(gotta work too!) :)
Your name server list should list your domain names. When u created the domain in bind what did u call it? linux.local? Then yes local should be used and your name server list should list 127.0.0.1 and 192.168.0.1 like you stated.

Have Fun!

J.