The Perfect Setup - Debian Sarge (3.1) - Page 5

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Wed, 2005-03-30 20:14. ::

Apache

Run

apt-get install apache2 apache2-doc
apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick
(1 line!)

Edit /etc/apache2/apache2.conf. Change

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

to

DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

Edit /etc/mime.types and comment out the following lines:

#application/x-httpd-php                                phtml pht php
#application/x-httpd-php-source phps
#application/x-httpd-php3 php3
#application/x-httpd-php3-preprocessed php3p
#application/x-httpd-php4 php4

Edit /etc/apache2/mods-enabled/php4.conf and comment out the following lines:

<IfModule mod_php4.c>
# AddType application/x-httpd-php .php .phtml .php3
# AddType application/x-httpd-php-source .phps
</IfModule>

Edit /etc/apache2/ports.conf and add Listen 443:

Listen 80
Listen 443

Now we have to enable some Apache modules (SSL, rewrite and suexec):

a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include

Restart Apache:

/etc/init.d/apache2 restart


Proftpd

apt-get install proftpd

<- standalone

For security reasons you can add the following lines to /etc/proftpd.conf (thanks to Reinaldo Carvalho; more information can be found here: http://proftpd.linux.co.uk/localsite/Userguide/linked/userguide.html):

DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."

and restart Proftpd:

/etc/init.d/proftpd restart


Webalizer

apt-get install webalizer

<- /var/www/webalizer
<- Usage Statistics for
<- /var/log/apache/access.log.1


Synchronize the System Clock

It is a good idea to synchronize the system clock with an NTP (network time protocol) server over the internet. Simply run

apt-get install ntp ntpdate

and your system time will always be in sync.


Install some Perl Modules needed by SpamAssassin (comes with ISPConfig)

Installation using the Perl Shell

Login to your command line as root and run the following command to start the Perl shell:

perl -MCPAN -e shell

If you run the Perl shell for the first time you will be asked some questions. In most cases the default answers are ok.

Please note: If you run a firewall on your system you might have to turn it off while working on the Perl shell in order for the Perl shell to be able to fetch the needed modules without a big delay. You can switch it on afterwards.

The big advantage of the Perl shell compared to the two other methods described here is that it cares about dependencies when installing new modules. I.e., if it turns out that a prerequisite Perl module is missing when you install another module the Perl shell asks you if it should install the prerequisite module for you. You should answer that question with "Yes".

Run the following commands to install the modules needed by SpamAssassin:

install HTML::Parser
install DB_File
install Net::DNS
(when prompted to enable tests, choose no)
q
(to leave the Perl shell)

If a module is already installed on your system you will get a message similar to this one:

HTML::Parser is up to date.

Successful installation of a module looks like this:

/usr/bin/make install -- OK


Compile a Custom Kernel

If you need to compile a new kernel for some reason (e.g. because you want to use the latest bleeding-edge kernel or need a feature that the standard Debian kernel does not offer), you can find more information here: Debian-Kernel-Compile-Howto.


The End

The configuration of the server is now finished, and if you wish you can now install ISPConfig on it.

A Note On SuExec

If you want to run CGI scripts under suExec, you should specify /var/www as the home directory for websites created by ISPConfig as Debian's suExec is compiled with /var/www as Doc_Root. Run /usr/lib/apache2/suexec2 -V, and the output should look like this:

To select /var/www as the home directory for websites during the installation of ISPConfig do the following: When you are asked for the installation mode, select the expert mode.

Later during the installation you are asked if the default directory /home/www should be the directory where ISPConfig will create websites in. Answer n and enter /var/www as the home directory for websites.

Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by ciprianz (registered user) on Fri, 2006-12-22 20:12.

This ONE is the best tutorial ever !!!

Thank you 

Submitted by ejot (registered user) on Tue, 2006-10-10 11:34.
I had problems with the CPAN shell failing when installing packages with an error about tar not being able to "untar". Think it might be tied into the number of allowed processes on my VPS. Stopped mysql and apache, ran a CPAN upgrade with perl -MCPAN -e 'install Bundle::CPAN' and tried using the shell again, worked perfectly.
Submitted by Anonymous (not registered) on Tue, 2006-07-18 04:50.
Version 2.2.4 of ISPConfig was released recently. They've updated the path for the webserver and the last section for changing the apache webroot is no longer needed.

See full changelog - http://sourceforge.net/project/shownotes.php?group_id=140327&release_id=432691
Submitted by Anonymous (not registered) on Sun, 2006-06-18 06:48.

The tutorial, is very exact, regarding the input and output. I think is one of those very nice to keep next to your passport :)

I did it all and I love it the system looks to be fine.

Thank you - Danke Falko.

Submitted by Anonymous (not registered) on Tue, 2006-05-30 14:56.

I cannot imagine how I would ever have set up our webserver without this howto, I followed it step by step and the normal Linux-induced hair-tearing was kept to a minimum. The end result is hugely impressive and I can only thank you profusely for creating this howto.

Submitted by Anonymous (not registered) on Fri, 2006-05-12 10:52.

Very nice HOWTO. I have been using it a lot. If you can make one of these for FreeBSD that would be great, but I understand if you don't.

Regards,
Tim

iHostNZ

Submitted by Anonymous (not registered) on Mon, 2006-05-01 17:54.

VERY NICE article. Thank you very much!

Only a petition:

Please, change screenshot for "Is the hardware clock set to GMT". It should be selected "Yes" instead of "No"

It is VERY recommended to set hardware clock to GMT (UTC) if you want automatic "Daylight saving time" changes and if you don't want infinite problems with time depending processes when such changes are backwards. UTC time is constant, independently of you Time Zone, Dayligh saving time changes...

If your computer is not to have Windows installed (as will be the case on a Debian server), it has not sense to set hardware clock to localtime.

Submitted by Anonymous (not registered) on Mon, 2006-05-01 17:53.

VERY NICE article. Thank you very much!

Only a petition:

Please, change screenshot for "Is the hardware clock set to GMT". It should be selected "Yes" instead of "No"

It is VERY recommended to set hardware clock to GMT (UTC) if you want automatic "Daylight saving time" changes and if you don't want infinite problems with time depending processes when such changes are backwards. UTC time is constant, independently of you Time Zone, Dayligh saving time changes...

If your computer is not to have Windows installed (as will be the case on a Debian server), it has not sense to set hardware clock to localtime.

Submitted by Anonymous (not registered) on Mon, 2006-02-13 08:56.
The answer to the last setup question for webalizer should be /var/log/apache2/access.log.1 as apache2 is the default on Sarge
Submitted by Anonymous (not registered) on Sat, 2006-02-04 21:04.
Wonderful!! Infinitely THANKS! :)
Submitted by Anonymous (not registered) on Sat, 2005-11-26 06:59.
Debian provides an easy way to enable modules, simply use a2enmod and a2dismod. It also provides another two simple utilities to enable and disable sites. Try it with a2ensite and a2dissite.
Submitted by Anonymous (not registered) on Tue, 2005-11-01 16:39.

I installed these ..

apt-get install libdb-file-lock-perl libdigest-hmac-perl libnet-dns-perl libhtml-parser-perl