Question:
How can I build a server that will handle many websites on a small budget?
Dustin
2008-12-21 09:00:37 UTC
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
Three answers:
draciron
2008-12-21 10:00:39 UTC
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
2008-12-21 09:19:44 UTC
You'll need more RAM and more drive. You can get a cheap,, good 500GB drive these days (are they still selling 80GB drives) - the Seagate Barracuda 500GB is solid, it'll last a long time and it's cheap. (Stay away from WD if you don't want problems.)



For the OS, I recommend PCLinuxOS Business Edition. I run a few of them - they come fully configured with more than you need for a web site - the normal Apache/MySQL/PHP, Bastille (it can be broken into, but not by your above-average hacker), mail servers, Webmin ... install, configure a few things and you're up.



You may want more than 1 Ethernet port - 2 lines, running totally separately, connected to 2 ports, so if one fails the computer uses the other one - automatically.



There's a PCLinuxOS BE forum, so you can get all the help you need, whether you've never seen Linux running before or you've done it all but you just can't remember what file to change if the beast boots into the console. They don't poke fun at rank noobs. (If you still want to run Ubuntu server, their forum is great also - but the server has no desktop, it's just a server. You access it from another computer. PCLOSBE has a desktop, making it just a bit easier.)



Step by step's not really possible - you need about 3 books - 1 on Linux itself (whichever distro you use - they're different), at least 1 on running a web hosting service and 1 on Linux security.



But to start, just pick a distro, burn a CD (or DVD for the larger ones), boot it, install it and play customer - see what it takes from the host end to make the customer happy. Don't even spend for a domain name until you're sure you're going to do it, because at this point you're only out 25 cents for the blank CD. If you change your mind, so what?
2008-12-21 09:19:41 UTC
If your websites aren't going to be getting much traffic then you should be ok with your current connection however you might want to upgrade to a package with unlimited bandwidth if you aren't already on one XD as for the server.. it doesn't have to be anything special unless your having several hundred people on your website at the same time... i would recomend using a zonbu mini http://zonbu.com/shop/product.php?productid=28&cat=2&page=1 its small and silent... if you want more space you could always plug in a usb external harddrive. of if you looking for somthing cheeper.. just go down to a computer fair and buy some old peice of junk... install Damn Small Linux (the reason for this is in it's name) and your ready to go XD



Hope this helps, Ben


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...