|
|
Setting up a Web Server in Your Basement
| |
This is medium skill task. You should have some experience with Linux and technical problem
solving before attempting this. Knowledge of a programming languages is not required but your
journey will be much easier if you've done some programming debugging.
Your most valuable skill will be knowing how to find obscure things with Google. People who
post questions/solutions in the Linux world tend to be either newbies who are struggling with
how to ask a proper question or experts who assume you have an complete understand of the topic
and offer very brief and jargon laden responses. You may have to read a post, spend an hour
reading other posts, then return to the original post before you understand what is being said.
Forewarned that this adventure can be days of failure and frustration here we go...
Before You Start
If you want to put your experimental web server on the internet you will need a named address. Mine is "sooty.ca".
I paid a registration fee (about $25) and a yearly fee (about $10/year) for that name.
You also need a DNS provider. I'm in Canada with a .ca domain so I'm using EasyDNS.
In the USA NO-IP is popular and offers free sub-domains on their domains (like myserver.no-ip.org).
If your ISP (internet service provider) gives you an ip address from a pool (dynamic) you need to
buy the more expensive DNS servers ($40/year) to point
the ip (like 9.9.9.9) to your domain (www.myserver.ca) so people can reach you by name.
The free solution is get a domain from NO-IP, find out what your ip is today (log into your router in your house) and manually
update the No-IP account. You have to do this every month or every time you ISP changes your ip.
The full solution (set and forget) is buy a domain, pay for DNS services, and put software on your web server to automatically
update your DNS provider with the ip you get from your ISP.
Part 1: Installing Ubuntu 12.04 and the Apache Web Server
Get an old computer. Webber runs fine on a 400Mhz Dell with 384Mb and a couple of 20Gb disks.
The installation will erase anything on those disks so do not use a computer you're using for
something else (like your mail/online banking Windows computer).
A Linux server is extremely efficient and without a GUI (Graphical User Interface) needs
only a small CPU and memory.
Download ubuntu-12.04-server-i386.iso from
http://releases.ubuntu.com/precise/. If the download page looks daunting or the language used
is unfamiliar you may be in trouble. Learning technology is a painful process. It is 99% failure.
When you do succeed you should get a giddy rush of satisfaction knowing you've accomplished an
extremely difficult task. If that rush cannot sustain you though the frustration find something
easier (become a sports fan)...end of emotional advice.
Burn the ISO to a CD. I've found that the free Nero which everyone gets with their new DVD drive
sometimes fails or burns an unbootable CD. ImgBurn is a little more difficult to use but on ISOs has
never failed me.
Do not plug in an ethernet cable to your server. You want to fix your local ip address. The installation will ask your
router (DHCP) for an address and this will fail (a good thing) because it cannot get an answer. You will
then be asked to type in an ip address.
I used 192.168.0.99 because it's out of the way. Most routers install with
their address as 192.168.0.1 and offer dynamic ip addresses to other computers on your LAN starting
at 192.168.0.100 and up. You need a fixed (static) ip address because to need to configure your route
to pass http (port 80) and ftp (port 20/21) from the internet to your server. [more later]
Boot the CD, answer the language and keyboard questions. Put in your real name and pick a simple password
like "mumble". This is not a secure machine do not use your online banking password.
Do not encrypt the home directory.
The DHCP will fail (good) and you will be asked for an ip address (mine is 192.168.99).
You will be asked for a server name (mine is webber) and your domain name (mine is sooty.ca). Now plug the
ethernet cable in.
Select "Guided use entire disk" and let everything default. This is where everything on the disk is erased and
replaced with Linux (last chance to change your mind).
Do not use LVM if you have multiple drives in the box. Put Linux on one disk and mount the others as
data drives. LVM is very convenient for managing a bunch of disks as a single logical volume but a disk
failure can be difficult. This is an experiment on old hardware...keep the configuration simple.
Do not take automated updates. This is an experiment and some update might magically change something on your
server that took you days to figure out. Later you will be installing previous versions of software because
July 2012 versions do not work properly.
About 30 minutes into the install you will be asked about tasksel packages. Install these:
- openSSH - this is Secure Shell Communications. This is the main way you will talk to your server
to install packages, configure software, and upload your web site. It will put you in an encrypted Linux command
line interface (like DOS). You will use PuTTY on your Windows system to talk to this.
- DNS - this is Domain Name Services. You need this but you don't need to touch it.
- LAMP - this is the web server software. It stands for Linux, Apache (the HTTP Server),
MySQL (the database software) and PHP or Perl or Python (the programming language you will use).
- Mail - this allows you to have mail accounts like me@my-webserver.com.
- Samba - this allows Windows computers the see the your server as shared files on your network.
You don't need Postgresql (another database), Print (no print from this server), Tomcat (for web pages programmed in Java)
Virual Machine (for Linux inside Linux), or Manual Package (select additional packages...you don't have any more at this point).
20 minutes later you will be asked more questions:
- MySQL password. Use the same password as before (i.e. mumble).
- Mail server configuration type. Choose "Internet suite" - this gives you full/simple mail.
- System mail name. This should be your server/domain name. So mine is "webber.sooty.ca"
The installation will continue for about 20 minutes. It then asks you to remove the CD.
It reboots and your raw installation is ready for the next steps.
Part 2: Put your server on the internet (router configuration)
Part 3: Connect your domain name with your server (DNS Provider)
Part 4: Set up your web site (HTTP server)
Part 5: Set up file upload/download (FTP server)
Part 6: Set up mail server (SMTP/MX server)
|