LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-15-2006, 05:45 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Advice on building web server


Hi folks,

I'm planning to build a web server on following PC;

CPU Athlon 64 3000+
RAM 1024M
HD SATA II 160G
OS Ubuntu on the server
http://www.ubuntu.com/server

Please advise what will be the best arrangement on the size of each of following partitions;

/dev/sda1 /boot
/dev/sda2 /
/dev/vg/home
/dev/vg/usr
/dev/vg/var
/dev/vg/tmp
/dev/sda4 swap

Any suggestion on above LVM order? In following order?
/usr
/home
/var
/tmp

Is "Ubuntu on the server" easy to configure?


Apache, MySQL and PHP come with "Ubuntu on the server" as default. What will be your opinion on MySQL vs PostgreSQL?


If allowing visitors sending webmail direct on the server what package will you recommend.

TIA


B.R.
satimis
 
Old 10-15-2006, 09:24 AM   #2
og-emmet
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
So many questions

> Advice on building web server
> Hi folks,
> I'm planning to build a web server on following PC;
>
> CPU Athlon 64 3000+
> RAM 1024M
> HD SATA II 160G
> OS Ubuntu on the server

As for the specs: what apps are you going to run? Maybe you need this hoursepower, maybe not.

Last year I needed a very low traffic web server, about 1k hits per hour, with php and sqlite, in a mad rush (like 30 minutes). I grabbed what spare gear I had and built it thinking I'd upgrade in a few weeks. A year later the only hw changes made are 2-250GB drives and an old promise raid card.

Specs for mine: IBM 300PL, 333MHz Celeron, 256M RAM and the above storage. Also an UPS with serial port.

Considering most 333MHz Cels are getting tossed in the trash that's not bad. While this worked for me it's clearly not for everyone. I've also built a web server with sqlite on a Linksys NSLU2, a machine that costs less than $100USD, completely silent and the size of a VHS tape (a fun box to play with).

The point is your software and load requirements vastly affect what gear you need. Exactly what are your needs? Mostly static pages, dynamic or both? php? sql server? AJAX? Will the server have other jobs like smtp server? Bzflag server? =)

Here's my two recommendations:

- Get a UPS with a rs232 or usb port. If you lose power the ups can tell the server when to gracefully go down and not just crash.

- Go raid 0/10. Even us tech people are bad about backups. Realizing this raid 0 (two drives each with the exact same data) could save you. If one drive dies you still have a functional copy of your machine.



>Please advise what will be the best arrangement on the size of each of following partitions;
>
>/dev/sda1 /boot
>/dev/sda2 /
>/dev/vg/home
>/dev/vg/usr
>/dev/vg/var
>/dev/vg/tmp
>/dev/sda4 swap

If this a home web server it's really up to you. Lots of folks like (w/o the LVM):

swap
/
/var

Again, for home servers, it's your choice.

> Any suggestion on above LVM order? In following order?
> /usr
> /home
> /var
> /tmp
LVM is good for spanning drives like raid 1 but IMO unneed here unless you're going to get a half-dozen of them. =)

>Is "Ubuntu on the server" easy to configure?
So, so easy it's a joke (a good joke). It's basicly the regular version of ubuntu with the GUI stuff removed. For ease of use it's a great first server distro.

>Apache, MySQL and PHP come with "Ubuntu on the server" as default.
Yes.

>What will be your opinion on MySQL vs PostgreSQL?
I use what works for me and what I'm use to: mysql and sqlite. With that said if you have no preference I'd try PostgreSQL first. BTW, any recommendation either way will start a huge flame war. =)

>If allowing visitors sending webmail direct on the server what package will you recommend.
IMO don't do it unless it's critical to your site. It's too easily abused with too little benefit. You really want the Secret Service kicking in you door at 2am because some luser decided to send a nastygram to a politco in Washington using your box?

Sometimes having just internal messaging helps and poses a much lower security problem.

If possible please post some info on what the full use of this web server will be. With that I and the many others here can give you some better and more detailed recommendations.

Good Luck.
 
Old 10-15-2006, 11:01 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi og-emmet,

Tks for your advice.

Quote:
> I'm planning to build a web server on following PC;
>
> CPU Athlon 64 3000+
> RAM 1024M
> HD SATA II 160G
> OS Ubuntu on the server

As for the specs: what apps are you going to run? Maybe you need this hoursepower, maybe not.
I just take what are available here, a newly built AMD64 bits box. The is only a test to experience building a web server. I never built it before.

Quote:
The point is your software and load requirements vastly affect what gear you need. Exactly what are your needs? Mostly static pages, dynamic or both? php? sql server? AJAX? Will the server have other jobs like smtp server? Bzflag server? =)
Both dynamic and static pages. It is not a mail server.

Quote:
- Get a UPS with a rs232 or usb port. If you lose power the ups can tell the server when to gracefully go down and not just crash.
Whether you suggested to get an uninterruptible power supply (UPS). It'll be too expensive for this experience.

