Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I have two virtual machines setup on VirtualBox. A Linux host (CentOS 5.2) with Apache, MySQL and PHP & another with Windows XP. The linux system has been configured to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6

    Unable to access Apache VirtualHost website over network


    I have two virtual machines setup on VirtualBox. A Linux host (CentOS 5.2) with Apache, MySQL and PHP & another with Windows XP.

    The linux system has been configured to host www[dot]xyz[dot]com via VirtualHost (IP: 192.168.56.2). It works perfectly fine and a sample html page pops up when i open www[dot]xyz[dot]com in firefox.

    However when i try to open www[dot]xyz[dot]com on Windows XP (192.168.56.10), it fails. It says "Couldn't connect to server". I have configured the host file on both linux and windows xp. And both the machines are able to ping each other. I can even ping www[dot]xyz[dot]com on Windows XP and it resolves to 192.168.56.2 (Linux Machine IP).

    Firewalls are off on both the systems. I have wasted several days trying to figure out what might be wrong. I even created another linux machine to check if i can open www[dot]xyz[dot]com on the linux but it failed again with the same problem. I was able to ping both of them but i couldn't open www[dot]xyz[dot]com in browser.

    Please help me out?

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    Can you able to telnet from window to linux? Use the port on which apache is running (In your case virtual_host).

    Vidyadhar

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,529
    The problem is probably your DNS settings. Have you tried using the IP address to connect from XP to Linux? If that works, then you need to set up a local DNS server, OR (simpler) set your hosts file on XP to associate the system name to the Linux IP address. Trivial the other way (linux to xp) in that you just add the entry to /etc/hosts. Windows also has a hosts file, but I forget where it is, or how to update it. Remember, Google is your friend!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6
    I tried but i'm not able to telnet linux from windows. Apache is listening to port 80 and it fails every time i run telnet 192.168.56.2 80 on windows. It says could not connect at port 80. I then tried to telnet through the default port i.e. 23 but even that isn't working.

    I have added an entry for the windows machine on linux. I'm attaching my linux hosts file, httpd.conf and windows hosts file content below.

    httpd.conf
    Code:
    Listen *:80
    NameVirtualHost *:80
    
    <VirtualHost *:80>
    	ServerAdmin shikhar@xyz[dot]com
    	DocumentRoot	/var/www/xyz[dot]com/public_html
    	ServerName 	www[dot]xyz[dot]com
    	ErrorLog	        /var/www/xyz[dot]com/logs/error_log
    	CustomLog	       /var/www/xyz[dot]com/logs/access_log combined
    	<Directory        /var/www/xyz[dot]com/public_html>
    		Options -Indexes FollowSymLinks
    		AllowOverride None
    		Order allow,deny
    		Allow from all
    	</Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
    	ServerAdmin shikhar@xyz[dot]com
    	DocumentRoot	/var/www/xyz[dot]com/public_html/interact
    	ServerName 	interact[dot]xyz[dot]com
    	ErrorLog	/var/www/xyz[dot]com/logs/error_log
    	CustomLog	/var/www/xyz[dot]com/logs/access_log combined
    	<Directory /var/www/xyz[dot]com/public_html/interact>
    		Options -Indexes FollowSymLinks
    		AllowOverride None
    		Order allow,deny
    		Allow from all
    	</Directory>
    </VirtualHost>
    CentOS /etc/hosts
    Code:
    127.0.0.1		localhost.localdomain localhost
    ::1     munindia[dot]com localhost6.localdomain6 localhost6
    127.0.0.1		www[dot]xyz[dot]com xyz[dot]com
    127.0.0.1		interact[dot]xyz[dot]com
    192.168.56.10		winxp
    Windows XP hosts file
    Code:
    127.0.0.1       localhost
    192.168.56.2	www[dot]xyz[dot]com
    192.168.56.2	interact[dot]xyz[dot]com
    PS: Since this is my first post, i'm not allowed to post links hence i've used [dot] to represent actual dots. Forgive me for typing it out explicitly!

  5. #5
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6
    @Rubberman

    I could've done it by setting up a local DNS server but its a development system. I wish to set it up by using apache VirtualHosts. But i'm not able to.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,529
    There are a number of things that can cause Linux to refuse telnet connections, the most common of which is that telnet is usually disabled by default since it is inherently insecure. Have you tried ssh instead?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6
    I have enabled telnet. (disabled = no in the conf file under etc/xined.d/telnet)
    But no help.

    All the firewalls are disabled as well. I'll try ssh as well and get back to you.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,529
    Quote Originally Posted by technosj View Post
    I have enabled telnet. (disabled = no in the conf file under etc/xined.d/telnet)
    But no help.

    All the firewalls are disabled as well. I'll try ssh as well and get back to you.
    When you change the settings in xinetd.d, then you either have to reboot, or you need to restart the xinetd service.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6
    Did that. No success.

  10. #10
    Just Joined!
    Join Date
    Apr 2012
    Posts
    6
    I tried to telnet self to port 80 but it fails. I think the problem is tcp is not listening to port 80 or something is blocking it. How do i check that? and correct it?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •