• Lexical scope — Miscellaneous nerdosity. Programming and... uh...
  • Managing a Server

I need to understand the next step in my technological education. I'm a high school student, and I'm wanting to learn more about servers over the summer. I set up an Ubuntu web server. The problem is, when I'm reading the docs for server software (nginx) and I'm setting things up, I feel like I'm blindfolded and like I don't have a full understanding of what I'm doing.

Basically, I'm asking--do I need to just read the documentation fully before taking further steps? Do you all recommend some blog posts or anything? Do I need to read up on other topics, such as terminology?


You could refer to guides, I guess. Reading the documentation is usually a very good idea, but you should read a step by step way to set up a server. Just as a starting point. Shouldn't be too hard after that. I one set up an apache server reading the absolute minimum of the documentation. This resulted in an online website, but no DNS resolution.

And yes, you should be familiar with the terminology.


Try using a piece of management software, like Webmin. It can automate a lot of things for you.


Webmin and cPanel will teach you to run a server about as well as going to Burger King will teach you to cook.

This is such a broad topic that I doubt you'll find a guide tailored to exactly what you want. Read a lot of manpages, read a lot of documentation, ask nerds if you have specific questions.


In that case, I have a question that is, I think, straightforward.

According to, my IP address is This is the server setup: server{

listen 80; root /usr/share/nginx/www; server_name localhost; index index.html index.htm; location / { try_files $uri $uri/ /index.html; }


Do I have something misconfigured, or do I need to take another look at my router configuration? The problem is that when I try to open the public IP in my browser, it just says 'could not connect.'


Try opening it on someone else's browser.


Well, I've tried opening it at work, and I end up with the same error.


What is the URL of the page you're trying to open?


The page is the index of the directory being served--since I can access it from the local IP of the server, and since the ports are forwarded correctly, it should be accessible from the public IP of my router, which is

tl;dr ->


Which port did you forward? (At this point, I'm shooting randomly; I don't know too much about this either, but sometimes intuition helps.)


ARE the ports forwarded correctly? On your router?


I'm pretty sure. I forwarded port 8080. Here's a screenshot of the port forwarding setup.


The server is using port 80, not 8080 (that's what the line in the config that says "listen 80" is for).


I fixed that. I thought I had changed the config to 8080, but i apparently changed it back. The new server setup, for Pyramid: Generally, you will want to move this file somewhere, and start with a clean file but keep this around for reference. Or just disable in sites-enabled. Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.

server{ include /etc/nginx/fcgiwrap.conf;

server_name; location / { fastcgi_pass; include fastcgi_params; fastcgi_pass_header Authorization; fastcgi_intercept_errors off; }



Yeah... never used nginx.. and I've found Apache set up fairly painless.

I was getting a look at the files... it looks enough like lighttpd that I kind of shy'd away (I've never had lighttpd work for me on a setup... so many screw ups it is silly), then going through the documents... its like the love child of Bind and Squid using lighttpd as the surrogate mother from my current look at it.

What you are doing is a common issue.

There is a lot of stuff used in the world of computers that is completely misused every where you go. For example, using Perl5 to serve up web pages was not what Perl5 was originally intended to be used for (if you asked Mr. Wall, I think he wanted to make BASH code look even more frightful than it already does). However it works good like that--kind of, Catalyst is a bit iffy to use, and most people forget use strict; and MOOSE exist (or hey, use v6; is also a suggestion as well). On the other hand, | less is often used as a command pager... however doing something like cat mah.file | less is using it wrong in the worst way possible.

Most computer stuff is misused entirely to some degree--or at least used for its original designs.

You essentially are using something like SQUID, or lightproxy or whatever as a webserver... as is a very common practice these days.

However you are entering into something kind of backasswards, that no matter how common it is, it still will be confusing for somebody who has no experience with the stuff.

Go with something that is an actually http server. Maybe an SSH server later. If you are feeling really frisky, an OpenGate server (or whatever the Asterisk Team started working on, after they quit Asterisk). Avoid Bind and sendmail like the plague. In fact, avoid any DNS or Mail server. You do not want to be qualified for those jobs.


Are you implying that nginx is not an http server?


Eevee. No, I'm flat out stating it is mainly meant to be a reverse proxy server. The use as an HTTP server is just a decent side effect people started making use with.

Maybe I could read further into the manual and various posts about it to find out this initial information is somewhat misleading... but yeah.

It is not the first time a weird side effect became the main use of a piece of software. Especially in network programming.

My main suggestion is: go with something that is not going to confuse somebody whose never run a server before. To go with entirely in the context of the question being asked here.

Once he has gotten a bit more into the groove of this stuff, then yeah, run nginx and whatever the hell else he wants to run.

To go on: the documentation on Apache (last I checked... this was version 1.3 or 2.1 or something) is much more complete than the documentation on Nginx (which states it is incomplete at the start). Which for somebody unfamiliar with setting this stuff up, at least going with something with complete documentation is the better bet.


The line you're drawing here looks pretty artificial to me. If it's a good reverse proxy, then it has to be a good HTTP server.

Apache has the same available approaches to app serving that nginx does: reverse proxying, built-in wsgi, built-in fastcgi, built-in uwsgi.

And while nginx certainly has terse documentation, it has generally fewer weird interactions between features than Apache.


To be fair, "reverse proxy" sounds like a silly term from a Hacker movie. My mind replaced it with something that actually made sense in my own head.

I think I may have been applying a fair amount of undo prejudice to the whole project that different key words seemed to only inspire further.

As I honestly have issues looking at its name, and taking it seriously. Then going through its website, I lost my ability to think the ones behind it are people.

Now, my own bitchy little jadedness aside, it likely is a pretty decent product. Well, at least a highly used one--which is noteworthy in itself (like say... PHP. Annoyingly horrid to actually try to use... but good to know due to its high use). Or it might be as you said, it is a good product with a high amount of use.

I dunno... it is something I've had issues looking into, as it keeps tossing out stuff that makes me go, "are these guys for real".

Perhaps you are correct Eevee.


Under absolutely NO circumstances do you EVER want to use Webmin with a server that you are going to port forward on. The people who make Webmin themselves even warn about this, so its probably not a good idea.

To answer your question, in most cases, Ubuntu is probably not the best option for a Server, being a desktop distribution (and a poor one IMO, but that's probably just my elitism showing - I use Arch Linux :p). If you truly want to learn how to set up a server, don't make it a production server until you've gotten a fair bit of experience under your belt in how to run it, and use a true server distribution such as CentOS or RHEL.

Its also a lot more practical to just buy hosting somewhere if you just want to make a website. Most ISPs will start charging extra money if they find out you are hosting a server of any kind (its why they have special plans for it), and trust me, they WILL find out. Sure, you don't get as much control this way, but that also means there's less things for you to screw up.


veekun runs on Ubuntu Server. So does my workplace. They do relatively little stupid crap to the server edition; it's like a less-ancient Debian.


Yes, that may be true, but I still wouldn't recommend it to a beginner, the same as me not recommending my current desktop distro (Arch Linux) to a beginner. Unless they want to learn things the hard way, then the opposite would be true in both cases.

However, you ARE aware that there are flavors of Debian that are more up to date than the primary release ones, right? Such as testing and (don't even bother with this one, just mentioning it for good measure), unstable. However, for a server, ancient could just mean that its actually an older version of the software that the packagers made some fixes of their own to for stability (such is the case with Red Hat, not sure about Debian though).

Anyways, I am by no means bashing on Ubuntu, as it would be against my beliefs, that everybody is entitled to choose and experience different things for themselves - IMO believing the opposite would be against the spirit of Free Software.