programming

projects 
« Back to blog

Web Server Redux

I got FIOS installed at home a couple of months ago (awesome, by the way), and with it, I got a new router. I happened to see the admin screen for the router and it looked like it was much better than the one from my previous Westell.

So, I decided to try setting up the web server again this past Sunday.  It was a great way to procrastinate from doing actual work.  After re-familiarizing myself with my setup (which I hadn’t touched in a while) and doing a quick review of the original nettuts article, I got Apache going, and I got ssh going from inside my home network.  Next was the part where I crashed and burned last time: opening it up to the outside world and accessing it from there.

First, the router.  My current router has a much more user-friendly interface, and I’m happy to say that this made things a lot easier.  I didn’t dive into it too deeply last time (being too busy with the gelato project), but I had heard that my old router wasn’t too easy to configure.  This time, it was a piece of cake to funnel a port request from outside into my server.  I opened up port 80 for HTTP and port 22 for ssh, then tested it with my iPhone with wifi disabled and everything worked fine.

After that, the firewall was a little bit more trouble.  I still couldn’t get Shorewall to do what I wanted it to do.  Somehow, turning it on prevented all access from the outside.  I tried a couple of alternatives that the Shorewall documentation suggested for simpler setups, but couldn’t get those to work either.  Finally, i just studied up a bit on iptables (a great tutorial on Just Linux) to see if I could configure it manually.  That did the trick.  I set up two simple rules: the first rule to accept ssh from port 22, and another rule to deny everything but HTTP from port 80.

Anyway, now I’ve got a web server that serves up my initials if you access it.  I can also log in to my computer at home while I’m away.  Yippee.  Not really sure what I’m going to do with it now, haha.

Posted by Anthony