Web Hosting Talk







View Full Version : Access LAN'd linux box via http://linuxbox/ ?


PaddysPlace
01-20-2004, 02:43 AM
Alright guys..
Here's the scoop, I just bought a KILLER new computer (I wont say stats because many people out there can beat it and I won't accept that )
My old comp (P3, 933mhz, not too bad) I whiped out the HDD and did a fresh installation of Linux..

OK I have a LAN, using ethernet cards and a basic linksys router. I've setup apache on my computer and made it viewable from the web all the time. Here's where I want to know though...

Is there anyway to make my linux box just sit there (where i can SSH and turn it on and off, and walk to it and reboot it as necessary) and I can type in http://linuxbox/ or something from any network computer and have it point to that? Or would I have to do the whole configuration of sending port 80 requests on my network to the specific linux box and access it via it's IP? This will be a box to test things like designs and programming so I would love to be able to do that...

I'm very curious, I've honestly never had a linux box right on hand, only dealt with them via SSH (So the interface is cool too!) and I need advice.

So yeah, if anyone has any suggestions please help

Realize I can't try anything out because I have THE PLAGUED ethernet card (the only one that doesn't work with linux, you guys probably know it, but the number is slipping my mind).

Thanks in advance.

Regards,
Patrick

CR-
01-20-2004, 04:11 AM
i believe you can setup dns and just use private ip's, so you can use hostnames instead of ip's. not quite positive though. i host my site off a reseller account and added my own dns name with the cable ip at my house (through WHM), and directed ssh to the ip of my laptop that runs FreeBSD using port 443 (in my router) (ssl port) so I can access it at work (which runs a firewall and won't let me use the default) ;) hopefully this helps a little.

J.

bear
01-20-2004, 04:09 PM
If you need to only reach it from inside the LAN, assign it a dedicated IP (192.168.*.*). Once that's done, on your local Windows machine, search for the 'hosts' file.

Once you find that, you will see something like this:
127.0.0.1 localhost

Add this line:
192.168.1.102 gateway #local server

Replace the IP with the one you chose, and the name of the LINUX box as well. Save and close.
Enter 'gateway' (your name, without quotes) into your browser, and hit enter. It should show you the default 'htdocs' page from Apache, if it's correct.
HTH.

MattF
01-20-2004, 04:24 PM
btw hosts file is at c:\windows\system32\Drivers\etc\hosts

Just add:
ipofLinuxServer linuxbox

then you should be able to view it with http://linuxbox/

If your non-webserver machine is Linux too then just add it to /etc/hosts

PaddysPlace
01-20-2004, 07:12 PM
Oh, so I can just change my computer to make localhost direct to 192.168.1.2 (IP for the computer) as opposed to 127.0.0.1? Thanks so much! This was EXACTLY what I was looking for! :D

Regards,
Patrick

bear
01-20-2004, 07:20 PM
No, you add a line beneath the localhost line.

PaddysPlace
01-20-2004, 07:21 PM
Got it working perfectly guys, thanks SO MUCH!

Only thing is, can i say what port I want it to be at? IE:

12.12.12.12:2086 test #opens WHM for server "test"

? Thanks!

Regards,
Patrick

<-- is very excited because he can now make is localbox private for testing :D

PaddysPlace
01-20-2004, 07:23 PM
Yeah, My host file now has:


127.0.0.1 localhost
192.168.1.2 box


I'm also adding a few things to make it easier to check my servers, aka typing http://servername/ instead of http://servername.masked-provider.com :D I just want to be able to add ports, but I guess http://servername:2086 is OK

Regards,
Patrick