Mini Project - Creating a Web Server

Associate
Joined
28 Nov 2011
Posts
48
Hi all,

I am very much a Microsoft person and have very little experience in Linux, however I have recently got a new job and there is a large open source community here (not specific for my role). I feel it will benefit me by learning the technology.

I have always been a person who likes to explore with technology, and I am lucky enough that I work for a data centre who allow their employees rack space for free.

For a learning experience I would like to embark on the setting up and configuring a Linux web server and additionally a mail server too.

I currently use 1&1 to host a few personal websites I have created and email accounts associated with these and would like to migrate them to this web server when it is complete (why not, it’s free ay? :))

I plan on purchasing something like a Dell Poweredge 1950 VIII V3 Server 2x Xeon L5420 2.50GHz 8GB Ram 1x 250GB HDD's. I can pick one up for £300.

I would also like my web server to be a VM as I would also like to configure a Microsoft VM later down the line on the same server.

So my initial thoughts are, please bear in mind I am very new to this ...

1) Install ESXi on my server
2) Create 1 VM
3) Install Ubuntu Server (I am expecting people to suggest red hat/ fedora here)
4) .....

And the next steps is where I would like advice/help.

What would be the best way of going about doing this, I have not really thought too much about it, so would love to hear some recommendations.

I know I will need to install Apache2, MYSQL, PHP but my issues are how, what is the best way to configure them etc.

I really would like to be able to host multiple sites and multiple email accounts from this server (not loads, just a few)

Would you recommend installing a 3rd party firewall like Shorewall, or is iptables sufficient?

All ideas are welcome, this will help me learn lots I think.

Thanks in advance, and sorry this is so long :)
 
Thanks guys, my plan is to do all of this via the terminal. I could easily install a GUI package but my main aim of this is to learn how Linux really works.
 
slylittlefox - thanks for the reply.

I am running through the Ubuntu server documentation and slowly getting to know things.

I havent bought the server yet so will take a look for HP DL385. I think the most confusing thing for me will be configuring apache to enable multiple hosts.
 
I must admit I administer my servers using Webmin but....

In Webmin, setting up virtual hosts within Apache is a piece of cake. And as far as I am aware, doing so using the config files shouldn't be hard. Once you have told Apache that it should handle multiple hosts in it's main configuration file, the multiple hosts are simply a few lines of directives for each one. All the main configuration is handled by the default host file.

I really ought to configure a server entirely from scratch one day without Webmin, but time is limited unfortunately :(
 
So basically if you're using ubuntu:

sudo aptitude install apache2
sudo vim /etc/apache2/sites-available/yoursite.com
sudo ln -s /etc/apache2/sites-available/yoursite.com /etc/apache2/sites-enabled/yoursite.com
sudo /etc/init.d/apache2 restart

/etc/apache2/sites-available/yoursite.com would look like this:

Code:
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName 192.168.1.10
        ServerAlias yoursite.com *.yoursite.com
        DocumentRoot /var/www/yoursite.com        
        ErrorLog /var/log/apache2/yoursite_.log
        CustomLog /var/log/apache2/yoursite_access.log combined
</VirtualHost>

Repeat this for everysite you wish to host, though to be fair those options are pretty bare, so thats where the manual comes in.

The reason you create the /etc/apache2/sites-enabled/yoursite.com symlink, is because it makes it easier to disable a website without losing anything of value.

vim my prefered text editor, you don't need to use it.

aptitude is easier to remember commands for than many tools which come with apt-get. It is recommended by debian to use aptitude, though most documentation refers to apt-get. They're basically the same thing otherwise though.

Finally knowing how to do this manually is all fine and great, but if you work in a data centre, many of these files on customer boxes may be edited by management code. Not always a good idea to edit the files directly, if its going to be overwritten by some code in the near future. :)
 
Last edited:
Yeah, ok, I'll be that guy....:D

CentOS 6 minimal and configure / install as you go. Keep it lean, keep it clean. No gui, terminal as standard :).

Great environment to learn on. Stacks of documentation around.

RB
 
Well CentOS is actually what i use for servers in every instance. It's just that after a fairly minimal install (i do include apache, mysql, networking and so on, but no X or desktop of any sort) the first thing i do after i log in is to add the Webmin repo and install, then it's pretty much all done from Webmin from that point.

Does that make me bad? :p

Although in my defense, the first time i setup a server i actually did all the dns and dhcp from a text editor and reading lots of info on the web, because I wanted to understand what was going on to some degree. But to be honest Webmin just makes it easy, and until I find myself sat around with time on my hands, I'm going to carry on using Webmin.

(I chose CentOS because it's pretty much Redhat and what's good enough for enterprise servers is good enough for me ;) but would anyone suggest any other distro for a server and why?)
 
Back
Top Bottom