Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have a private network in office through a ADSL modem which connects to the internet. All our IP address are in the subnet 192.168.0.XX .

We have a web server running on 192.168.0.140 (Centos PC ). In the vhosts configuration of apache we have named the server as myhost. I can access the http://myhost in that PC since I have also added an entry in /etc/hosts file . 192.168.0.140 myhost.

But from the other PC's We are not able to access http://myhost .

I suspect this is a DNS problem .

Could anyone tell me what configurations I need to make to access http://myhost from all PC's ?

share|improve this question
    
What DNS resolver are your PCs configured to use? Is there a local DNS server or are you using the ISPs? –  Bittrance Apr 3 '11 at 7:38

2 Answers 2

Check whether you can access the webserver on 192.168.0.140 through the IP itself from other system in your LAN.

If you can access webserver from other machines with IP, make appropriate entry in each system's /etc/hosts for 192.168.0.140 with myhost

If other systems in your LAN are windows, make appropriate entry in C:\windows\system32\drivers\etc\hosts file.

If you don't like this method need to setup DNS server. In that case, I suggest BIND.

share|improve this answer
    
yes I can access the Ip address (192.168.0.140 )from my MAC .But how will i edit it in /etc/hosts in MAC ? –  user26202 Apr 3 '11 at 8:40
    
Check this link. It may help you. unlettered.org/2008/03/06/… –  Suku Apr 3 '11 at 9:06

Out of the box CentOS is configured to have the iptables firewall running. By default it doesn't allow traffic on port 80 so you will have to enable it.

sudo /sbin/iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo /sbin/service iptables save

As Peter says, if you want to access the server by name then you will also need to add it to your name service. If you only have a small number of PCs and the changes are infrequent then it is probably easier to just add an entry in the hosts file of each one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.