I want in depth instructions, what I’m thinking is using this ancient ’98 dell xps with a 6 gig hard drive, possibly more. I will use some version of Linux built for servers, probably Ubuntu 8.04 or BSD, due to security reasons, remember most people spy through windows. 128 Megs of RAM and a basic setup other than that, 1 CD drive 1 floppy, 2 USB ports a couple serial ports and, of course, an Ethernet port. What exactly do I need to do to make it into a good web server. I’ll sell server space for basic HTML sites, so I may upgrade it to a cheap 80GB hard drive, and if it turns into a good business, I may just daisy chain loads of hard drives and become the first person I know to have a terabyte of space. would it be possible to host multiple websites from one server? I have cable internet with a wired network. like I said, I REALLY NEED IN DEPTH INSTRUCTIONS
Ok, I now have 46GB of space to work with
and would 3 ethernet ports be enough? That’s my maximum.
I MAY add some ram If I could find it, probably around an extra 192 MB of ram if I can find it, as for OS, I’ve used Damn small before on a virtual machine, and could you use it as a web server, remember, I now have an extra 40 gig hard drive to work with.
Skip desktop distros with only 128 megs of RAM. I’d recommend possibly CentOS haven’t tried it on a machine with that little amount of RAM before. Quite probably your going to want to actually get your hands dirty with the kernel. BSD is acceptable but you’ll find the UI to be quite primitive even on the command line. Windoze no way you run anything close to a real web server on that little amount of RAM. You might get XP to boot up but the second you add MySQL and Apache it’ll crater on you.
You’ll want a kernel minus everything you are not using. The Linux kernel is pretty lean as it is but if your hosting multiple sites on that small amount of RAM you want the kernel as lean as possible.
Don’t install X at all on that machine and 6 gigs will be plenty of space as long as you watch your logs and nobody is doing massively DB intense web sites. HTML code and back end scrips like PHP and such take up only tiny amounts of space. You could have thousands of web sites hosted on there as long as they don’t have large image files and such.
I will give you the basics, each of these steps you’ll have to look up separately as there is not enough space to even attempt to walk you through it and it would take some time. Most of the complications are the low amount of RAM on your machine.
When partitioning create a separate partition for your web and DB. The reason you do this is that if the logs fill up the entire partition only your web server and DB become cranky not the whole machine. If you fill up the root partition you can only log in as root as you’ll not be able to write tmp files and other stuff until you clear some space on the drive. I suggest this partitioning scheme.
/ 4 gigs
swap partition 256 megs
/webdb the rest of your free space.
When you install Apache and MySQL edit the configurations to use /webdb for logs and put your www root on the webdb partition as well.
The other reasons for this partitioning scheme is that it makes it easy for backups and disk quotas. Enable disk quotas for that partition. You may also want to make it an LVM partition. That way if you add a second drive you don’t have to do anything but partition the new drive as LVM and add it to the logical group and your 2 gig webdb partion becomes whatever size partition you added plus the origional 2 gigs. Using LVM a partition can span drives.
Don’t use LVM for /. If theres a problem you want / to be a normal ext3 partition.
You’ll want to install PHP.
With MySQL CHANGE THE DEFAULT ADMIN PASSWORD.
Next thing after you get all that installed is you’ll want to turn any unnecessary service off. If your not susing it turn it off. By not running X you’ll already have a pretty lean machine going but every byte counts.
When it comes to separate websites your going to need to create a user for each of those sites. It is preferabl for security purposes to force them to SSH in rather than using FTP but that is probably not practical for a commercial situation like what you are talking about. You’ll need to configure your FTP server in that case. There are several good ones for Linux. Check out the features the turn around on any security issues and set it up.
You’ll also want to write a quick bash script for creating new web sites that creates the user assigns a random password. creates the dirs for their use and modifies the apache configuration files to add their site.
Your going to want to throttle their bandwidth based on usage. There are some good tools for that. If you check the Apache documentation on throttling bandwidth you can find some help there.
You can host hundreds of web sites from the same machine. Apache is very good at multiple websites. There are some tools that make configuration of such sites easier. You can also hand edit the Apache cfg files to accomplish the same thing. More so you can assign limits to how much disk space they may use, how much bandwidth per month they may use and so on.
If your machine was built in 98 it probably has a 10 base T ethernet card in it. If so you need to upgrade that to at least a 10/100. It’ll remove a possible performance bottleneck. Put in a gigabit card if you have a gigabit switch even if your connection isn’t that fast.
With that particular machine no your not going to have a terrabyte of data. The IDE drives it supports are not that big. I’ve got an older Dell built around 2002 and it doesn’t even support EIDE. When the drive in it failed I had to go to Dell to get a non-EIDE drive. You can probably pick up a cheap IDE raid card and older IDE drives from a swap meet or something like that. The IDE drives you buy off the shelf today likely will not work in that machine. I tried to put a 200 gig drive in my Dell and the BIOS barfed on it. I have almost 3 terrabytes scattered between my machines. However I use it mostly for recording my own music which is very disk space intensive.
I think I’m out of room in fact
on: 27th December 08