<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux and Open Source Blog &#187; lamp server</title>
	<atom:link href="http://linewbie.com/tag/lamp-server/feed" rel="self" type="application/rss+xml" />
	<link>http://linewbie.com</link>
	<description>News, Reviews, Thoughts and Trends in Linux and Open Source World.</description>
	<lastBuildDate>Wed, 09 May 2012 15:44:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to build the Perfect Server &#8211; with Ubuntu Gutsy Gibbon (Ubuntu 7.10)</title>
		<link>http://linewbie.com/2007/10/how-to-build-the-perfect-server-with-ubuntu-gutsy-gibbon-ubuntu-710.html</link>
		<comments>http://linewbie.com/2007/10/how-to-build-the-perfect-server-with-ubuntu-gutsy-gibbon-ubuntu-710.html#comments</comments>
		<pubDate>Fri, 19 Oct 2007 01:38:47 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[applications/software]]></category>
		<category><![CDATA[debian/ubuntu based]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[lamp server]]></category>
		<category><![CDATA[perfect lamp]]></category>
		<category><![CDATA[perfect lamp server]]></category>
		<category><![CDATA[perfect server]]></category>
		<category><![CDATA[perfect ubuntu]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2007/10/how-to-build-the-perfect-server-with-ubuntu-gutsy-gibbon-ubuntu-710.html</guid>
		<description><![CDATA[This tutorial shows how to set up a Ubuntu Gutsy Gibbon (Ubuntu 7.10) based server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP &#8230; <a href="http://linewbie.com/2007/10/how-to-build-the-perfect-server-with-ubuntu-gutsy-gibbon-ubuntu-710.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This tutorial shows how to set up a Ubuntu Gutsy Gibbon (Ubuntu 7.10) based server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Courier POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of Ubuntu Gutsy Gibbon, but should apply to the 64-bit version with very little modifications as well.</p>
<p>I will use the following software:</p>
<ul>
<li>Web Server: Apache 2.2</li>
<li>Database Server: MySQL 5.0</li>
<li>Mail Server: Postfix</li>
<li>DNS Server: BIND9</li>
<li>FTP Server: proftpd</li>
<li>POP3/IMAP: I will use Maildir format and therefore install Courier-POP3/Courier-IMAP.</li>
<li>Webalizer for web site statistics</li>
</ul>
<p>In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel <a href="http://www.ispconfig.org/" target="_blank">ISPConfig</a> (i.e., ISPConfig runs on it out of the box).</p>
<p>I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!</p>
<h3>1 Requirements</h3>
<p>To install such a system you will need the following:</p>
<ul>
<li>the Ubuntu Gutsy Gibbon server CD, available here: <a href="http://releases.ubuntu.com/7.10/ubuntu-7.10-server-i386.iso" target="_blank">http://releases.ubuntu.com/7.10/ubuntu-7.10-server-i386.iso</a></li>
<li>a fast internet connection.</li>
</ul>
<h3>2 Preliminary Note</h3>
<p>In this tutorial I use the hostname <span class="system">server1.example.com</span> with the IP address <span class="system">192.168.0.100</span> and the gateway <span class="system">192.168.0.1</span>. These settings might differ for you, so you have to replace them where appropriate.</p>
<h3>3 The Base System</h3>
<p>Insert your Ubuntu install CD into your system and boot from it. Select <span class="system">Install to the hard disk</span>:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/1.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/1.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>The installation starts, and first you have to choose your language:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/2.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/2.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Then select your location:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/3.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/3.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/4.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/4.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Choose a keyboard layout (you will be asked to press a few keys, and the installer will try to detect your keyboard layout based on the keys you pressed):</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/5.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/5.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/6.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/6.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/7.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/7.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/8.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/8.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/9.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/9.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/10.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/10.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/11.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/11.png" height="375" width="499" /></a></p>
<p><span id="more-20"></span></p>
<p>Enter the hostname. In this example, my system is called <em class="system">server1.example.com</em>, so I enter <em class="system">server1</em>:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/12.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/12.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Now you have to partition your hard disk. For simplicity&#8217;s sake I will create one big partition (with the mount point <span class="system">/</span>) and a little swap partition so I select <span class="system">Guided &#8211; use entire disk</span> (of course, the partitioning is totally up to you &#8211; if you like, you can create more than just one big partition, and you can also use LVM):</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/13.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/13.png" height="375" width="499" /></a></p>
<p>Select the disk that you want to partition:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/14.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/14.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>When you&#8217;re finished, hit <span class="system">Yes</span> when you&#8217;re asked <span class="system">Write the changes to disks?</span>:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/15.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/15.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Afterwards, your new partitions are being created and formatted:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/16.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/16.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Configure your system&#8217;s clock. Normally UTC is a good choice:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/17.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/17.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Create a user, for example the user <span class="system">Administrator</span> with the user name <span class="system">administrator</span> (don&#8217;t use the user name <span class="system">admin</span> as it is a reserved name on Gutsy Gibbon):</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/18.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/18.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/19.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/19.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/20.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/20.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/21.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/21.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>Now the base system is being installed:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/22.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/22.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/23.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/23.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/24.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/24.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>We need a DNS, mail, and LAMP server, but nevertheless I don&#8217;t select any of them now because I like to have full control over what gets installed on my system. We will install the needed packages manually later on. The only item I select here is <span class="system">OpenSSH server</span> so that I can immediately connect to the system with an SSH client such as <a href="http://chiark.greenend.org.uk/%7Esgtatham/putty/" target="_blank">PuTTY</a> after the installation has finished:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/25.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/25.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>The installation continues:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/26.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/26.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/27.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/27.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>The GRUB boot loader gets installed:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/29.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/29.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>The base system installation is now finished. Remove the installation CD from the CD drive and hit <span class="system">Continue</span> to reboot the system:</p>
<p><a href="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/30.png" class="thickbox"><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/30.png" height="375" width="499" /></a></p>
<p><noscript style="font-size: 7pt">(JavaScript must be enabled in your browser to view the large image as an image overlay.)</noscript></p>
<p>On to the next step&#8230;</p>
<h3>4 Enable The root Account</h3>
<p>After the reboot you can login with your previously created username (e.g. <span class="system">administrator</span>). Because we must run all the steps from this tutorial as root user, we must enable the root account now.</p>
<p>Run</p>
<p class="command">sudo passwd root</p>
<p>and give root a password. Afterwards we become root by running</p>
<p class="command">su</p>
<h3>5 Install The SSH Server (Optional)</h3>
<p>If you did not install the OpenSSH server during the system installation, you can do it now:</p>
<p class="command">apt-get install ssh openssh-server</p>
<p>From now on you can use an SSH client such as <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html" target="_blank">PuTTY</a> and connect from your workstation to your Ubuntu Gutsy Gibbon server and follow the remaining steps from this tutorial.</p>
<h3>6 Install vim-full (Optional)</h3>
<p>I&#8217;ll use <span class="system">vi</span> as my text editor in this tutorial. The default <span class="system">vi</span> program has some strange behaviour on Ubuntu and Debian; to fix this, we install <span class="system">vim-full</span>:</p>
<p class="command">apt-get install vim-full</p>
<p>(You don&#8217;t have to do this if you use a different text editor such as joe or nano.)</p>
<h3>7 Configure The Network</h3>
<p>Because the Ubuntu installer has configured our system to get its network settings via DHCP, we have to change that now because a server should have a static IP address. Edit <em class="system">/etc/network/interfaces </em> and adjust it to your needs (in this example setup I will use the IP address <em class="system">192.168.0.100</em>):</p>
<p class="command">vi /etc/network/interfaces</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre># 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.0.100

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.0.1</pre>
</td>
</tr>
</table>
<p>Then restart your network:</p>
<p class="command">/etc/init.d/networking restart</p>
<p>Then edit <span class="system">/etc/hosts</span>. Make it look like this:</p>
<p class="command">vi /etc/hosts</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>127.0.0.1       localhost.localdomain   localhost192.168.0.100   server1.example.com     server1# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts</pre>
</td>
</tr>
</table>
<p>Now run</p>
<p class="command">echo server1.example.com &gt; /etc/hostname<br />
/etc/init.d/hostname.sh start</p>
<p>Afterwards, run</p>
<p class="command">hostname<br />
hostname -f</p>
<p>Both should show <span class="system">server1.example.com</span> now.</p>
<h3>8    Edit /etc/apt/sources.list And Update Your Linux Installation</h3>
<p>Edit <span class="system">/etc/apt/sources.list</span>. Comment out or remove the installation CD from the file and make sure that the <span class="system">universe</span> and <span class="system">multiverse</span> repositories are enabled. It should look like this:</p>
<p class="command">vi /etc/apt/sources.list</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>## deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted#deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted

## Major bug fix updates produced after the final release of the

## distribution.

deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## universe WILL NOT receive any review or updates from the Ubuntu security

## team.

deb http://de.archive.ubuntu.com/ubuntu/ gutsy universe

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy universe

deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse

deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

## Uncomment the following two lines to add software from the 'backports'

## repository.

## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

# deb http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

# deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's

## 'partner' repository. This software is not part of Ubuntu, but is

## offered by Canonical and the respective vendors as a service to Ubuntu

## users.

# deb http://archive.canonical.com/ubuntu gutsy partner

# deb-src http://archive.canonical.com/ubuntu gutsy partner

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted

deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted

deb http://security.ubuntu.com/ubuntu gutsy-security universe

deb-src http://security.ubuntu.com/ubuntu gutsy-security universe

deb http://security.ubuntu.com/ubuntu gutsy-security multiverse

deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse</pre>
</td>
</tr>
</table>
<p>Then run</p>
<p class="command">apt-get update</p>
<p>to update the apt package database and</p>
<p class="command">apt-get upgrade</p>
<p>to install the latest updates (if there are any).</p>
<h3>9 Change The Default Shell</h3>
<p><span class="system">/bin/sh</span> is a symlink to <span class="system">/bin/dash</span>, however we need <span class="system">/bin/bash</span>, not <span class="system">/bin/dash</span>. Therefore we do this:</p>
<p class="command">ln -sf /bin/bash /bin/sh</p>
<p>If you don&#8217;t do this, the ISPConfig installation will fail.</p>
<h3>10 Install Some Software</h3>
<p>Now we install a few packages that are needed later on. Run</p>
<p class="command">apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ build-essential</p>
<p>(This command must go into <strong>one line</strong>!)</p>
<h3>11 Quota</h3>
<p class="highlight">(If you have chosen a different partitioning scheme than I did, you must adjust this chapter so that quota applies to the partitions where you need it.)</p>
<p>To install quota, run</p>
<p class="command">apt-get install quota</p>
<p> Edit <span class="system">/etc/fstab</span>. Mine looks like this (I added <span class="system">,usrquota,grpquota</span> to the partition with the mount point <span class="system">/</span>):</p>
<p class="command">vi /etc/fstab</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre># /etc/fstab: static file system information.
#
# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=9fc157ff-975c-4f20-9fef-6a70085abdbd /               ext3    defaults,errors=remount-ro,usrquota,grpquota 0       1
# /dev/sda5
UUID=48fb7dd8-f099-4d63-ac1b-30e886ac7436 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec 0       0</pre>
</td>
</tr>
</table>
<p>To enable quota, run these commands:</p>
<p class="command">touch /quota.user /quota.group<br />
chmod 600 /quota.*<br />
mount -o remount /</p>
<p class="command">quotacheck -avugm<br />
quotaon -avug</p>
<h3>12 DNS Server</h3>
<p>Run</p>
<p class="command">apt-get install bind9</p>
<p> For security reasons we want to run BIND chrooted so we have to do the following steps:</p>
<p class="command">/etc/init.d/bind9 stop</p>
<p>Edit the file <span class="system">/etc/default/bind9</span> so that the daemon will run as the unprivileged user <span class="system">bind</span>, chrooted to <span class="system">/var/lib/named</span>. Modify the line: <span class="system">OPTIONS=&#8221;-u bind&#8221;</span> so that it reads <span class="system">OPTIONS=&#8221;-u bind -t /var/lib/named&#8221;</span>:</p>
<p class="command">vi /etc/default/bind9</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>OPTIONS="-u bind -t /var/lib/named"
# Set RESOLVCONF=no to not run resolvconf
RESOLVCONF=yes</pre>
</td>
</tr>
</table>
<p>Create the necessary directories under <span class="system">/var/lib</span>:</p>
<p class="command">mkdir -p /var/lib/named/etc<br />
mkdir /var/lib/named/dev<br />
mkdir -p /var/lib/named/var/cache/bind<br />
mkdir -p /var/lib/named/var/run/bind/run</p>
<p>Then move the config directory from <span class="system">/etc</span> to <span class="system">/var/lib/named/etc</span>:</p>
<p class="command">mv /etc/bind /var/lib/named/etc</p>
<p> Create a symlink to the new config directory from the old location (to avoid problems when bind gets updated in the future):</p>
<p class="command">ln -s /var/lib/named/etc/bind /etc/bind</p>
<p> Make null and random devices, and fix permissions of the directories:</p>
<p class="command">mknod /var/lib/named/dev/null c 1 3<br />
mknod /var/lib/named/dev/random c 1 8<br />
chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random<br />
chown -R bind:bind /var/lib/named/var/*<br />
chown -R bind:bind /var/lib/named/etc/bind</p>
<p>We need to modify <span class="system">/etc/default/syslogd</span> so that we can still get important messages logged to the system logs. Modify the line: <span class="system">SYSLOGD=&#8221;"</span> so that it reads: <span class="system">SYSLOGD=&#8221;-a /var/lib/named/dev/log&#8221;</span>:</p>
<p class="command">vi /etc/default/syslogd</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>#
# Top configuration file for syslogd
#

#
# Full documentation of possible arguments are found in the manpage
# syslogd(8).
#

#
# For remote UDP logging use SYSLOGD="-r"
#
SYSLOGD="-a /var/lib/named/dev/log"</pre>
</td>
</tr>
</table>
<p>Restart the logging daemon:</p>
<p class="command">/etc/init.d/sysklogd restart</p>
<p> Start up BIND, and check <span class="system">/var/log/syslog</span> for  errors:</p>
<p class="command">/etc/init.d/bind9 start</p>
<h3>13 MySQL</h3>
<p>In order to install MySQL, we run</p>
<p class="command">apt-get install mysql-server mysql-client libmysqlclient15-dev</p>
<p>You will be asked to provide a password for the MySQL root user &#8211; this password is valid for the user <span class="system">root@localhost</span> as well as <span class="system">root@server1.example.com</span>, so we don&#8217;t have to specify a MySQL root password manually later on (as was the case with previous Ubuntu versions):</p>
<p><span class="system">New password for the MySQL &#8220;root&#8221; user:</span> <span class="highlight">&lt;&#8211; yourrootsqlpassword</span></p>
<p>We want MySQL to listen on all interfaces, not just localhost, therefore we edit <span class="system">/etc/mysql/my.cnf</span> and comment out the line <span class="system">bind-address           = 127.0.0.1</span>:</p>
<p class="command">vi /etc/mysql/my.cnf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1
#
[...]</pre>
</td>
</tr>
</table>
<p>Then we restart MySQL:</p>
<p class="command">/etc/init.d/mysql restart</p>
<p> Now check that networking is enabled. Run</p>
<p class="command">netstat -tap | grep mysql</p>
<p> The output should look like this:</p>
<p class="system">root@server1:~# netstat -tap | grep mysql<br />
tcp        0      0 *:mysql                 *:*                     LISTEN     5286/mysqld<br />
root@server1:~#</p>
<h3>14 Postfix With SMTP-AUTH And TLS</h3>
<p>In order to install Postfix with SMTP-AUTH and TLS do the following steps:</p>
<p class="command">apt-get install postfix libsasl2-2 sasl2-bin libsasl2-modules libdb3-util procmail</p>
<p>You will be asked two questions. Answer as follows:</p>
<p><span class="system">General type of mail configuration:</span> <span class="highlight">&lt;&#8211; Internet Site</span><br />
<span class="system">System mail name:</span> <span class="highlight">&lt;&#8211; server1.example.com</span></p>
<p>Then run</p>
<p class="command">dpkg-reconfigure postfix</p>
<p>Again, you&#8217;ll be asked some questions:</p>
<p><span class="system">General type of mail configuration:</span> <span class="highlight">&lt;&#8211; Internet Site</span><br />
<span class="system">System mail name:</span> <span class="highlight">&lt;&#8211; server1.example.com</span><br />
<span class="system">Root and postmaster mail recipient:</span> <span class="highlight">&lt;&#8211; [blank]</span><br />
<span class="system">Other destinations to accept mail for (blank for none):</span> <span class="highlight">&lt;&#8211; server1.example.com, localhost.example.com, localhost.localdomain, localhost</span><br />
<span class="system">Force synchronous updates on mail queue?</span> <span class="system">&lt;&#8211; No</span><br />
<span class="system">Local networks:</span> <span class="highlight">&lt;&#8211; 127.0.0.0/8</span><br />
<span class="system">Use procmail for local delivery?</span> <span class="highlight">&lt;&#8211; Yes</span><br />
<span class="system">Mailbox size limit:</span> <span class="highlight">&lt;&#8211; 0</span><br />
<span class="system">Local address extension character:</span> <span class="highlight">&lt;&#8211; +</span><br />
<span class="system">Internet protocols to use:</span> <span class="highlight">&lt;&#8211; all</span></p>
<p><script type="text/javascript"> <!-- document.write('</p>
<div align="center">'); //--> </script><!-- BEGIN NetShelter Ad Tag for HowtoForge 300x250,336x280 -->Next, do this:</p>
<p class="command">postconf -e &#8216;smtpd_sasl_local_domain =&#8217;<br />
postconf -e &#8216;smtpd_sasl_auth_enable = yes&#8217;<br />
postconf -e &#8216;smtpd_sasl_security_options = noanonymous&#8217;<br />
postconf -e &#8216;broken_sasl_auth_clients = yes&#8217;<br />
postconf -e &#8216;smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination&#8217;<br />
postconf -e &#8216;inet_interfaces = all&#8217;<br />
echo &#8216;pwcheck_method: saslauthd&#8217; &gt;&gt; /etc/postfix/sasl/smtpd.conf<br />
echo &#8216;mech_list: plain login&#8217; &gt;&gt; /etc/postfix/sasl/smtpd.conf</p>
<p>Afterwards we create the certificates for TLS:</p>
<p class="command">mkdir /etc/postfix/ssl<br />
cd /etc/postfix/ssl/<br />
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024</p>
<p class="command">chmod 600 smtpd.key<br />
openssl req -new -key smtpd.key -out smtpd.csr</p>
<p class="command">openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt</p>
<p class="command">openssl rsa -in smtpd.key -out smtpd.key.unencrypted</p>
<p class="command">mv -f smtpd.key.unencrypted smtpd.key<br />
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650</p>
<p>Next we configure Postfix for  TLS (make sure that you use the correct hostname for <span class="system">myhostname</span>):</p>
<p class="command">postconf -e &#8216;myhostname = server1.example.com&#8217;<br />
postconf -e &#8216;smtpd_tls_auth_only = no&#8217;<br />
postconf -e &#8216;smtp_use_tls = yes&#8217;<br />
postconf -e &#8216;smtpd_use_tls = yes&#8217;<br />
postconf -e &#8216;smtp_tls_note_starttls_offer = yes&#8217;<br />
postconf -e &#8216;smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key&#8217;<br />
postconf -e &#8216;smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt&#8217;<br />
postconf -e &#8216;smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem&#8217;<br />
postconf -e &#8216;smtpd_tls_loglevel = 1&#8242;<br />
postconf -e &#8216;smtpd_tls_received_header = yes&#8217;<br />
postconf -e &#8216;smtpd_tls_session_cache_timeout = 3600s&#8217;<br />
postconf -e &#8216;tls_random_source = dev:/dev/urandom&#8217;</p>
<p>The file <span class="system">/etc/postfix/main.cf</span> should now look like this:</p>
<p class="command">cat /etc/postfix/main.cf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre># See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = server1.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = server1.example.com, localhost.example.com, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom</pre>
</td>
</tr>
</table>
<p>Restart Postfix:</p>
<p class="command">/etc/init.d/postfix restart</p>
<p> Authentication will be done by <span class="system">saslauthd</span>. We have to change a few things to make it work properly. Because Postfix runs chrooted in <span class="system">/var/spool/postfix </span> we have to do the following:</p>
<p class="command">mkdir -p /var/spool/postfix/var/run/saslauthd</p>
<p> Now we have to edit <span class="system">/etc/default/saslauthd</span> in order to activate <span class="system">saslauthd</span>. Set <span class="system">START to yes</span> and change the line <span class="system">OPTIONS=&#8221;-c&#8221;</span> to <span class="system">OPTIONS=&#8221;-c -m /var/spool/postfix/var/run/saslauthd -r&#8221;</span>:</p>
<p class="command">vi /etc/default/saslauthd</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>#
# Settings for saslauthd daemon
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="pam"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c)
# See the saslauthd man page for information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
# Note: See /usr/share/doc/sasl2-bin/README.Debian
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"</pre>
</td>
</tr>
</table>
<p>Now start <span class="system">saslauthd</span>:</p>
<p class="command">/etc/init.d/saslauthd start</p>
<p> To see if SMTP-AUTH and TLS work properly now run the following command:</p>
<p class="command">telnet localhost 25</p>
<p> After you have established the connection to your Postfix mail server type</p>
<p class="command">ehlo localhost</p>
<p>If you see the lines</p>
<p class="system">250-STARTTLS</p>
<p>and</p>
<p class="system">250-AUTH PLAIN LOGIN</p>
<p>everything is fine.</p>
<p>The output on my system looks like this:</p>
<p class="system">root@server1:/etc/postfix/ssl# telnet localhost 25<br />
Trying 127.0.0.1&#8230;<br />
Connected to localhost.localdomain.<br />
Escape character is &#8216;^]&#8217;.<br />
220 server1.example.com ESMTP Postfix (Ubuntu)<br />
ehlo localhost<br />
250-server1.example.com<br />
250-PIPELINING<br />
250-SIZE 10240000<br />
250-VRFY<br />
250-ETRN<br />
250-STARTTLS<br />
250-AUTH PLAIN LOGIN<br />
250-AUTH=PLAIN LOGIN<br />
250-ENHANCEDSTATUSCODES<br />
250-8BITMIME<br />
250 DSN<br />
quit<br />
221 2.0.0 Bye<br />
Connection closed by foreign host.<br />
root@server1:/etc/postfix/ssl#</p>
<p>Type</p>
<p class="command">quit</p>
<p> to return to the system&#8217;s shell.</p>
<h3>15 Courier-IMAP/Courier-POP3</h3>
<p>Run this to     install Courier-IMAP/Courier-IMAP-SSL (for IMAPs on port 993) and Courier-POP3/Courier-POP3-SSL (for POP3s on port 995):</p>
<p class="command">apt-get install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-0</p>
<p>You will be asked two questions:</p>
<p><span class="system">Create directories for web-based administration ?</span> <span class="highlight">&lt;&#8211; No</span><br />
<span class="system">SSL certificate required</span> <span class="highlight">&lt;&#8211; Ok</span></p>
<p>If you do not want to use ISPConfig, configure Postfix to deliver emails to a user&#8217;s Maildir*:</p>
<p class="command">postconf -e &#8216;home_mailbox = Maildir/&#8217;<br />
postconf -e &#8216;mailbox_command =&#8217;<br />
/etc/init.d/postfix restart</p>
<p><strong>*Please note:</strong> You do not have to do this if you intend to use <a href="http://www.ispconfig.org/" target="_blank">ISPConfig</a> on your system as ISPConfig does the necessary configuration using procmail recipes. But please go sure to enable <span class="system">Maildir</span> under <span class="system">Management -&gt; Server -&gt; Settings -&gt; EMail</span> in the ISPConfig web interface.</p>
<h3>16 Apache/PHP5</h3>
<p>Now we install Apache:</p>
<p class="command">apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert</p>
<p>Next we install PHP5:</p>
<p class="command">apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl</p>
<p>You will be asked the following question:</p>
<p><span class="system">Continue installing libc-client without Maildir support?</span> <span class="highlight">&lt;&#8211; Yes</span></p>
<p>Next we edit <span class="system">/etc/apache2/mods-available/dir.conf</span>:</p>
<p class="command">vi /etc/apache2/mods-available/dir.conf</p>
<p>and change the <span class="system">DirectoryIndex</span> line:</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>&lt;IfModule mod_dir.c&gt;

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

&lt;/IfModule&gt;</pre>
</td>
</tr>
</table>
<p>Now we have to enable some Apache modules (<span class="system">SSL</span>, <span class="system">rewrite</span>, <span class="system">suexec</span>, and <span class="system">include</span>):</p>
<p class="command">a2enmod ssl<br />
a2enmod rewrite<br />
a2enmod suexec<br />
a2enmod include</p>
<p>Reload the Apache configuration:</p>
<p class="command">/etc/init.d/apache2 force-reload</p>
<h4>16.1 Disable PHP Globally</h4>
<p class="highlight">(If you do not plan to install ISPConfig on this server, please skip this section!)</p>
<p>In ISPConfig you will configure PHP on a per-website basis, i.e. you can specify which website can run PHP scripts and which one cannot. This can only work if PHP is disabled globally because otherwise all websites would be able to run PHP scripts, no matter what you specify in ISPConfig.</p>
<p>To disable PHP globally, we edit <span class="system">/etc/mime.types</span> and comment out the <span class="system">application/x-httpd-php</span> lines:</p>
<p class="command">vi /etc/mime.types</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
#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
[...]</pre>
</td>
</tr>
</table>
<p>Edit <span class="system">/etc/apache2/mods-enabled/php5.conf</span> and comment out the following lines:</p>
<p class="command">vi /etc/apache2/mods-enabled/php5.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>&lt;IfModule mod_php5.c&gt;
  #AddType application/x-httpd-php .php .phtml .php3
  #AddType application/x-httpd-php-source .phps
&lt;/IfModule&gt;</pre>
</td>
</tr>
</table>
<p>Then restart Apache:</p>
<p class="command">/etc/init.d/apache2 restart</p>
<h3>17 Proftpd</h3>
<p>In order to install Proftpd, run</p>
<p class="command">apt-get install proftpd ucf</p>
<p>You will be asked a question:</p>
<p><span class="system">Run proftpd from inetd or standalone?</span> <span class="highlight">&lt;&#8211; standalone</span></p>
<p>Then open <span class="system">/etc/proftpd/proftpd.conf</span> and change <span class="system">UseIPv6</span> from <span class="system">on</span> to <span class="system">off</span>; otherwise you&#8217;ll get a warning like this when you start Proftpd:</p>
<p>If you get a message like this:</p>
<p class="system"> &#8211; IPv6 getaddrinfo &#8216;server1.example.com&#8217; error: Name or service not known</p>
<p>you can either modify <span class="system">/etc/hosts</span> and add <span class="system">server1.example.com</span> to the <span class="system">::1</span> line:</p>
<p class="command">vi /etc/hosts</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>127.0.0.1       localhost.localdomain   localhost
192.168.0.100   server1.example.com     server1

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback server1.example.com
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts</pre>
</td>
</tr>
</table>
<p>&#8230; or you can open <span class="system">/etc/proftpd/proftpd.conf</span> and change <span class="system">UseIPv6</span> from <span class="system">on</span> to <span class="system">off</span></p>
<p class="command">vi /etc/proftpd/proftpd.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
UseIPv6                         off
[...]</pre>
</td>
</tr>
</table>
<p>For security reasons you can also add the following lines to <span class="system">/etc/proftpd/proftpd.conf</span> (thanks to Reinaldo Carvalho; more information can be found here: <a href="http://proftpd.org/localsite/Userguide/linked/userguide.html" target="_blank">http://proftpd.org/localsite/Userguide/linked/userguide.html</a>):</p>
<p class="command">vi /etc/proftpd/proftpd.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."
[...]</pre>
</td>
</tr>
</table>
<p>ISPConfig expects the configuration to be in <span class="system">/etc/proftpd.conf</span> instead of <span class="system">/etc/proftpd/proftpd.conf</span>, therefore we create a symlink (you can skip this command if you don&#8217;t want to install ISPConfig):</p>
<p class="command">ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf</p>
<p>Then restart Proftpd:</p>
<p class="command">/etc/init.d/proftpd restart</p>
<h3>18 Webalizer</h3>
<p>To install <span class="system">webalizer</span>, just run</p>
<p class="command">apt-get install webalizer</p>
<h3>19 Synchronize the System Clock</h3>
<p>It is a good idea to synchronize the system clock with an NTP (<strong>n</strong>etwork <strong>t</strong>ime <strong>p</strong>rotocol) server over the internet. Simply run</p>
<p class="command">apt-get install ntp ntpdate</p>
<p> and your system time will always be in sync.</p>
<h3>20 Install Some Perl Modules Needed By SpamAssassin (Comes With ISPConfig)</h3>
<p>Run</p>
<p class="command">apt-get install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl</p>
<h3>21 ISPConfig</h3>
<p>The configuration of the server is now finished, and if you wish you can now install <a href="http://www.ispconfig.org/" target="_blank">ISPConfig</a> on it. Please check out the ISPConfig installation manual: <a href="http://www.ispconfig.org/manual_installation.htm" target="_blank">http://www.ispconfig.org/manual_installation.htm </a></p>
<h4>21.1 A Note On SuExec</h4>
<p>If you want to run CGI scripts under suExec, you should specify <span class="system">/var/www</span> as the home directory for websites created by ISPConfig as Ubuntu&#8217;s suExec is compiled with <span class="system">/var/www</span> as <span class="system">Doc_Root</span>. Run</p>
<p class="command"> /usr/lib/apache2/suexec -V</p>
<p>and the output should look like this:</p>
<p class="system">root@server1:~# /usr/lib/apache2/suexec -V<br />
-D AP_DOC_ROOT=&#8221;/var/www&#8221;<br />
-D AP_GID_MIN=100<br />
-D AP_HTTPD_USER=&#8221;www-data&#8221;<br />
-D AP_LOG_EXEC=&#8221;/var/log/apache2/suexec.log&#8221;<br />
-D AP_SAFE_PATH=&#8221;/usr/local/bin:/usr/bin:/bin&#8221;<br />
-D AP_UID_MIN=100<br />
-D AP_USERDIR_SUFFIX=&#8221;public_html&#8221;<br />
root@server1:~#</p>
<p>So if you want to use suExec with ISPconfig, don&#8217;t change the default web root (which is <span class="system">/var/www</span>) if you use expert mode during the ISPConfig installation (in standard mode you can&#8217;t change the web root anyway so you&#8217;ll be able to use suExec in any case).</p>
<p>The following screenshot is taken from an ISPConfig installation in expert mode. If you want to use ISPConfig, then don&#8217;t change the default web root:</p>
<p><img src="http://www.linewbie.com/upload/linewbie.com/attach-diy/images/perfect-server/31.png" height="164" width="321" /></p>
<h3>22 Links</h3>
<ul>
<li>Ubuntu: <a href="http://www.ubuntu.com/" target="_blank">http://www.ubuntu.com</a></li>
<li>ISPConfig: <a href="http://www.ispconfig.org/" target="_blank">http://www.ispconfig.org</a></li>
</ul>
<p class="command">&nbsp;</p>
<p class="system">&nbsp;</p>
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2007/10/how-to-build-the-perfect-server-with-ubuntu-gutsy-gibbon-ubuntu-710.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

