Help - Search - Members - Calendar
Full Version: Linux Web Server Distro Recommendations
Linuxhelp > Support > Technical Support
I am looking at moving from a history of Windows based web servers (*place flames here*) to a linux server. I'm an absolute newbie to Linux. I've been working on predominantly windows based platforms as a programmer - I even spent some time working at Microsoft in the division. I've never had anything against Linux or any of the *nix family - I've just never really been exposed to it in a professional capacity.

I am completely self taught in all of my technological background, so I have absolutely no fear with picking up an entirely new operating system and again starting from scratch. Everyone on earth knows that when it comes to web servers, *nix is where it's at. I picked up a few Linux books (*tips hat at book recommendations on this board*), and I have a pretty good understanding of the basic principles behind the OS.

One of the books I picked up was "Building Secure Servers with Linux" by O'Reilly. It's been a fantastic read so far, and I'm very eager to get started. However, the one thing they're vague with in the book is what distribution of Linux is best suited for a web server "out of the box"?

I have friends who swear by Gentoo. Most of the people I've read on message boards recommend Slackware or Debian. I happened upon Server Optimized Linux and was quite pleased with the ideas there.

What it comes down to is that I need a quick turn around on getting this server up and running. In the beginning I'm only really going to need http, and a scripting language to go with it like php - maybe later I'll add mysql. I've got a firewall set up (Linux based, thanks to the fine folks at Smoothwall), so I'm not too concerned about hardening the server just yet. I know that once I get my hands dirty, all of the other stuff will fall into place.

So, what distro's do you guys recommend to get a reliable web server up and running?

And finally: what sort of conventions do Linux users utilize when it comes to folder structures of their web applications (ie. where do the web apps go on the server)? This is something that has always been a pet peeve of mine on Windows servers. Does anyone have any recommendations for web server applications "best practices" for Linux?

