How to build a server

Hi,

I’ve been learning about building Rails apps for about 8 months but I
don’t really know how servers work or how to build a server. I have an
old 450 GHz Pentium computer I can play with. Since I use OS X, I was
thinking about installing a BSD system and trying to make a
MySQL/Rails server. That is about all I know about servers.

How does a server in my house get connected to the actual internet? I
suppose I would need a fixed IP and a special connection (not cable
modem?). Can I just connect the server to my router and surf to it
from my Mac?

Any pointers about where I can learn this stuff?

Thanks,
Peter

Peter,

I just did a presentation on this for the Orlando Ruby U. Group (of
which I am a part). You can get the powerpoint here:
http://www.orug.org/. I created a test server using Ubuntu and it took
about 15 minutes to get going (on an Athlong system with 512 MB RAM).
Check it out and post any other questions. Good luck.

  • Robert D.

Peter M. wrote:

Hi,

I’ve been learning about building Rails apps for about 8 months but I
don’t really know how servers work or how to build a server. I have an
old 450 GHz Pentium computer I can play with. Since I use OS X, I was
thinking about installing a BSD system and trying to make a
MySQL/Rails server. That is about all I know about servers.

How does a server in my house get connected to the actual internet? I
suppose I would need a fixed IP and a special connection (not cable
modem?). Can I just connect the server to my router and surf to it
from my Mac?

Any pointers about where I can learn this stuff?

Thanks,
Peter

Hi Robert,

Thanks for the reply.

Your presentation is what I am looking for but a little fast for me.
I’m sure you fleshed out the details in real life. You talk about
installing the OS, SVN, Ruby, Rails, Lighty. I understand the basic
ideas behind this stuff.

What I am wondering about more is how you physically wire all this
stuff together and make it so that multiple people can actually access
the server’s svn repository and view the websites that are on the
server. This could be for a household network with a router or for the
real world with the internet. For the world case, I don’t even know
what kind of wire/ISP service would have to come from the outside
world to my house. I’m sure it is a bit expensive.

Thanks,
Peter

Peter,

First, I have a cable connection (remember this is just a demo server)
with a static IP address. Behind my cable modem I have a firewall that I
have configured to allow access to the server. I am a special case as I
have multiple servers behind my firewall and have some interesting
routing rules for that, but I digress. So, I have a few domain names
that then point to my static IP address and I server demo pages via
that. This is good for a demo server or something to just have fun with.
There are online services though for actual deployment such as Text
Drive. There are also online subversion services. I wanted to test out
cron jobs and the like so I built my own server. I hope that answers
your questions; if not, let me know. Again, good luck!

On 5/18/06, Robert D. [email protected] wrote:

Peter,

First, I have a cable connection (remember this is just a demo server)
with a static IP address.

So I need to have a static IP. I will talk to my ISP about this. I am
almost certain my cable connection is using a dynamic IP. Then I
suppose I register this IP with a name server so that my domains point
to this IP.

So I will have my cable modem connected to my router. My router
connected to my server and my other desktop computers. When a request
comes in from the outside world, how does it know to go to the server
to find what it is looking for? Is this something I also have to
register with the name server?

Thanks,
Peter

If you are behind a router, just configure your router to forward the
ports
you need to be public. People will be able to access your server from
the
outside by accessing your router’s public IP address, which you can
figure
out by going to a site like whatismyip.com on a machine behind the same
router. As for accessing the server from within your network, you can
feel
free to use the LAN address (starts with a 192 usually) which you can
find
by invoking the ifconfig command logged into your server’s shell. Using
the
LAN address only works within your network, but you can use nonforwarded
ports and ensure that your traffic is remaining within your network.
Nothing special is needed when it comes to wiring, just plug it into
your
router like your other machine(s).

Zack

Zack,

I’ve never configured my router. Just use it so that multiple
computers can access the net. I don’t really understand how ports
work. I’m sure all this stuff seems very simple after doing it a
couple times. I’d like to read about how things work and why I do
particular steps. Any recommendations for quality beginner reading
about this stuff? I’m not a moron (I hope!) I just know nothing about
it.

Thanks,
Peter

You do not absolutely need a static IP if you are just doing little
projects, or using it for non-critical tasks. Check out ods.org for a
client that will update the DNS entries with your current IP address, so
in
the off chance it changes, your domain will only be down temporarily.

As for setting up your router, read in its manual to find out how to
access
the control panel. Log in as instructed, and find out how to do “port
forwarding.” You want to forward port 80 to the LAN address of your
server… try reading the router manual and it should explain this.

On 5/18/06, Zack H. [email protected] wrote:

People will be able to access your server from the
outside by accessing your router’s public IP address, which you can figure
out by going to a site like whatismyip.com on a machine behind the same
router.

So I just checked out my IP. It is something like

24.68.96.174

Is that all there is too it? So for the time being that is uniquely my
house?

Thanks,
Peter

On 19 May 2006, at 06:28, Zack H. wrote:

should explain this.

Keep in mind a lot of ISPs block incoming connections on ports < 1024
to prevent you from running your own server, depending on where you
live.

Best regards

Peter De Berdt

Hello Peter,

Peter M. wrote:

So I just checked out my IP. It is something like
24.68.96.174

Is that all there is too it? So for the time being that is uniquely my
house?

Most likely this IP changes whenever establish the connection to your
ISP. So that’s not very nice as you will have to check again what your
IP is. And if you are not at home, this could get difficult.

There are services like

that give you a dns name under which you can access your current ip
(like myhome.dyndns.com). You just have to tell the service every time
you get a new IP, which can be automatically done with some linux/unix
shell scripts, e.g.

Some routers do have this functionality integrated.
Of course you still have to manage the port-forwarding.

I hope that helps,

Philipp

“They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.” Benjamin Franklin