# NOOB VS. HOMENETWORK

## kramerkeller

I am a noob with a general question regarding servers.  I was just wondering where I could look up information or what server program I should use.  If I could at least "emerge" a server program I could look into it further from the man.  However, I would love a detailed guide on how to set up a server.

U guys are the best thanks in advanceLast edited by kramerkeller on Tue Jul 12, 2005 6:49 pm; edited 1 time in total

----------

## John5788

it depends what kind of server. if you want a webserver, install apache, php, mysql and anything else you need for it. if you want email server, you can install courier-imap, postfix, or exim or whatever you want. what kind of server were you planning on making?

----------

## kramerkeller

I have done the PHP triad in windows, so I probably should do that.  How do I install what I need for PHP APache and MYSQL and is there a visual environment to work with or will I have to use all programs form the terminal.  I have gotten pretty far with gentoo and have done some linux, but and pretty newbish, but I do know how to work with the triad in windows.  How do I get the stuff working and what programming environments are available?

----------

## John5788

i dont run a gentoo webserver, but I would assume you emerge apache, php, mysql and anything else you need. I'm not familiar with this triad program you mentioned, but you can use any editor you want, whether it be a graphical one like scite or from terminal like nano.

----------

## Suicidal

For a simple web server with mysql and php for starters i would:

```
emerge apache mod_php mysql 
```

Check out the docs section on the main gentoo.org page; sure there is alot more detailed info there.

----------

## kramerkeller

Okay so I ran the command

emerge apache mod_php mysql

and um...although I have worked with this stuff in windows I gues I dont' know what to do.  Can I just right a file in nano or something and then it will work in mozilla or something. hmm

Also I have heard about SSH

I would like to remotely access my linux box from school and other areas in the house.  SHould I use SSH or do you guys have any other suggestions.  Also - what the emerge coomand be?

----------

## John5788

you probably already have ssh installed. just start it up like this:

# /etc/init.d/sshd start

you can add it to your startup process like this

# rc-update add sshd default

For apache, you need to edit the httpd.conf file and then start it up probably using the init.d scripts as well.

----------

## kramerkeller

I have a job that allows me a lot of time on the computer.  I guess I have ssh I started it up.  How would I go about accessing it from another computer.  It would be great if I could work on gentoo linux while at work!!!!

----------

## statwizard

You'll need to know your IP address, and hopefully it stays relatively constant.  (My cable provider will occasionally change mine every several months.)  If your PC is directly connected to your service provider (no router) you can get your IP address by running "ifconfig" and reading the line for your ethernet interface.  If your PC is connected through some sort of a router (example: a wireless router), you will need to see the router's documentation for two things: 1) finding out what your real (external) IP address is, and 2) how to do a "port forward" to your Gentoo box -- you'll need to make it so that a connection to your router's port 22 passes on to your Gentoo box, port 22.

Once you get the local stuff taken care of, try going to a remote computer (like the one at work).  Use a secure shell program and open a connection to your IP address.  From a Windows system, I usually use PuTTY -- a google search for "putty download" will get the program for you.  If everything is set up right, you'll get a terminal window on your box at home.

Now, if you need more than a terminal window, you're going to need to look in to more advanced programs (out of my league).

----------

## bonbons

 *kramerkeller wrote:*   

> I have a job that allows me a lot of time on the computer.  I guess I have ssh I started it up.  How would I go about accessing it from another computer.  It would be great if I could work on gentoo linux while at work!!!!

 

```
ssh gentoo-box.domain
```

. If your box has a public IP and your company has port 22 open to outside world, then it's as easy.

If you have your gentoo box behind a NAT router, then you have to forward port 22 from the router to your gentoo box. Eventually remapping the port may be useful if you work behind a restrictive firewall.

----------

## kramerkeller

Okay so I have SSH running.  I am loving this stuff.  Anyway.  I also have a roomate with a mac and I have a sepearte windows pc.  He was able to log into my machine with ssh.  From my windows machine I was able to log in with putty.  Of course I was using the local area network.  I don't know if anyone has ever used putty, but now I am trying to login from work.  I know I need to use um ssh gentoo-box.domain I guess to get the adress.  My roomate is at home getting it right now.  However, we do have a router.  So if I get the address taht cox-cable provides (i know it changes but we have it for 3 days at least) and then of course I have my local address.  What would I type into putty?  Anyone know?

right now we are using kyle@168.192.0.7, but I don't know where I put the address the router has?  OR how I go from the router to the pc to log in.

Anyone with some putty help -THANKS AGAIN in advance.

----------

## kramerkeller

This is what I got

ssh gentoo-box.domain

Name or service not known

so....yeah I don't know

----------

## kramerkeller

So I set up a port forward on my router to forward anything on port 999 to 192.168.0.7 (my linux machine).  The linux machine is running ssh.  I used putty to go to my ip address (the router) and then the port of course thinking it would go to the IP address find my router and then forward from port 999 to the linux box at 192.168.0.7.  It must have worked because it said

10.16 Network error: Connection refused

Which I looked up to mean