Hoping I don't get flamed too bad,
A guy who wants to try something new
One of the many great things about this forum is the lack of zealots (that I've noticed), and the people who answer questions don't insult you. happy.gif (one of the things that kept me from acually using linux for quite some time) *cheers*

You could really use any distro, but I'd suggest Knoppix for several reasons.

1. Great hardware detection
2. Comes with most of the packages you need, so you don't often run into dependency problems, and you don't need to go back through your CD and get libraries you need, and other such stuff.
3. Has apt-get, which makes for unbelivably easy updating/upgrading and installatiation of packages
4. 2.4.x kernel, so comes with iptables (great for firewall)

You can get it from

Pop the 1 CD into your CD-Rom drive, and it comes up (live distro). You can test to make sure it identified your network card correctly. Go in to the console/terminal, and type "sudo knx-hdinstall". Make yourself a swap partition (2x the ram you have should be good), and make the rest a linux partition (unless you want to have several partitions for whatever reason, or want to keep a windows installation).

When you restart and boot up, you can press "control+alt+f1" to switch to console mode (if you'd rather not use GUI).

Follow this guide to install mysql, php, and apache2 running together all friendly like. happy.gif

Note: I'm a bit biased towards Knoppix, but hell, it's great. happy.gif

And finally: what sort of conventions do Linux users utilize when it comes to folder structures of their web applications (ie. where do the web apps go on the server)? This is something that has always been a pet peeve of mine on Windows servers. Does anyone have any recommendations for web server applications "best practices" for Linux?

Following the guide, you'll have your website files go in /usr/local/apache2/htdocs

You can always change that when you configure apache, though. smile.gif

#./configure –prefix=/root/www –enable-mods-shared=most
Would have all your website files be put in /root/www/htdocs, though I would recommend using the default.
why in the world would you have the root of you webserver as
/root/www ? unless there is some specific reason that i have NEVER heard about
please inform me...otherwise i see that directory as an very BAD place if not possible
to put there...
I've seen some sites put it in home

like this /home/www/

Whitebox 3.0 is also good for servers, I've did a proxy/nat server, and a few samba servers with it, and ran into no problems with it, using yum to get it uptodate...and it also detects a lot of stuff...I guess if you have the time, DO DOWNLOAD both, or even more Linux distros, and try them out, and use what suits you the best and you're system...

Robert B
Chris: That was hypothetical example, did you ignore the words "example"? biggrin.gif

#./configure –prefix=/root/www –enable-mods-shared=most
Would have all your website files be put in /root/www/htdocs, though I would recommend using the default.

I've seen you had problems with Ati Radeon cards in 3D just like me...

have you found a solution to this?, any 3D success in Knoppix, ...I'm downloading Fedora Core 1 right now, I'll play with it for a while...after that I will try Knoppix.

Robert B

but you must realize that putting BAD examples is not good..because some people
might think that even though it is an example that it is ok to use that particular path, option

Don't get me wrong, it's a bad example... but not a horrible example. Apache, in my example, is run by the nobody user and group. chgrp the htdocs directory to nobody (read only), and it should be fine

Robert: Nope. sad.gif I just bought a $50 nvidia card from pricewatch. XD
Thanks to everyone so much for not flaming me to death. In my Windows development circles I've heard horror stories about *nix users being absurdly rude to newcomers. It's nice to see that the stereotype is not necessarily true in all cases :)

I'll certainly check out knoppix, whitebox, and the madpenguin guide. Thanks to everyone for the suggestions.

Side note: I love how a universal rule of message boards is that a thread can be completely derailed within two posts. Here I thought it was just on the boards that I've run :P
Like termina said ... just about any distro will work, I personally would recommend WhiteBox as well.

Debian is also good, and with the new installer ... sarge is fairly easy to get installed on most x86 machines.

Some linux boards are not very nice to newbies ... and I have my moments as well laugh.gif ... but I try to make nice most of the time!

Joey, duende and chrisw are also good guys to work with ... which is why I kept coming back here after I initially joined in July 2003.

Over the last few days since I asked for your recommendations I was waiting for some parts to arrive for my server, so I took the time to go to all of the sites you suggested (And a few that friends suggested) and did a *lot* of reading.

Yesterday my parts arrived in the early evening, so I ripped my machine apart and rebuilt it with all of my nice new fans and whatnot. At about midnight (bad idea, I know) I decided to get started with the first distro I wanted to try out: Gentoo.

I quickly discovered that despite the volumes of documentation available, it all answers so few questions! There are just so many options that I couldn't even begin to think about documenting everything. From step 1 I had questions that couldn't be answered without googling. At 3am after building my first kernel, the portage tree failed somehow, and I gave up on Gentoo.

I then inserted the Debian installer that was linked in this discussion - talk about a breath of fresh air. I ran it last night very quickly (it *was* rather late at that point), and decided that I'd start from scratch this morning.

Today I got Debian set up and ran dselect - read about every single damn package available and picked the ones I wanted. It just finished installing a few moments ago.

I must say, I know that I haven't even scraped the surface yet, but I have a whole new respect for everyone here. Not only for the knowledge you have with regard to this type of thing, but for the PATIENCE you *must* have. Calm as Hindu Cows, you are.

Anyway, thanks for all of the advice.

your situation sounds exactly like mine. i searched and searched and was extremely frustrated until i found this document on how to set up a LAMP server:

it saved my life. i used redhat 9 and followed the instructions ( very easy to follow as well. )

I'm installing Debian for the 5th time right now. I am *this* close to resorting to Redhat.

After having the first install leaving me scratching my head (nothing seemed to load at all), I installed a number of different times *only* using tasksel to choose the things that I wanted. In the last install, which I was *sure* would work, I only chose the desktop environments in tasksel. It took a few hours, downloaded and installed everything. And at the last minute it tells me that there were dependency issues with gnome32. Not having the faintest idea how to repair the problem, I'm starting all over again.

This time I'm going to not choose ANYTHING in tasksel OR in dselect. Get the lowest of the low, and then try using apt-get after that to install anything else.

*polishes rifle*
Okay, I did the basic install. I figure that if I can't get the gui's working, then screw them.

The first thing I did was sign in as root and type: apt-get update

Then I figured I'd try to install apache, so I typed: apt-get install apache

It prompted me to confirm the dependencies, and I did. It installed.

Now I wanted to go take a look at the apache configuration files, but I can't find where the damn thing installed apache.

Is there a default folder where these things are installed? I looked at the package listing on, but it doesn't give me any clue where the package would be installed.

the configuration files for apache are under /etc/httpd/

if you're runing linux in the non GUI mode, I think you would be much more effective with a Midnight Commander

do a apt-get install mc

then type mc , you can modify files with this copy them unpack them...etc....

Robert B
Hmmm, the config files *were* under the etc directory, but they were in an apache folder, not httpd. Wierd.

Wow, I haven't seen Midnight Commander in YEARS. I remember using it way back in college. Feels like forever ago smile.gif

that is ok, I've forogot the exact position [sorry], but you've found it, it's there where it should be.

Robert B
Thanks again for all the help. Midnight Commander is awesome. I'd totally forgotten ever using it (I used it on the unix servers at my campus back in '93 smile.gif)

