Forum Moderators: bakedjake

Message Too Old, No Replies

viewing pages on a local apache

Any tips please.

         

mack

1:33 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



This is one of those questions that should be obvious, but I am no expert when it comes to networking and some advice would be very much appreciated.

I have 2 computers. One is running win XP and connects to the web using a dial up account. The second computer is running Suse Linux. And connects to the web through the win xp machine. The 2 computers are connected using network cable and a hub. Really this is 2 questions first one….

When I install apache on the Linux box how do I find the address to view the pages using the browser on the xp box. I can connect to the web no problem so the two computers are for sure connected properly,

Second. Is it possible to access the pages hosted on apache from an external location … by visiting an IP address etc.

I think the logical solution to the second would be to install the Linux box as the gateway computer and have that connected directly to the web. But it was a win modem and is not recognised by the OS.

So how do I view pages stored on a LAN server
And can I view these pages externally.

Thanks in advance.

dingman

2:17 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To find out what address to use when connecting to the Linux box, log in to a terminal on that machine as root, and type 'ifconfig eth0'. You should get something that looks like this:


eth0 Link encap:Ethernet HWaddr 00:00:21:CC:F2:90
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:626155 errors:0 dropped:0 overruns:0 frame:0
TX packets:225407 errors:0 dropped:0 overruns:0 carrier:0
collisions:137 txqueuelen:100
RX bytes:262150448 (250.0 MiB) TX bytes:26855549 (25.6 MiB)
Interrupt:5 Base address:0xf000

The part I added bold to is what you are after. In the case above, you would type 'http://192.168.1.1/' into the address field in your browser on the windows machine.

To visit this page from the outside world in your configuration, you would have to forward port 80 on the windows machine to port 80 on the Linux machine. I haven't a clue how to make a windows machine do this, although I have no doubt it's possible. (I don't do windows.)

mack

3:57 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



thanks for your reply. I now have the joy of a gatewaytimeout error :(

would this mean that apache is not started?

john316

4:16 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can try [localhost...]

if apache is running it will pull the index file, test it from the linux machine.

Big_Balou

5:25 am on Jan 19, 2003 (gmt 0)

10+ Year Member



"you can try [localhost...]

How would you do this if you try to use the box to host several sites.

I'm thinking about setting up the box I have Mandrake on to test sites before putting them up live.

[corrected spelling]

[edited by: Big_Balou at 7:01 am (utc) on Jan. 19, 2003]

mack

5:28 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



ok I have been trying to use the ip to connect and am getting a gateway timeout.

when I go to the linux box and browse to localhost I get a page not found.

How would I make sure apache is running?

Duckula

6:41 am on Jan 19, 2003 (gmt 0)

10+ Year Member



make sure apache is running

'ps -ae' for all processes, and 'ps -ae ¦ grep apache' or 'ps -ae ¦ grep httpd' for the specific process. One of these should output some lines. If apache is not running both will output nothing.

bcc1234

9:18 am on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How would you do this if you try to use the box to host several sites.

I'm thinking about setting up the box I have Mandrake on to test sites before putting them up live.

Assign a static IP to the apache box.
And on another box, just add domains to your hosts file (windows\hosts or /etc/hosts).

Let's say your apache box has an IP 192.168.1.10 and you want to create a testdomain.com.

Edit your hosts file on the other box and place:
testdomain.com 192.168.1.10

That way your other box will think that testdomain.com is on 192.168.1.10 without the use of a name server.

You can add as many domains as you need.

I run a freebsd box on the same lan and use it for testing.
And I test sites from a windows box with all those domains listed in the hosts file.

It also does the trick when you are moving a live site to a new host. It gives you the ability to test everything on the new host before modifying your dns zone and releasing it to the world ;)

Big_Balou

9:00 pm on Jan 19, 2003 (gmt 0)

10+ Year Member



Thanks bcc1234. This is my project for the week, at least part of it.

I also found a pretty good resource for linux newbies like myself at : [linuxnewbie.org...]

Disclaimer: I have no affiliation with the above mentioned site.

Big_Balou

9:07 pm on Jan 19, 2003 (gmt 0)

10+ Year Member



Started poking around in windows. Where would I find the host file in windows?

I'm running a dual boot win98/XP machine. Any pointers to the file would be appreciated.

bcc1234

9:19 pm on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On windows 98 it's windows\hosts, and I never used XP so I could not tell you.
Try searching for a file named "hosts" under windows including sub-directories.

bird

9:40 pm on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think Windows has a host file per default. If you don't find one, just create one yourself (using the right syntax...). I haven't had a look at XP yet, but in all previous Windows versions you could specify a host file in the DNS section of the networking setup.

bcc1234

10:50 pm on Jan 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There should be a hosts file with at least localhost and windowsupdate entries.

Big_Balou

10:58 pm on Jan 19, 2003 (gmt 0)

10+ Year Member



Thanks. I'm going to try a bit more tommorow.

[wife is calling me]

GeorgeGG

11:44 pm on Jan 19, 2003 (gmt 0)

10+ Year Member



In 98/95 look in the Windows for 'hosts.sam' and copy
to 'hosts' then edit.

I have something like:

127.0.0.1 localhost

# firewall/router gateway
192.168.2.1 mywall.domain.com
# This Win box
192.168.2.2 mymain.domain.com
# another Win box
192.168.2.3 mysec.domain.com
# Linux server box
192.168.2.10 myww.domain.com

GeorgeGG