Solved

How do I access local sites thru Apache server from my internally networked laptop

Posted on 2009-04-02
6
280 Views
Last Modified: 2012-05-06
My Apache 2 server is installed on a W2K machine and is set up to listen at port 8080.  I've been using it for months and works fine when accessing local sites on that machine.  I now would like to access the same sites from a networked machine that is using a wireless connection.  This new machine is a laptop running XP.  

I am able to access the server itself, i.e. I can get to Apache's "test" page.  And I can run php files from the Apache root directory.  But I can't serve up the sites -- these sites are served up fine when I access them from the machine on which the Apache server is installed.  Therefore, the virtual hosts are properly set up for use within that machine.

So, I can get to the Apache server, but cannot access any virtual hosts.  It just can't make that final leap.  I've tried numerous things all to no avail.  My gut says it's something simple, but I'm stuck.

Help would be greatly appreciated.  Thanks,

Margaret
0
Comment
Question by:mhugos
  • 2
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
darrickhartman earned 250 total points
ID: 24056289
If you are using named virtual hosts, you will need to configure your internal DNS server to direct those named requests to the IP address of your W2K machine.

So for example, if you have www.foo.com and www.bar.com as two sites on your W2K server, your DNS server would need to have an entry for each of those two domains to point to the IP address of your W2K server.
0
 

Author Comment

by:mhugos
ID: 24062460
Thank you for getting back with your suggestion.  I tried updating DNS server but with no success (see below for details.)

Here's some more info on how my machines are set up:
W2K machine:
-- Hosts file associates sites to 127.0.0.1
-- Apache 2 Server: httpd.conf contains virtual server definitiions.  Here is one of my virtual server definitions:  
########################################### cuc:8080 #########################
<VirtualHost 127.0.0.1:8080>
    ServerName cuc
    DocumentRoot "E:/Eclipse Workspace/drupal"
    Alias /phpmyadmin       "E:/Program Files/phpMyAdmin"
    <Directory "E:/Program Files/phpMyAdmin">
      Options None
      AllowOverride None
      Order allow,deny
      Allow from 127.0.0.1
    </Directory>
    <Directory "E:/Eclipse Workspace/drupal">
      AllowOverride All
      Order Deny,Allow
      Deny from All
      Allow from 127.0.0.1
      Allow from 192.168.1.1
      Allow from 192.168.1.2
      Allow from 192.168.1.6
    </Directory>
    CustomLog logs\cuc-access.log common
    ErrorLog logs\cuc-error.log
</VirtualHost>

On the XP machine:
Host file has "cuc" associated with 192.168.1.2 (the W2K mahine)

On my W2K machine, entering "http://cuc:8080" in a browser takes me to the site (also located on W2K)
On my XP laptop, entering "http://cuc:8080" takes me to the root of the apache server, but I can't get any further.

I updated the DNS server with an entry for "cuc" pointing to W2K's IP address (192.168.1.2).  It did not change anything, tho.  I tried pointing it to localhost (127.0.0.1) but also to no avail.  Since I also have IIS on the W2K, I've told Apache server to listen on port 8080.  Therefore, I append my site names with ":8080".

I've set things up to work okay locally on W2K PC, but perhaps not for networked machines??

Let me know if you need any other info.  Thank you so much for your help.




 
0
 
LVL 7

Assisted Solution

by:darrickhartman
darrickhartman earned 250 total points
ID: 24062488
You cannot set up the VirtualHost container to have 127.0.0.1.  You can use a wildcard * instead.

<Virtualhost *:8080>

This will use the ServerName to determine how to serve the correct page.
0
 

Author Comment

by:mhugos
ID: 24062965
Awesome!
That was it.  A million thanks.
0
 
LVL 9

Expert Comment

by:oliverpolden
ID: 24442627
Accept his answer then!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Let’s list some of the technologies that enable smooth teleworking. 
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now