This error means that the network connection PuTTY tried to make to your server was rejected by the server. Usually this happens because the server does not provide the service which PuTTY is trying to access. 

Check that you are connecting with the correct protocol (SSH, Telnet or Rlogin), and check that the port number is correct. If that fails, consult the administrator of your server. 

So it seems to be trying to connect and getting to my machine (as it did not get to the other machines in the house), but maybe there is something wrong or something I need to set up on SSH?

----------

## Felly

Are you routing to the correct port (22) ?

Also, for general information about setting up a server with Gentoo, check out the Gentoo Wiki. Lots of excellent stuff there.

----------

## kramerkeller

okay, well I see how it says port 22.  My router takes a port number and forwards it, so if I forwarded 999 to the local address.  I gues I could change it to 22, but then what do I do when I want the router to forward to other local machines.

I don't know if this makes sence, but basically from my netgear router screen I specifty that 

port 999 forwards to 192.168.0.7

port 1000 forwards to 192.168.0.8

So if I change the linux box so its 

port 22 forwards to 192.168.0.22

Then what do I do for my other machine?  Or am I tottally on the wrong track?

----------

## John5788

take port 22 at your router and forward it to port 22 on your computer.

----------

## kramerkeller

So I take port 22 on the router and then route it to 192.168.0.7:22 and then my other computer which is 192.168.0.1 cannot then get forwarded from 22.  In putty it lets you change the ports

Could I send to port 1000 on the router and then forward it to port 22 on the linux box?

Or am I missing something altogether here.  Maybe I need a little lesson on ports and what requires port 22 SSH or Putty?

----------

## xbmodder

Ok! SSH runs on port 22!

Diagram time:

```

w00t!

 ============                            ____________

| Kyle's box   |                             |       router    |                   ______

|      IP:         | <-----------------> | IP: XXX.XXX|  <----------|Internet| ----------->|office|
```

|192.168.0.7 |        port 22        | <--------------| port22      ---------- 

 ----------------                           ------------------

----------

## kramerkeller

Honestly, I have no clue what that diagram is saying.  Is that forward port 22 to port 22 on 192.168.0.7 and if so how does that resolve the problem of needing to forward to other PC's that may be on the router other than 192.168.0.7

However, only port 22 for SSH then?

I just don't get the reply too much at all.

----------

## John5788

if you need SSH to be port forwarded to other computers, just port forward say port 50022 to port 22 on the other computer that needs ssh and use putty to connect to port 50022.

----------

## kramerkeller

Okay so maybe my router just sucks, but most the stuff I looked up shows the same thing.

   	#  	Service Name  	Start Port  	End Port  	Server IP Address

 	1	LINUX	             22                22                 192.168.0.7

 	2	Login	              23	        23                 192.168.0.8

So port 22 works and gets me to the 7 machine

Now I would use something different like port 23, but then how do I get it to route to 192.168.0.8

THe start and end port have to be either the same or a range.  The start point does not forward to the end port.  It is just a range.  SO you see I don't know how I could hope to log into more than one machine if the only port I can use is 22.  I also tried adding :22 at the end of the local IP, but it won't fit

So I am on my linux box, but am not sure how I could get onto my other linux box and mac and god forbid, Windows

----------

## xbmodder

There are ways to do this:

You can set the port SSHD listens on. For .7 we make it 22. for .8 we make it 23, so on!

you can set this by editing:

/etc/ssh/sshd_config

and the Port line

----------

## kramerkeller

All it shows as far as ports go is 

#Port 22

Protocol 2

#ListenAddress 0.0.0.0

#ListenAddress ::

So I think the Port 22 part is commented, but maybe Protocol 2 means port 22, how can I change it to port 23?

Since my router forwards 22 to my 168.192.0.7 and I would like my router to forward 23 to 168.192.0.8

WOuld I change the ListenAddress to 23 or something.

Also, is there a way to just access my whole home network?  Like instead of logging into each machine, a way to just set my router or go through a machine to browse my home network and all the computers on it?

----------

## xbmodder

uncomment "port 22"  as it is the default and replace it with "Port 23"

----------

## ikke

Dont port forward, use an SSH tunnel to some remote server to access your box, much safer.

----------

## DaveArb

 *kramerkeller wrote:*   

> So I take port 22 on the router and then route it to 192.168.0.7:22 and then my other computer which is 192.168.0.1 cannot then get forwarded from 22.

 

Once you have ssh'd into 192.168.0.7, you can ssh from that machine to 192.168.0.1.

```
karmerkeller's 192.168.0.7 ~$ ssh 192.168.0.1

Password:

karmerkeller's 192.168.0.1 ~$
```

Dave

----------

## kramerkeller

Dont port forward, use an SSH tunnel to some remote server to access your box, much safer.

----------

## kramerkeller

I just need help with remotely accessing an entire home network.  I can access my linux box by port forwarding to the linux box from the router.  How should I set up a homenetwork that I can access from outside - should I always just go through one linux box and then tunnel to the windows and mac machines with local area IP?  Or can I jsut remotely access the routers and link to any pc on the network.  Please help?

----------