Quote:
- Go raid 0/10. Even us tech people are bad about backups. Realizing this raid 0 (two drives each with the exact same data) could save you. If one drive dies you still have a functional copy of your machine.
I'll leave it to another experience later. Because I have only one 160G SATA II HD. Or maybe I'll consider software RAID.

Quote:
>/dev/sda1 /boot
>/dev/sda2 /
>/dev/vg/home
>/dev/vg/usr
>/dev/vg/var
>/dev/vg/tmp
>/dev/sda4 swap

If this a home web server it's really up to you. Lots of folks like (w/o the LVM):

swap
/
/var

Again, for home servers, it's your choice.
Not a home server. I'll abundon LVM and /boot. The latter is good for multiboot not for server. If integrating /home, /usr and /tmp on / why leaving /var in a separate partition?

How to cut the cake? I have 160G HD that will be more than sufficient for this test.

swap 2G (double the RAM size)
/ ?G
/var ?G


Quote:
>Is "Ubuntu on the server" easy to configure?
So, so easy it's a joke (a good joke). It's basicly the regular version of ubuntu with the GUI stuff removed. For ease of use it's a great first server distro.
Because Ubuntu is available in hand. I'll turn to centos.

At the very beginning I considered to build my own OS, LFS --> BLFS. But it'll take sometimes to build according to my past experience. This experience is solely to build a web server therefore I abandoned this idea avoiding adding further work.

Quote:
>If allowing visitors sending webmail direct on the server what package will you recommend. IMO don't do it unless it's critical to your site. It's too easily abused with too little benefit. You really want the Secret Service kicking in you door at 2am because some luser decided to send a nastygram to a politco in Washington using your box?
Again this is also an experience on building a webmail server. I won't get it connected to outside world.

A further thought, how to test it?

Quote:
Sometimes having just internal messaging helps and poses a much lower security problem.
Pls explain in more detail. TIA.

Tks.

B.R.
satimis
 
Old 10-15-2006, 11:28 AM   #4
Redeye2
Member
 
Registered: Feb 2004
Posts: 489

Rep: Reputation: Disabled
Quote:
Originally Posted by satimis
Hi folks,
I'm planning to build a web server on following PC;

CPU Athlon 64 3000+
RAM 1024M
HD SATA II 160G
OS Ubuntu on the server
http://www.ubuntu.com/server
If I were you, I'd install some virtualization server and set up the webserver on several distributions since you want to learn.
The hardware is solid for any kind of webserver so you're set on that.

Quote:
Please advise what will be the best arrangement on the size of each of following partitions;

/dev/sda1 /boot
/dev/sda2 /
/dev/vg/home
/dev/vg/usr
/dev/vg/var
/dev/vg/tmp
/dev/sda4 swap

Any suggestion on above LVM order? In following order?
/usr
/home
/var
/tmp
It's important to know the use of the webserver since it'll determine the best partitioning scheme. I think you're making a -lot- of partitions which can over-complicate things.
For example, if the server's going to be used to serve individual user pages for lots of users, you'll want your home partition to be the biggest of the bunch. It'll need to host all of the users files plus their webpages. You'll also want to use quotas.
If you're serving hosted pages, then you might want to create a new /www directory and change the server document root. I'd do that for simplicity, rather than /var/httpd/www.
I agree about having /tmp on a separate partition since it's world writeable and you don't want some malicious script or process filling up your hard drive
The boot partition... I'd skip over creating one if you're using ext3 as your filesystem. This will allow you to have several kernels without running into space problems.
About the swap, the old 2xRAM rule is dead (even moreso with your hardware). The reason is pretty simple, the server will almost never swap with 1gb and if it does, you just buy more RAM. Swapping is -slow- and you don't want it on production boxes.
My proposed scheme would be:
/: 8-10Gb
tmp: 2Gb
swap: 512mb
home or webserver pages: the rest

Quote:
Is "Ubuntu on the server" easy to configure?
It's based on Debian so it's very easy to add/remove software and it's all well documented.

Quote:
Apache, MySQL and PHP come with "Ubuntu on the server" as default. What will be your opinion on MySQL vs PostgreSQL?
I'd go with MySQL since it's faster and now version 5 supports stored procedures, triggers, views, etc.

Quote:
If allowing visitors sending webmail direct on the server what package will you recommend.
TIA
B.R.
satimis
I haven't fiddled around much with webmail (in fact I don't recognize any of those packages ) but you'll want to take the mail factor into account when partitioning also.
You'll want SMTP and POP3/IMAP servers also.

Last edited by Redeye2; 10-15-2006 at 11:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone please help me out on building a DNS and web Server on my machine FC2 babyboss Linux - Networking 5 08-05-2005 03:40 PM
seeking advice on running a web server hirman Linux - Newbie 4 11-25-2004 09:29 AM
Security advice for a web server please pembo13 Linux - Security 4 07-01-2004 03:19 PM
Need Advice on building a Linux/Samba Server for an internal corporate network mdkelly069 Linux - Networking 7 11-03-2003 04:26 PM
Guide to building a web server suderfield Linux - General 1 09-11-2003 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration