LAMP Server Sarge
From My Big Bad Wiki
Contents |
Introduction
My guide for installing and configuring a LAMP(Linux, Apache, MySQL, PHP) and mail server system with Debian Sarge. This will guide you through installing all the essential components onto a Sarge base install. The final product will be a strictly command line driven server install capable of serving up numerous websites and multiple domain email.
Prerequisites
|
My System Specs
|
Installing Debian Sarge
Boot Options
We want to make sure we boot with support for the 2.6 kernel
boot: linux26
Configuring The System
Setting Static IP
The default Sarge "when using linux26" installs using DHCP and doesn't give an option to set a static IP. A nice trick to setting a static IP address during install time is to unplug the network cable from the machine. When it tries to set via DHCP it will fail, then give you an option to set static. Once you set the static, plug the cable back in.
If it set to DHCP, no big deal, it's easy to change. Follow these steps to change.
pico -w /etc/network/interfaces
| File: /etc/network/interfaces |
|
Here's what my file looks like after editing:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.16.86
netmask 255.255.255.0
network 192.168.16.0
broadcast 192.168.16.255
gateway 192.168.16.1
|
Setting Hostname
This actuallly should of been done during the install, if you used the Debian Installer CD.
Installing Applications
Applications Used
- Bind - DNS Server
- Apache - Webserver
- PHP - Scripting language
- MySQL - Relational database
- vsftpd - FTP Server
- Postfix - MTA
- Rsync - Rsync Server
- Webmin - Web Based System Management
BIND
apt-get install bind9
Apache 2 & PHP 4
This will install the Apache webserver along with PHP
apt-get install apache2 libapache2-mod-php4
Configuring Apache
From a command line run the following command
a2enmod rewrite
/etc/init.d/apache2 force-reload
MySQL Server
apt-get install mysql-server-4.1 php4-mysql
Set MySQL Password
mysqladmin -u root password NEW_PASSWORD
vsftpd FTP Server
apt-get install vsftpd
Configuring vsftpd
We need to modify the vsftpd configuration file to allow our local users to log in.
pico -w /etc/vsftpd.conf
| File: /etc/vsftpd.conf |
|
Here's what changes need to be done: # Uncomment this to allow local users to log in. local_enable=YES # Uncomment this to enable any form of FTP write command. write_enable=YES # You may restrict local users to their home directories. See the FAQ for # the possible risks in this before using chroot_local_user or # chroot_list_enable below. chroot_local_user=YES #Add the following lines at the end of the file file_open_mode=0644 local_umask=0022 |
Postfix MTA
Be default the Debian Sarge base install uses Exim as the MTA. We're going to replace it with Postfix. Installing Postfix will automatically remove Exim and related apps.
apt-get install postfix
Rsync
apt-get install rsync
Webmin
|
This section is under-going some modifications. I'm still debating the _right_ way to install webmin on a Debian system. |
apt-get install libnet-ssleay-perl
wget http://superb.dl.sourceforge.net/sourceforge/webadmin/webmin-1.260.tar.gz
Additional Packages
|
apt-get install php4-curl curl php4-domxml php4-gd php4-imagick php4-mcrypt php4-pear php4-rrdtool netpbm webalizer |
TODO
Credits
Did this help you?
Please send me a comment letting me know if this helped you at all. I've had folks actually want to donate a few bucks for helping, and I want make it known that this information is provided for free.