Another question, however: I've been looking through the available packages ( and I can't find the package for mysql Do you know of a faster way to search the package names?
If you installed SARGE the you need to look in testing not stable ... but sarge is going to be released as stable in a couple weeks.

To see for sure do this:

cat /etc/apt/sources.list

If the sources are similar to this:
deb testing main
deb-src testing main

deb stable/updates main

Then you are using sarge...

You can do this from the command line:

apt-cache search mysql

You shouldn't have a problem with dselect ... I just did an install with it today ... did you remember to run the update in deslect before you installed with it (it is similar to apt-get .... it needs to be updated before you start).

Try this:

dselect update

dselect select

first time, don't select anything ... just press enter to exit .... then run this command:

dselect install

(it will install all dependancies that are not currently installed for a base install) ...

If/when you decide to install gui, run dselect, select update, then after it is finished, select select ... then pick x-window-system (use the + key) only and inside the resolution screen, just pick the stuff you want from X (not Gnome and KDE...just X), then install ... now exit dselect and when you have X working, go back into dselect, (do update, then do select, and pick GNOME (with a +) then in the resoltijon sceen, pick all the gnome stuff you want ... then install and exit deselect ... when you have gnome working the way you want, move on to KDE (or whatever else you wnt to install)...
To get a good LAMP server (Linux - Apache - MySQL - PHP), you are probably better off building them from source ... following the instructions:

We also have one here:

And here is an other...

If you build it yourself, you know what all the features are....

I am going to do a LAMP server install with some newer components right now (MySQL 4.0.18 standard, Apache 2.0.49, php 4.3.4, debian SARGE) as a test ....

I'll try and document it as an article and post it later tonight....
awesome - thanks once again for all of the help. I'd be very interested to see that LAMP install/walkthrough. I'd even start over from scratch again and do it (I'm getting used to the installs at this point smile.gif.

I'm thinking at this point that I don't really need the gui. If I really want to go linux all the way, I might as well stick with the command prompt and midnight commander. Learn me up real good.

Another thing I'm not sure about: when all is said and done, how should I go about transporting my web apps over to the server? ftp? ssh? any recommendations?

edit /// btw: I installed the stable version (woody) because I am always afraid of software in testing phase. Is sarge in a stable enough state do you think?
Oh, another thing I forgot to mention/ask: My machine is a dual proc athlon mp 1800. Does the debian installer detect the dual procs automagically? Is there a way for me to check to see that it's using both? Will I need to recompile the kernel? (There's a mouthful for ya)
Sarge is pretty stable ... it is going to be released as stable fairly soon as stable. Woody is to out of date for me...
I found a very good walk through that I am using right now ... I am in the middle of compiling mysql

I am using the following versions:

mysql 4.0.18
php 4.3.4
apache 2.0.49

Here is the walkthrough I found ...

If you use sarge, you can install the kernel-image-2.6.3smp and it should recognize almost everything (including dual processors).

If you are connecting from off site, you should use ssh/sftp and not ftp ... ftp logins are not encrypted, ssh/sftp are.
This is going to be a article about doing a Linux - Apache - MySQL - PHP server. These are the components I am using (All currently the latest STABLE versions ...except the Linux, which will be Debian Sarge.

Linux - Debian Sarge from the Sarge Installer.

Apache - Version 2.0.49 from httpd-2.0.49.tar.gz

MySQL - Version 4.0.18 Standard from here

PHP - Version 4.3.4 from here

I followed the directions from this WalkThrough ... below are the things I did differently.
First issue is that I use 4.0.18 for the mysql version number instead of 3.23.57.

I had to do the command:

chown -R mysql:mysql /home/mysql

before I could try to start mysql. With version 4.0.18, the command to start mysql has changed from safe_mysqld to mysqld_safe ... so the command to start mysql would be this:

/usr/local/mysql/current/bin/mysqld_safe &

In Debian, there is no /etc/rc.d directory. The init.d is /etc/init.d and not /etc/rc.d/init.d the chmod command is:

chmod 744 /etc/init.d/mysql.server

Edit the file /etc/init.d/mysql.server and replace the line:




In Debian, the normal runlevel is rc2.d not rc3.d ... so you would do:

cd /etc/rc2.d
ln -s ../init.d/mysql.server S22mysql.server

We want to put the Kill (shutdown) links in rc0.d, rc1.d and rc6.d ... so do this:

cd /etc/rc0.d
ln -s ../init.d/mysql.server K20mysql.server

cd ../rc1.d
ln -s ../init.d/mysql.server K20mysql.server

cd ../rc6.d
ln -s ../init.d/mysql.server K20mysql.server


Didn't install PostgreSQL


I installed via apt-get like this:

apt-get install openssl libssl-dev
Apache 2
I am using httpd-2.0.49, so substitute 2.0.49 for 2.0.47 ... also, since I installed openssl and libssl-dev via apt-get, I must change the location in the configure file ... it is now:

./configure --prefix=/usr/local/apache2/2.0.49 \
--enable-modules=all \
--enable-ssl \
--with-ssl=/usr/include/openssl \

Here is what you need to do to make httpd startup and shut down automatically:

cp /usr/local/apache2/current/bin/apachectl \

cd /etc/rc2.d
ln -s ../init.d/httpd2 S22httpd2

cd /etc/rc0.d
ln -s ../init.d/httpd2 K20httpd2

cd ../rc1.d
ln -s ../init.d/httpd2 K20httpd2

cd ../rc6.d
ln -s ../init.d/httpd2 K20httpd2

Edit the file /etc/init.d/httpd2 ... and replace the line:



HTTPD='/usr/local/apache2/current/bin/httpd -DSSL'

and search for and replace all instances of 2.0.49 with current

I didn't install PDFlib

I am using version 4.3.4, so replace all 4.3.3 with 4.3.4 in the instructions.

Prior to compiling PHP, add the following packages:

apt-get install libpng3-dev libpng3 zlib1g zlib1g-dev zlibc

I didn't install PDFlib or PostGreSQL ... so here is the modified configure line for PHP:

./configure \
--with-apxs2=/usr/local/apache2/current/bin/apxs \
--with-mysql=/usr/local/mysql/current \
--with-zlib-dir=/usr/lib/ \
--enable-versioning \
--enable-track-vars=yes \
--enable-url-includes \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-ftp \
--with-config-file-path=/etc \

I would copy php.ini-recommended and not php.ini-dist to /etc/php.ini


I am using version 1.99_13 so, substitute 1.99_13 for 1.99_09.

Before running the configure command install libperl-dev:

apt-get install libperl-dev

Everything else worked.........
If you use sarge, you can install the kernel-image-2.6.3smp and it should recognize almost everything (including dual processors).

How can I specify a kernel?

I downloaded the sarge installer ( and installed using that. I looked through all of the options before installing, and I even tried installing as an expert, but never saw an option for the type of kernel to install. Do I have to use sarge-i386-netinst.iso ?
After the install is done ... use dselect.

Do it like this...

1. Complete the base install ... when asked about opening tasksel or dselect as part of the install, don't use them.

2. Login as root after the base install, and do this:
apt-get update
apt-get dist-upgrade
(it shouldn't install anything, but just to be sure let's make sure everything is updated first)

3. Now run dselect from the command line ... pick Update.

4. Now pick Select and press enter to continue ... after getting into the description, press enter agian to exit (without selecting any new progams)... now pick Install. Due to dependancies, you will install several new programs, including sshd, gcc, and others.

5. When that is complete, pick Select agian, and press enter to continue ... when you get to the blinking cursor in the description, use the / key (the line will turn red and show a Search for ? prompt. Type in kernel-image and press enter. This will probably take you to your currently installed kernel ... press / agian, then press enter and you will search on the same term agian (you don't have to reenter the search term unless you want to change it) ... this time it should take you to something like this (if not press / and enter until you get there):
__ Opt base     kernel-image <none>      2.2.20-5woo Linux kernel binary image

6. Now use the arrow key to find the kernel:
__ Opt base     kernel-image <none>      2.6.3-2     Linux kernel image for version 2.6 on AMD K7 SMP.

Use the + to turn it on ... it should bring you to a Dependency/conflict resolution sublist, once in there, select any addition items you want to install using the arrows and + (the ones with a * are going to get installed (or already installed). I would pick these items:
 _* Opt base     kernel-image Linux kernel image for version 2.6 on AMD K7 SMP.
 _* Opt base     kernel-image Linux kernel image for version 2.6.3 on AMD K7 SMP.
 __ Opt base     lilo         LInux LOader - The Classic OS loader can load Linux and others
 _* Opt doc      kernel-doc-2 Linux kernel specific documentation for version 2.6.3
 __ Opt base     kernel-image Linux kernel image for version 2.6.3 on PPro/Celeron/PII/PIII/PIV.
*** Opt utils    syslinux     Bootloader for Linux/i386 using MS-DOS floppies

I recommend that you don't install lilo and you don't need the i686 or i386 kernels if they are in your resolution screen. Press Enter to go back to the main selection screen.

7. Now let's search for kernel-source. Use / and enter kernel-source and press enter ... you should goto a line like this:
__ Opt devel    kernel-sourc <none>      2.2.10-2    Linux kernel source.

Use the arrows to move to:
 __ Opt devel    kernel-sourc 2.6.3-2     2.6.3-2     Linux kernel source for version 2.6.3 with Debian patches.

Use + to select that. If you get a Resolution screen, choose to install the progams you want ... I installed Kernel Tree as well. Press enter until you get back to the Main screen (with the Access, Update, Select, Install, Config, Remove, Quit) ... pick Install.

8. After the install completes, pick Quit.

9. Edit /boot/grub/menu.lst and make sure there is an entry for the 2.6.3 smp kernel ... and I have to add a vga= line on the 2,6 kernel line or else I can't see the screen on boot up .. my kernel line says:
kernel          /boot/vmlinuz-2.6.3-1-686 root=/dev/hdb8 ro vga=792

(yours would says something like vmlinuz-2.6.3-1-K7smp or vmlinuz-2.6.3-1-Athlonsmp) .... you might want to put a vga=792 in there. Here is a chart for the vga= numbers:

8 bpp----769------771-------773-------775
16 bpp---785------788-------791-------794
32 bpp---786------789-------792-------795

Reboot and select your new kernel
If you can't get the 2.6.3 smp kernel to work (for whatever the reason), you can pick the 2.4.25 Athlon SMP kernel as well...
I can't believe how awesome you're being. Thank you!

One stupid question: when using the new installer, at one point it asks which version I'd like to install (stable, testing, etc). Since this is the sarge installer, should I be choosing stable (which would give me the most stable version of sarge)? Or will Stable get me the older version and I should be choosing testing?
You want to install testing .... the other stuff probably won't work (on the beta installer).

Make sure you have the Beta3 installer .... (use the i386 link)

Here is the Sarge Install Manual (english, i386) other versions available from here.
Thanks again - Here I go smile.gif
Okay, new base system and new smp kernel installed and working biggrin.gif

The vga=792 line is a life saver. The giant text on my screen was killing me. Now I can actually see everything when I type ls smile.gif

Now moving on to LAMP...
I've got some problems...

First of all, the links on to mysql didn't work when using lynx (I guess it didn't forward like it should), so I ended up going to one of the mirrors directly and downloading a source with a different file name.

I went here:

I got this:

Then, following the walkthrough, I created and decompressed those files/folders here: /usr/local/src/lamps

Next up in the tutorial it said to do this:
cd /usr/local/src/lamps/mysql-3.23.57/
./configure --prefix=/usr/local/mysql/3.23.57
--localstatedir=/home/mysql/data --with-innodb

Instead of that, I did this:
cd /usr/local/src/lamps/mysql-standard-4.0.18-pc-linux-i686/
./configure --prefix=/usr/local/mysql/4.0.18
--localstatedir=/home/mysql/data --with-innodb

When I hit enter after that, it spit out a huge page of stuff. At the very top it said, "Note! this is a binary package and you do not need to compile." or something like that (it scrolled too far for me to see it for long).

From what I can still see on the screen, it said:

Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
040321  8:19:53  ./bin/mysqld: Shutdown Complete

To start mysqld at boot time you have to copy support-files/mysql.server to the right place in your system

to do so, start the server ,then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h debian password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd .; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at

Starting the mysqld server. You can test that it is up and running with the command:
./bin/mysqladmin version
debian:/usr/local/src/lamps/mysql-standard-4.0.18-pc-linux-i686# chown: 'mysql' : invalid user
Starting mysqld daemon with databases from /usr/local/src/lamps/mysql-standard-4.0.18-pc-linux-i686/data
040321 08:19:54 mysqld ended

A little confused, I figured I'd just try to check it like it said above, so I typed in "./bin/mysqladmin version"

It spat out:

./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

Now, the next command in the LAMP walkthrough was the make/make install, but I take it that's not what I have to do here (duh). but something got screwed up, and I don't know if it was because of the command I ran to install the thing, or if it was because I tried to install it in this directory: "/usr/local/mysql/4.0.18" or what.

Not really sure what to do next. Not sure if I've totally screwed it up to the point where I'll need to remove everything and try again... or what...
Okay, screw it.
I'm starting all over again with the fresh install of the OS, and downloading the exact mysql source on my windows machine, burning it to a cd, and I'll copy it over to the linux box from there.
You don't need a new OS install ....

what you need is the source package for mysql {}... not the binary package... (it's at the main bottom of the is a direct link
Well, I'm half way done the fresh install, now (I'm a speed demon with it after doing it so much :)

My concern was that what I had done before that screwed up had cluttered up the machine. I wasn't sure what config files had been altered, or if I already had a mysql daemon running, and how I would go about removing that stuff. Plus, I had tried a bunch of different things to get it going and ended up messing everything up. It was easier for me to just re-install.

The way I see it, you learn through mistakes. If everything just worked all the time, would you ever learn anything?
I got the correct file, entered this:

cd /usr/local/src/lamps/mysql-4.0.18/
./configure --prefix=/usr/local/mysql/4.0.18
--localstatedir=/home/mysql/data --with-innodb

It started writing a ton of stuff to the screen a-la "checking blah" over and over again.

Eventually it failed here:

checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap library found

I did some digging for that error online, and most of the answers ppl gave were to install the ncurses library. So, I fired up dselect and searched for ncurses. It found it, but it is already installed.


I found a link that helped me, I just had to add a with statement to get it to work (pointing to the correct ncurses file)

Here I am, many hours later, finally finished with the sarge install and the lamp setup.

A million thanks go out to hughesjr for the stunning amount of help you provided :)
Glad you got it finished .... and you are very welcome smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.