<?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; servers</title>
	<atom:link href="http://linewbie.com/category/applications-software/servers/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 Install VMware Server On OpenSUSE Linux 10.3</title>
		<link>http://linewbie.com/2008/03/how-to-install-vmware-server-on-opensuse-linux-103.html</link>
		<comments>http://linewbie.com/2008/03/how-to-install-vmware-server-on-opensuse-linux-103.html#comments</comments>
		<pubDate>Thu, 27 Mar 2008 12:55:51 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[applications/software]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2008/03/how-to-install-vmware-server-on-opensuse-linux-103.html</guid>
		<description><![CDATA[bold writing are command that you need to enter red letting are command that you need to issue as root click on Computer &#62; More Applications &#62; YaST Put in root password for YaST Scroll down until you see Software &#8230; <a href="http://linewbie.com/2008/03/how-to-install-vmware-server-on-opensuse-linux-103.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>bold writing are command that you need to enter</strong></p>
<p style="margin-bottom: 0in"><font color="#ff0000">red letting are command that you need to issue as root</font></p>
<ol>
<li>
<p style="margin-bottom: 0in">click on Computer &gt; More 	Applications &gt; YaST</p>
</li>
<li>
<p style="margin-bottom: 0in">Put in root password for YaST</p>
</li>
<li>
<p style="margin-bottom: 0in">Scroll down until you see Software 	Management and single click on it</p>
</li>
<li>
<p style="margin-bottom: 0in">Check for the following software. 	If you don&#8217;t have it installed, install it</p>
<ol>
<li>
<p style="margin-bottom: 0in">kernel-source</p>
</li>
<li>
<p style="margin-bottom: 0in">gcc</p>
</li>
<li>
<p style="margin-bottom: 0in">gcc-c++</p>
</li>
<li>
<p style="margin-bottom: 0in">make (This is most likely already 		installed, but just to double check)</p>
</li>
</ol>
</li>
<p><span id="more-464"></span></p>
<li>
<p style="margin-bottom: 0in">Once you have installed that 	software, lets head over to the command line. Right click on the 	desktop and select â€œopen terminalâ€</p>
</li>
<li>
<p style="margin-bottom: 0in">Once you get into the terminal, 	you want to log in as a super user or root. You can do this by using 	the su command</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><a href="mailto:clmowers@linux-box"><font color="#000000"><span>clmowers@linux-box</span></font></a><span>:~&gt;</span><strong> 				SU</strong>Password:<font color="#ff0000"><strong>linux-box:/home/clmowers #</strong></font></td>
</tr>
</table>
</li>
<li>
<p style="margin-bottom: 0in">Next you want 	to run the following command. This will check for the needed 	software and it will also show you the kernel modules that are 	installed. You <strong>MUST </strong>have the same kernel numbers though out, 	or you will have issues later down the road</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%">rpm -qa kernel* gcc* make</td>
</tr>
</table>
<p style="margin-bottom: 0in">It will look like 	this when the command is run</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><font color="#ff0000">linux-box:/home/clmowers #</font> <font color="#000000"><strong>rpm 				-qa kernel* gcc* make </strong></font>gcc-c++-4.2-24make-3.81-66kernel-source-<font color="#280099"><strong>2.6.22.17-0.1 </strong></font>gcc42-c++-4.2.1_20070724-17</p>
<p>kernel-default-<font color="#280099"><strong>2.6.22.17-0.1 </strong></font></p>
<p>gcc-4.2-24</p>
<p>gcc42-4.2.1_20070724-17</td>
</tr>
</table>
<p style="margin-bottom: 0in">Notice that both 	of the kernels are the same. If these numbers are diffent then you 	need to run the online updates to get the lastest ones and to make 	sure everything matches. ***Just remember that these numbers change, 	This was the latest kernel when I wrote this, yours might be 	different from mine.</p>
</li>
<li>
<p style="margin-bottom: 0in">OK, lets move 	on. Next we want to change the directory to /usr/scr/linux. We can 	do that by this command</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><font color="#ff0000">linux-box:/home/clmowers #</font> <strong>cd 				/usr/src/linux</strong></td>
</tr>
</table>
</li>
<li>
<p style="margin-bottom: 0in">next we want 	to issue these commands. Don&#8217;t worry, we are almost done in the 	command line for the time being.</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><font color="#ff0000">linux-box:/home/clmowers # </font><font color="#000000"> 				</font><font color="#000000"><strong>make mrproper; make cloneconfig; 				make modules_prepare</strong></font><font color="#000000">You will notice that it is done when you 				get back to this line</font><font color="#ff0000">linux-box:/home/clmowers #</font></td>
</tr>
</table>
</li>
<li>
<p style="margin-bottom: 0in"> YEA!!! The 	moment we all have been waiting for, installing vmware server. But 	we are not done yet. Once vmware server is installed we will need to 	configure it. Then you can start adding all the VM that your heart 	desires.</p>
</li>
<li>
<p style="margin-bottom: 0in">Next you want 	to go to where you have downloaded the file and right click and 	select install software</p>
</li>
<li>
<p style="margin-bottom: 0in">Once the 	windows closes we are ready to configure it. I know I know, but we 	are almost done. Just 2 more minutes.</p>
</li>
<li>
<p style="margin-bottom: 0in">open up a new 	terminal window (or open the one you already had) and issue this 	command</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><font color="#ff0000">linux-box:/home/clmowers # </font><font color="#000000"> 				</font><font color="#000000"><strong>cd /usr/bin</strong></font><font color="#ff0000">linux-box:/usr/bin 				#</font></td>
</tr>
</table>
</li>
<li>
<p style="margin-bottom: 0in">This will 	bring you to the /usr/bin directory. Next we want to run the pl 	script the vmware was so kind of to provide us. This will let us 	configure the server</p>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%"><font color="#ff0000">linux-box:/usr/bin 				# </font><font color="#000000"> </font><font color="#000000"><strong>vmware-config.pl</strong></font></td>
</tr>
</table>
</li>
<li>
<p style="margin-bottom: 0in">We will start 	out by reading the EULA. Hit space or enter to go through the 	agreement. Once you are done reading hit Q and then type yes. Now 	what I did was just accept all the defaults. This will give you a 	very good install of vmware. My only suggestion would be to create a 	folder under your /home/username/ directory called vms. When you get 	to the question asking you where you want to have your virutual 	machine saved, type in that location.</p>
</li>
<li>
<p style="margin-bottom: 0in">You will be 	ask for your license key, so make sure that you have one. Type it in 	and press eneter.</p>
</li>
</ol>
<p style="margin-bottom: 0in">&nbsp;</p>
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2008/03/how-to-install-vmware-server-on-opensuse-linux-103.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reduce Apache Load With lighttpd On Debian Etch Linux</title>
		<link>http://linewbie.com/2008/02/reduce-apache-load-with-lighttpd-on-debian-etch-linux.html</link>
		<comments>http://linewbie.com/2008/02/reduce-apache-load-with-lighttpd-on-debian-etch-linux.html#comments</comments>
		<pubDate>Thu, 14 Feb 2008 05:16:43 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[applications/software]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2008/02/reduce-apache-load-with-lighttpd-on-debian-etch-linux.html</guid>
		<description><![CDATA[Lighttpd, sometimes pronounced &#8220;Lighty&#8221;, is a lightweight HTTP server that can help alleviate Apache&#8217;s load by serving static content. Since Lighttpd uses less resources per request than Apache, it generally serves most static content faster than Apache. This tutorial shows &#8230; <a href="http://linewbie.com/2008/02/reduce-apache-load-with-lighttpd-on-debian-etch-linux.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lighttpd, sometimes pronounced &#8220;Lighty&#8221;, is a lightweight HTTP server that    can help alleviate Apache&#8217;s load by serving static content. Since Lighttpd uses    less resources per request than Apache, it generally serves most static content    faster than Apache. This tutorial shows how to install Lighttpd behind Apache    via ApacheÂ´s proxy module.</p>
<p>No 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><a href="http://www.howtoforge.com/perfect_setup_debian_etch" target="_blank">The Perfect Setup &#8211; Debian Etch (Debian 4.0)</a></li>
<li><a href="http://www.howtoforge.com/lighttpd_mysql_php_debian_etch" target="_blank">Installing Lighttpd With PHP5 And MySQL Support On Debian Etch</a></li>
</ul>
<h3>2 Setting up lighttpd</h3>
<p>Once Lighttpd is installed, you&#8217;ll have to modify the configuration file to use it</p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<pre>#bind to port (Default: 80)
server.port = 81

<span id="more-460"></span>

# bind to localhost (recommended for proxy behind Apache, otherwise comment this out for all)
server.bind = "localhost"</pre>
<p>This is not a full listing of the configuration file, but rather a highlight of  the most important parts. Notice that we&#8217;ve set the server port to 81. By doing  this, we&#8217;re making sure it doesn&#8217;t clash with Apache listening on port 80. If  you wanted to let Lighttpd power your entire site instead of Apache, you can set  this to port 80, or comment it out to accept the default.<br />
Then we restart Lighttpd:</p>
<p class="command">/etc/init.d/lighttpd restart</p>
<h3>3 Setting up Apache&#8217;s proxy</h3>
<p>To let Apache take the output of Lighttpd on port 81 and map it to your website,    you&#8217;ll need to make sure the Proxy module of Apache is loaded.<br />
Using the Perfect Setup tutorial this module will either be there already but    not activated.</p>
<p class="command">   a2enmod proxy_http<br />
a2enmod proxy_connect</p>
<p>If you are using virtual hosting, you will want to use the following code to    set up a proxy between the applicable <virtualhost> directives:</virtualhost></p>
<pre>ProxyRequests Off
ProxyPreserveHost On
ProxyPass /media http://0.0.0.0:81/
ProxyPassReverse / http://0.0.0.0:81/</pre>
<p>Then we restart Apache:</p>
<p class="command">/etc/init.d/apache2 reload</p>
<h3>4 Final notice</h3>
<p>In the above example, Lighttpd will serve up your media folder, leaving Apache    to do the rest. Set this to any folder that has static content in it and Lighttpd    will serve it, instead of Apache. Another good use of Lighttpd would be to serve    up multimedia files, taking the load off of Apache. The increase of performance    you&#8217;ll gain is dependent on many factors. If you only have Lighttpd serve up    your images, it probably won&#8217;t help too much. You can put all of your static    content, including HTML and PDF files, images, and movies in a folder called    /static and then set the ProxyPass variable to that for a slightly better performance.</p>
<p>The increase of performance you&#8217;ve gained so far with Lighttpd is not phenomenal,    but helps to increase the website performance and reduces the load on your server.</p>
<h3>5 Links</h3>
<ul>
<li>Lighttpd: <a href="http://www.lighttpd.net/" target="_blank">http://www.lighttpd.net</a></li>
<li>Apache Module mod_proxy: <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html" target="_blank">http://httpd.apache.org/docs/2.0/mod/mod_proxy.html</a></li>
<li>PHP: <a href="http://www.php.net/" target="_blank">http://www.php.net</a></li>
<li>MySQL: <a href="http://www.mysql.com/" target="_blank">http://www.mysql.com</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2008/02/reduce-apache-load-with-lighttpd-on-debian-etch-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Lighttpd With PHP5 And MySQL Support On Fedora 8</title>
		<link>http://linewbie.com/2008/02/installing-lighttpd-with-php5-and-mysql-support-on-fedora-8.html</link>
		<comments>http://linewbie.com/2008/02/installing-lighttpd-with-php5-and-mysql-support-on-fedora-8.html#comments</comments>
		<pubDate>Mon, 11 Feb 2008 04:19:31 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[applications/software]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2008/02/installing-lighttpd-with-php5-and-mysql-support-on-fedora-8.html</guid>
		<description><![CDATA[Version 1.0 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited 01/11/2008 Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a Fedora 8 server with PHP5 &#8230; <a href="http://linewbie.com/2008/02/installing-lighttpd-with-php5-and-mysql-support-on-fedora-8.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Version 1.0<br />
Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt;<br />
Last edited 01/11/2008</p>
<p>Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a Fedora 8 server with PHP5 support (through FastCGI) and MySQL support.</p>
<p>I do not issue any guarantee that this will work for you!</p>
<h3>1 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>. These settings might differ for you, so you have to replace them where appropriate.</p>
<h3>2 Installing MySQL 5.0</h3>
<p>First we install MySQL 5.0 like this:</p>
<p class="command">yum install mysql mysql-server</p>
<p> Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:</p>
<p class="command">chkconfig &#8211;levels 235 mysqld on<br />
/etc/init.d/mysqld start</p>
<p><span id="more-459"></span></p>
<p>Create a password for the MySQL user <span class="system">root</span> (replace <span class="system">yourrootsqlpassword</span> with the password you want to use):</p>
<p class="command">mysqladmin -u root password yourrootsqlpassword</p>
<p>Then check with</p>
<p class="command">netstat -tap | grep mysql</p>
<p>on which addresses MySQL is listening. If the output looks like this:</p>
<p class="system">tcp        0      0 localhost.localdo:mysql *:*                     LISTEN     2713/mysqld</p>
<p>which means MySQL is listening on <span class="system">localhost.localdomain</span> only, then you&#8217;re safe with the password you set before. But if the output looks like this:</p>
<p class="system">tcp        0      0 *:mysql *:*                     LISTEN     2713/mysqld</p>
<p>you should set a MySQL password for your hostname, too, because otherwise anybody can access your database and modify data:</p>
<p class="command">mysqladmin -h server1.example.com -u root password yourrootsqlpassword</p>
<h3>3 Installing Lighttpd</h3>
<p>Lighttpd is available as a Fedora package, therefore we can install it like this:</p>
<p class="command">yum install lighttpd</p>
<p>Then we create the system startup links for Lighttpd (so that Lighttpd starts automatically whenever the system boots) and start it:</p>
<p class="command">chkconfig &#8211;levels 235 lighttpd on<br />
/etc/init.d/lighttpd start</p>
<p>Now direct your browser to <span class="system">http://192.168.0.100</span>, and you should see the Lighttpd placeholder page:</p>
<p><a href="http://images.howtoforge.com/images/lighttpd_php5_mysql_fedora8/big/1.png" class="thickbox"><img src="http://images.howtoforge.com/images/lighttpd_php5_mysql_fedora8/1.png" height="405" width="550" /><img src="http://images.howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Lighttpd&#8217;s default document root is <span class="system">/srv/www/lighttpd</span> on Fedora, and the configuration file is <span class="system">/etc/lighttpd/lighttpd.conf</span>.</p>
<h3>4 Installing PHP5</h3>
<p>We can make PHP5 work in Lighttpd through FastCGI. Therefore we install the packages <span class="system">lighttpd-fastcgi</span> and <span class="system">php-cli</span>:</p>
<p class="command">yum install lighttpd-fastcgi php-cli</p>
<h3>5 Configuring Lighttpd And PHP5</h3>
<p>To enable PHP5 in Lighttpd, we must modify two files, <span class="system">/etc/php.ini</span> and <span class="system">/etc/lighttpd/lighttpd.conf</span>. First we open <span class="system">/etc/php.ini</span> and add the line <span class="system">cgi.fix_pathinfo = 1</span> right at the end of the file:</p>
<p class="command">vi /etc/php.ini</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
cgi.fix_pathinfo = 1</pre>
</td>
</tr>
</table>
<p>Then we open <span class="system">/etc/lighttpd/lighttpd.conf</span> and uncomment<span class="system"> &#8220;mod_fastcgi&#8221;,</span> in the <span class="system">server.modules</span> stanza:</p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
server.modules              = (
#                               "mod_rewrite",
#                               "mod_redirect",
#                               "mod_alias",
                                "mod_access",
#                               "mod_cml",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
                                "mod_fastcgi",
#                               "mod_proxy",
#                               "mod_simple_vhost",
#                               "mod_evhost",
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )
[...]</pre>
</td>
</tr>
</table>
<p>and then, further down the file, there&#8217;s a <span class="system">fastcgi.server</span> stanza which we uncomment as well:</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server             = ( ".php" =&gt;
                               ( "localhost" =&gt;
                                 (
                                   "socket" =&gt; "/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" =&gt; "/usr/bin/php-cgi"
                                 )
                               )
                            )
[...]</pre>
</td>
</tr>
</table>
<p>Then we restart Lighttpd:</p>
<p class="command">/etc/init.d/lighttpd restart</p>
<p class="command">&nbsp;</p>
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2008/02/installing-lighttpd-with-php5-and-mysql-support-on-fedora-8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install and Set Up Subversion And Trac As Virtual Hosts On An Ubuntu Linux Server</title>
		<link>http://linewbie.com/2008/01/install-and-set-up-subversion-and-trac-as-virtual-hosts-on-an-ubuntu-linux-server.html</link>
		<comments>http://linewbie.com/2008/01/install-and-set-up-subversion-and-trac-as-virtual-hosts-on-an-ubuntu-linux-server.html#comments</comments>
		<pubDate>Sat, 12 Jan 2008 09:06:11 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[guides]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Linux Server]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2008/01/install-and-set-up-subversion-and-trac-as-virtual-hosts-on-an-ubuntu-linux-server.html</guid>
		<description><![CDATA[This howto outlines the process by which one can set up the Subversion version control system, and have it work in tandem with Trac, the project manager for software development projects, on a server running Ubuntu (or possibly Debian). It &#8230; <a href="http://linewbie.com/2008/01/install-and-set-up-subversion-and-trac-as-virtual-hosts-on-an-ubuntu-linux-server.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This howto outlines the process by which one can set up the <a href="http://subversion.tigris.org/" target="_blank">Subversion</a> version control system, and have it work in tandem with <a href="http://trac.edgewall.org/" target="_blank">Trac</a>, the project manager for software development projects, on a server running Ubuntu (or possibly Debian). It is brought to you by <a href="http://www.openject.com/" target="_blank">Openject Consulting</a>.</p>
<h3>Setting up Subversion</h3>
<p>For detailed information on this, including alternate setups, have a look at <a href="http://svnbook.red-bean.com/nightly/en/index.html" target="_blank">Version Control with Subversion</a>.</p>
<p><span id="more-442"></span></p>
<ol>
<li>
<dl>
<dt>Install the required packages.</dt>
<dd class="command">sudo aptitude install enscript libapache2-mod-python python-docutils trac db4.3-util libapache2-svn subversion-tools</dd>
</dl>
</li>
<li>
<dl>
<dt>Create a virtual host directory for SVN. We&#8217;ll use /var/local/svn instead of /var/www so that Subversion instances don&#8217;t clog up the directory of web root directories.</dt>
<dd class="command">sudo mkdir -p /var/local/svn/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Create a development group, and add the web user to it.</dt>
<dd class="command">sudo addgroup example; sudo adduser www-data example</dd>
</dl>
</li>
<li>
<dl>
<dt>Add users to the development group.  These are persons that need access to the repository.</dt>
<dd>
<ol>
<li class="command">sudo adduser username1 example</li>
<li class="command">sudo adduser username2 example</li>
<li class="command">sudo adduser username3 example</li>
</ol>
</dd>
</dl>
</li>
<li>
<dl>
<dt>Set the proper permissions.</dt>
<dd class="command">sudo chmod 2770 /var/local/svn/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Set up the repository.</dt>
<dd class="command">sudo svnadmin create /var/local/svn/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Clear the current password file. By default it&#8217;s for the svnserve protocol, but we&#8217;ll be using HTTPS (or just HTTP). We&#8217;ll be adding users to this file later in the process.</dt>
<dd class="command">sudo rm /var/local/svn/svn.example.com/conf/passwd<br />
sudo touch /var/local/svn/svn.example.com/conf/passwd</dd>
</dl>
</li>
<li>
<dl>
<dt>Allow the group to write to the repository.</dt>
<dd class="command">sudo chmod -R g+w /var/local/svn/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Set proper file ownership.</dt>
<dd class="command">sudo chown -R www-data:example /var/local/svn/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Set the repository access permissions.  Information on how to do this can be found in the <a href="http://svnbook.red-bean.com/nightly/en/svn.serverconfig.pathbasedauthz.html" target="_blank">Path-Based Authorization</a> section of <a href="http://svnbook.red-bean.com/nightly/en/index.html" target="_blank">Version Control with Subversion</a>.</dt>
<dd class="command">sudo vi /var/local/svn/svn.example.com/conf/authz</dd>
</dl>
</li>
<li>
<dl>
<dt>Create a directory for the log files.</dt>
<dd class="command">sudo mkdir /var/log/apache2/svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Add the site to the log rotation list.</dt>
<dd class="command">sudo vi /etc/logrotate.d/apache2</dd>
</dl>
</li>
<li>
<dl>
<dt>Configure the virtual host&#8230;</dt>
<dd class="command">sudo vi /etc/apache2/sites-available/svn.example.com</dd>
<dt>&#8230;with the following data.  If you don&#8217;t care about SSL, you can ignore the SSL options and run this on port 80.</dt>
<dd>
<pre>&lt;VirtualHost [server's IP address]:443&gt;
  ServerName svn.example.com
  &lt;Location /&gt;
    DAV svn
    AuthType Basic
    AuthName "svn.example.com"
    AuthUserFile /var/local/svn/svn.example.com/conf/passwd
    AuthzSVNAccessFile /var/local/svn/svn.example.com/conf/authz
    SVNPath /var/local/svn/svn.example.com
    Require valid-user
  &lt;/Location&gt;
  CustomLog /var/log/apache2/svn.example.com/access.log combined
  ErrorLog /var/log/apache2/svn.example.com/error.log
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/apache.pem
# Add this once there is a real (non self-signed) certificate.
#  SSLCertificateKeyFile /etc/apache2/ssl/server.key
&lt;/VirtualHost&gt;
&lt;VirtualHost [server's IP address]:80&gt;
  ServerName svn.example.com
  Redirect / https://svn.example.com/
&lt;/VirtualHost&gt;</pre>
</dd>
<dt>Reference:</dt>
<dd>/etc/apache2/mods-enabled/dav_svn.conf</dd>
</dl>
</li>
<li>
<dl>
<dt>Enable the subversion virtual host.</dt>
<dd class="command">sudo a2ensite svn.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Create user/password combinations.</dt>
<dd class="command">htpasswd /var/local/svn/svn.example.com/conf/passwd username</dd>
</dl>
</li>
<li>
<dl>
<dt>Restart the web server.</dt>
<dd class="command">sudo /etc/init.d/apache2 restart</dd>
</dl>
</li>
<li>
<dl>
<dt>If you&#8217;re going to have users working locally, set up svnwrap.  (See the man page for details.)</dt>
<dd class="command">sudo ln -s /usr/bin/svnwrap /usr/local/bin/svn</dd>
</dl>
</li>
</ol>
<h3>Setting up Trac</h3>
<ol>
<li>
<dl>
<dt>Create the web directory.  We&#8217;ll use /var/local/trac instead of /var/www so as not to clog up the directory of webroots.</dt>
<dd class="command">sudo mkdir /var/local/trac/trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Set the proper permissions.</dt>
<dd class="command">sudo chmod 2770 /var/local/trac/trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Create a Trac instance.</dt>
<dd class="command">sudo trac-admin /var/local/trac/trac.example.com initenv</dd>
</dl>
</li>
<li>
<dl>
<dt>Set proper ownership on the web directory.</dt>
<dd class="command">sudo chown -R www-data:example /var/local/trac/trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Allow the group to write to the repository.</dt>
<dd class="command">sudo chmod -R g+w /var/local/trac/trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Configure it.</dt>
<dd class="command">sudo vi /var/local/trac/trac.example.com/conf/trac.ini</dd>
</dl>
</li>
<li>
<dl>
<dt>Create a directory for the log files.</dt>
<dd class="command">sudo mkdir /var/log/apache2/trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Add the site to the log rotation list.</dt>
<dd class="command">sudo vi /etc/logrotate.d/apache2</dd>
</dl>
</li>
<li>
<dl>
<dt>Configure the virtual host&#8230;</dt>
<dd class="command">sudo vi /etc/apache2/sites-available/trac.example.com</dd>
<dt>&#8230;with the following data.  If you don&#8217;t care about SSL, you can skip the SSL options and run this on port 80.</dt>
<dd>
<pre># Trac Configuration
&lt;VirtualHost [server's IP address]:80&gt;
  ServerName trac.example.com
  Redirect / https://trac.example.com/
&lt;/VirtualHost&gt;
&lt;VirtualHost [server's IP address]:443&gt;
  ServerName trac.example.com
  DocumentRoot /var/local/trac/trac.example.com/
  Alias /trac/ /usr/share/trac/htdocs
  &lt;Directory "/usr/share/trac/htdocs/"&gt;
      Options Indexes MultiViews
      AllowOverride None
      Order allow,deny
      Allow from all
  &lt;/Directory&gt;
  &lt;Location /&gt;
      SetHandler mod_python
      PythonHandler trac.web.modpython_frontend
      PythonInterpreter main_interpreter
      PythonOption TracEnv /var/local/trac/trac.example.com/
      PythonOption TracUriRoot /
      AuthType Basic
      AuthName "trac.example.com"
      # Use the SVN password file.
      AuthUserFile /var/local/svn/svn.example.com/conf/passwd
      Require valid-user
  &lt;/Location&gt;
  CustomLog /var/log/apache2/trac.example.com/access.log combined
  ErrorLog /var/log/apache2/trac.example.com/error.log
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/apache.pem
# Add this once there is a real (non self-signed) certificate.
#  SSLCertificateKeyFile /etc/apache2/ssl/server.key
&lt;/VirtualHost&gt;</pre>
</dd>
<dt>Reference:</dt>
<dd><a href="http://trac.edgewall.org/wiki/TracOnUbuntu" target="_blank">http://trac.edgewall.org/wiki/TracOnUbuntu</a></dd>
</dl>
</li>
<li>
<dl>
<dt>Enable the Trac virtual host.</dt>
<dd class="command">sudo a2ensite trac.example.com</dd>
</dl>
</li>
<li>
<dl>
<dt>Restart the web server.</dt>
<dd class="command">sudo /etc/init.d/apache2 restart</dd>
</dl>
</li>
</ol>
<p>The last thing to do is add the subdomains &#8220;svn&#8221; and &#8220;trac&#8221; to the DNS configuration for your domain. Once this is done, Subversion and Trac will be integrated into your server environment, and will be accessible from the web.
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2008/01/install-and-set-up-subversion-and-trac-as-virtual-hosts-on-an-ubuntu-linux-server.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perfect Server Series: CentOS 4.6 Server Setup: LAMP, Email, DNS, FTP, ISPConfig</title>
		<link>http://linewbie.com/2008/01/perfect-server-series-centos-46-server-setup-lamp-email-dns-ftp-ispconfig.html</link>
		<comments>http://linewbie.com/2008/01/perfect-server-series-centos-46-server-setup-lamp-email-dns-ftp-ispconfig.html#comments</comments>
		<pubDate>Thu, 10 Jan 2008 09:06:09 +0000</pubDate>
		<dc:creator>Linewbie.com</dc:creator>
				<category><![CDATA[applications/software]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux Server]]></category>
		<category><![CDATA[perfect server]]></category>

		<guid isPermaLink="false">http://www.linewbie.com/2008/01/perfect-server-series-centos-46-server-setup-lamp-email-dns-ftp-ispconfig.html</guid>
		<description><![CDATA[CentOS 4.6 Server Setup: LAMP, Email, DNS, FTP, ISPConfig (a.k.a. The Perfect Server) Version 1.0 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited 12/17/2007 This tutorial shows how to set up a CentOS 4.6 based server that offers &#8230; <a href="http://linewbie.com/2008/01/perfect-server-series-centos-46-server-setup-lamp-email-dns-ftp-ispconfig.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h4>CentOS 4.6 Server Setup: LAMP, Email, DNS, FTP, ISPConfig (a.k.a. The Perfect Server)</h4>
<p>Version 1.0<br />
Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt;<br />
Last edited 12/17/2007</p>
<p>This tutorial shows how to set up a <strong>CentOS 4.6</strong> based server that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of CentOS 4.6, 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.0.x</li>
<li>Database Server: MySQL 4.1</li>
<li>Mail Server: Postfix</li>
<li>DNS Server: BIND9 (chrooted!)</li>
<li>FTP Server: proftpd</li>
<li>POP3/IMAP server: dovecot</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>
<p><span id="more-441"></span></p>
<h3>Requirements</h3>
<p>To install such a system you will need the following:</p>
<ul>
<li>Download the CentOS 4.6  DVD or the four CD iso images from a mirror near you (the list of mirrors can be found here: <a href="http://www.centos.org/modules/tinycontent/index.php?id=13" target="_blank">http://www.centos.org/modules/tinycontent/index.php?id=13</a>).</li>
<li>a fast internet connection&#8230;</li>
</ul>
<h3>1 Install The Base System</h3>
<p>Boot from your CentOS 4.6 DVD or CD (CD 1).</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/1.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/1.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>It can take a long time to test the installation media so we skip this test here:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/2.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/2.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 welcome screen of the CentOS installer appears. Click on <span class="system">Next</span>:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/3.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/3.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 your language next:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/4.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/4.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Select your keyboard layout:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/5.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/5.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 want to install a server so we choose <span class="system">Server </span> here:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/6.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/6.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Next we do the partitioning. Select <span class="system">Automatically partition.</span> This will give you a smalll <span class="system">/boot</span> partition and a large <span class="system">/</span> partition which is fine for our purposes:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/7.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/7.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>I&#8217;m installing CentOS 4.6 on a fresh system, so I answer <span class="system">Yes</span> to the question <span class="system">Would you like to initialize this drive, erasing ALL DATA?</span></p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/8.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/8.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Select <span class="system">Remove all partitions on this system.</span></p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/9.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/9.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 want to remove all Linux partitions, so we answer <span class="system">Yes</span> to the following question:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/10.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/10.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 presents you an overview of our new partitions. Click on <span class="system">Next</span>:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/11.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/11.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 boot loader <span class="system">GRUB </span> will be installed. You can leave the default settings unchanged and click on <span class="system">Next</span>:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/12.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/12.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></a></p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/12.png" class="thickbox"></a> On to the network settings. The default setting here is to configure the network interfaces with <span class="system">DHCP</span>, but we are installing a server, so static IP addresses are not a bad idea&#8230; Click on the <span class="system">Edit </span> button at the top right. In the window that pops up uncheck <span class="system">Configure using DHCP </span> and give your network card a static IP address (in this tutorial I&#8217;m using the IP address <span class="system">192.168.0.100 </span> for demonstration purposes):</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/13.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/13.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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.howtoforge.com/images/perfect_server_centos_4.6/big/14.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/14.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></a></p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/14.png" class="thickbox"></a> Set the hostname manually, e.g. <span class="system">server1.example.com</span>, and enter a gateway (e.g. <span class="system">192.168.0.1</span>) and up to three DNS servers (e.g. <span class="system">213.191.92.86, 145.253.2.75</span>, and <span class="system">193.174.32.18</span>):</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/15.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/15.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>I want to install ISPConfig at the end of this tutorial which comes with its own firewall. That&#8217;s why I disable the default CentOS firewall now. Of course, you are free to leave it on and configure it to your needs (but then you shouldn&#8217;t use any other firewall later on as it will most probably interfere with the CentOS firewall).</p>
<p>SELinux is a security extension of CentOS that should provide extended security. In my opinion you don&#8217;t need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn&#8217;t working as expected, and then you find out that everything was ok, only SELinux was causing the problem). Therefore I disable it (this is a must if you want to install ISPConfig later on).</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/16.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/16.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Click on <span class="system">Proceed</span>:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/17.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/17.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Select the default language for the system and add further languages, if necessary:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/18.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/18.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 your time zone:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/19.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/19.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Give <span class="system">root </span> a password:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/20.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/20.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 we are to select the package groups we want to install. Select <span class="system">Editors</span>, <span class="system">Text Based Internet</span>, <span class="system">Server Configuration Tools</span>, <span class="system">Web Server</span>, <span class="system">Mail Server</span>, <span class="system">DNS Name Server</span>, <span class="system">FTP Server</span>, <span class="system">MySQL Database</span>, <span class="system">Development Tools</span>, <span class="system">Administration Tools</span> and <span class="system">System Tools</span> and click on <span class="system">Next</span>:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/21.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/21.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Click on <span class="system">Next</span> to start the installation:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/22.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/22.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 hard drive is being partitioned:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/23.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/23.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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 begins. This will take a few minutes:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/24.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/24.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Finally, the installation is complete, and you can remove your CD from the computer and reboot it:</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/25.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/25.png" height="413" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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, on to the configuration&#8230;</p>
<h3>2 Adjust /etc/hosts</h3>
<p>Next we 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># Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               localhost.localdomain localhost

192.168.0.100           server1.example.com server1</pre>
</td>
</tr>
</table>
<h3>3 Configure Additional IP Addresses</h3>
<p>(This section is totally optional. It just shows how to add additional IP addresses to your network interface <span class="system">eth0</span> if you need more than one IP address. If you&#8217;re fine with one IP address, you can skip this section.)</p>
<p>Let&#8217;s assume our network interface is <span class="system">eth0</span>. Then there is a file <span class="system">/etc/sysconfig/network-scripts/ifcfg-eth0 </span> which looks like this:</p>
<p class="command">cat /etc/sysconfig/network-scripts/ifcfg-eth0</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>DEVICE=eth0

BOOTPROTO=static

BROADCAST=192.168.0.255

HWADDR=00:0C:29:CD:66:08

IPADDR=192.168.0.100

NETMASK=255.255.255.0

NETWORK=192.168.0.0

ONBOOT=yes

TYPE=Ethernet</pre>
</td>
</tr>
</table>
<p>Now we want to create the virtual interface <span class="system">eth0:0 </span> with the IP address <span class="system">192.168.0.101</span>. All we have to do is to create the file <span class="system">/etc/sysconfig/network-scripts/ifcfg-eth0:0 </span>which looks like this (we can leave out the <span class="system">HWADDR</span> line as it is the same physical network card):</p>
<p class="command">vi /etc/sysconfig/network-scripts/ifcfg-eth0:0</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>DEVICE=eth0:0

BOOTPROTO=static

BROADCAST=192.168.0.255

IPADDR=192.168.0.101

NETMASK=255.255.255.0

NETWORK=192.168.0.0

ONBOOT=yes

TYPE=Ethernet</pre>
</td>
</tr>
</table>
<p>Afterwards we have to restart the network:</p>
<p class="command">/etc/init.d/network restart</p>
<p>You might also want to adjust <span class="system">/etc/hosts</span> after you have added new IP addresses, although this is not necessary.</p>
<p>Now run</p>
<p class="command">ifconfig</p>
<p>You should now see your new IP address in the output:</p>
<p class="system">[root@server1 ~]# ifconfig<br />
eth0      Link encap:Ethernet  HWaddr 00:0C:29:CD:66:08<br />
inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0<br />
inet6 addr: fe80::20c:29ff:fecd:6608/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:373 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:385 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:31529 (30.7 KiB)  TX bytes:64449 (62.9 KiB)<br />
Interrupt:177 Base address:0&#215;1400</p>
<p>eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:CD:66:08<br />
inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
Interrupt:177 Base address:0&#215;1400</p>
<p>lo        Link encap:Local Loopback<br />
inet addr:127.0.0.1  Mask:255.0.0.0<br />
inet6 addr: ::1/128 Scope:Host<br />
UP LOOPBACK RUNNING  MTU:16436  Metric:1<br />
RX packets:8 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0<br />
RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)</p>
<p>[root@server1 ~]#</p>
<h3>4 Configure The Firewall</h3>
<p class="highlight">(You can skip this chapter if you have already disabled the firewall during the basic system installation.)</p>
<p>I want to install ISPConfig at the end of this tutorial which comes with its own firewall. That&#8217;s why I disable the default CentOS firewall now. Of course, you are free to leave it on and configure it to your needs (but then you shouldn&#8217;t use any other firewall later on as it will most probably interfere with the CentOS firewall).</p>
<p>Run</p>
<p class="command">system-config-securitylevel</p>
<p><a href="http://www.howtoforge.com/images/perfect_server_centos_4.6/big/26.png" class="thickbox"><img src="http://howtoforge.com/images/perfect_server_centos_4.6/26.png" height="306" width="550" /><img src="http://howtoforge.com/images/click_to_enlarge.png" alt="Click to enlarge" border="0" height="12" width="100" /></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>Select <span class="system">Disabled</span> and press OK.</p>
<p>To check that the firewall has really been disabled, you can run</p>
<p class="command">iptables -L</p>
<p>afterwards. The output should look like this:</p>
<p class="system">[root@server1 ~]# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
[root@server1 ~]#</p>
<h3>5 Disable SELinux</h3>
<p class="highlight">(You can skip this chapter if you have already disabled SELinux during the basic system installation.)</p>
<p>SELinux is a security extension of CentOS that should provide extended security. In my opinion you don&#8217;t need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn&#8217;t working as expected, and then you find out that everything was ok, only SELinux was causing the problem). Therefore I disable it (this is a must if you want to install ISPConfig later on).</p>
<p>Edit <span class="system">/etc/selinux/config</span> and set <span class="system">SELINUX=disabled</span>:</p>
<p class="command">vi /etc/selinux/config</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre># This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#       enforcing - SELinux security policy is enforced.

#       permissive - SELinux prints warnings instead of enforcing.

#       disabled - SELinux is fully disabled.

SELINUX=disabled

# SELINUXTYPE= type of policy in use. Possible values are:

#       targeted - Only targeted network daemons are protected.

#       strict - Full SELinux protection.

SELINUXTYPE=targeted</pre>
</td>
</tr>
</table>
<p>Afterwards we must reboot the system:</p>
<p class="command">reboot</p>
<h3>6 Install Some Software</h3>
<p>First we     import the GPG keys for software packages:</p>
<p class="command">rpm &#8211;import /usr/share/rhn/RPM-GPG-KEY*</p>
<p>Then we update our existing packages on the system:</p>
<p class="command">yum update</p>
<p>Now we install some software packages that are needed later on:</p>
<p class="command">yum install fetchmail wget bzip2 unzip zip nmap openssl lynx fileutils gcc gcc-c++</p>
<h3>7 Quota</h3>
<p>To install quota, we run this command:</p>
<p class="command">yum install quota</p>
<p>Edit <span class="system">/etc/fstab</span> and add     <span class="system">,usrquota,grpquota</span> to the <span class="system">/</span> partition (<span class="system">/dev/VolGroup00/LogVol00</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># This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/VolGroup00/LogVol00 /                       ext3    defaults,usrquota,grpquota        1 1

LABEL=/boot             /boot                   ext3    defaults        1 2

none                    /dev/pts                devpts  gid=5,mode=620  0 0

none                    /dev/shm                tmpfs   defaults        0 0

none                    /proc                   proc    defaults        0 0

none                    /sys                    sysfs   defaults        0 0

/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

/dev/hdc                /media/cdrecorder       auto    pamconsole,exec,noauto,managed 0 0

/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0</pre>
</td>
</tr>
</table>
<p>Then run</p>
<p class="command">&nbsp;</p>
<p class="command">touch /aquota.user /aquota.group<br />
chmod 600 /aquota.*<br />
mount -o remount /<br />
quotacheck -avugm<br />
quotaon -avug</p>
<p>to enable quota.</p>
<h3>8 Install A Chrooted DNS Server (BIND9)</h3>
<p>To install a chrooted BIND9, we do this:</p>
<p class="command">yum install bind-chroot</p>
<p>Then do this:</p>
<p class="command">chmod 755 /var/named/<br />
chmod 775 /var/named/chroot/<br />
chmod 775 /var/named/chroot/var/<br />
chmod 775 /var/named/chroot/var/named/<br />
chmod 775 /var/named/chroot/var/run/<br />
chmod 777 /var/named/chroot/var/run/named/<br />
cd /var/named/chroot/var/named/<br />
ln -s ../../ chroot<br />
chkconfig &#8211;levels 235 named on<br />
/etc/init.d/named start</p>
<p>BIND will run in a chroot jail under <span class="system">/var/named/chroot/var/named/</span>. I will use ISPConfig to configure BIND (zones, etc.).</p>
<h3>9 MySQL (4.1)</h3>
<p>To install MySQL, we do this:</p>
<p class="command">yum install mysql mysql-devel mysql-server</p>
<p>The MySQL init script on CentOS might cause problems when you try to restart MySQL. In some cases it tries to start MySQL before the old MySQL process has stopped which leads to a failure. The solution is to edit the <span class="system">restart</span> section of <span class="system">/etc/init.d/mysqld</span> and add a few seconds delay between the stop and the start of MySQL.</p>
<p>Edit <span class="system">/etc/init.d/mysqld</span>:</p>
<p class="command">vi /etc/init.d/mysqld</p>
<p>and change this section:</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]

restart(){

    stop

    start

}

[...]</pre>
</td>
</tr>
</table>
<p>so that it looks like this:</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]

restart(){

    stop

    sleep 3

    start

}

[...]</pre>
</td>
</tr>
</table>
<p>This adds a three second delay between the stop and start of MySQL.</p>
<p>Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:</p>
<p class="command">chkconfig &#8211;levels 235 mysqld on<br />
/etc/init.d/mysqld start</p>
<p>Now check that networking is enabled. Run</p>
<p class="command">netstat -tap | grep mysql</p>
<p>It should show something like this:</p>
<p class="system">[root@server1 ~]# netstat -tap | grep mysql<br />
tcp        0      0 *:mysql                     *:*                         LISTEN      3590/mysqld<br />
[root@server1 ~]#</p>
<p>If it does not, edit <span class="system">/etc/my.cnf </span>and comment out the option <span class="system">skip-networking</span>:</p>
<p class="command">vi /etc/my.cnf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]

#skip-networking

[...]</pre>
</td>
</tr>
</table>
<p>and restart your MySQL server:</p>
<p class="command">/etc/init.d/mysqld restart</p>
<p>Run</p>
<p class="command">mysqladmin -u root password yourrootsqlpassword<br />
mysqladmin -h server1.example.com -u root  password yourrootsqlpassword</p>
<p>to set a password for the user <span class="system">root </span> (otherwise anybody can access your MySQL database!).</p>
<h3>10 Postfix With SMTP-AUTH And TLS</h3>
<p>Now we install Postfix and dovecot (dovecot will be our POP3/IMAP server):</p>
<p class="command">yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot</p>
<p>Next we configure SMTP-AUTH and TLS:</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 />
postconf -e &#8216;mynetworks = 127.0.0.0/8&#8242;</p>
<p>We must edit <span class="system">/usr/lib/sasl2/smtpd.conf</span> so that Postfix allows <span class="system">PLAIN</span> and <span class="system">LOGIN</span> logins. On a 64Bit Centos 4.6 you must edit the file  <span class="system">/usr/lib64/sasl2/smtpd.conf</span> instead. It should look like this:</p>
<p class="command">vi /usr/lib/sasl2/smtpd.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>pwcheck_method: saslauthd

mech_list: plain login</pre>
</td>
</tr>
</table>
<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:</p>
<p class="command">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>Then we set the hostname in our Postfix installation (make sure you replace <span class="system">server1.example.com</span> with your own hostname):</p>
<p class="command">postconf -e &#8216;myhostname = server1.example.com&#8217;</p>
<p>After these configuration steps you should now have a <span class="system">/etc/postfix/main.cf</span> that looks like this (I have removed all comments from it):</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>queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/libexec/postfix

mail_owner = postfix

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost

unknown_local_recipient_reject_code = 550

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id &amp; sleep 5sendmail_path = /usr/sbin/sendmail.postfix

newaliases_path = /usr/bin/newaliases.postfix

mailq_path = /usr/bin/mailq.postfix

setgid_group = postdrop

html_directory = no

manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.2.10/samples

readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES

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

mynetworks = 127.0.0.0/8

smtpd_tls_auth_only = no

smtp_use_tls = yes

smtpd_use_tls = yes

smtp_tls_note_starttls_offer = yes

smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key

smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt

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

myhostname = server1.example.com</pre>
</td>
</tr>
</table>
<p>By default, CentOS&#8217; dovecot daemon provides only IMAP and IMAPs services. Because we also want POP3 and POP3s we must configure dovecot to do so. We edit <span class="system">/etc/dovecot.conf</span> and put the line<span class="system"> protocols = imap imaps pop3 pop3s</span> into it:</p>
<p class="command">vi /etc/dovecot.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]

# Base directory where to store runtime data.

#base_dir = /var/run/dovecot/# Protocols we want to be serving:

#  imap imaps pop3 pop3s

protocols = imap imaps pop3 pop3s

[...]</pre>
</td>
</tr>
</table>
<p>Now start Postfix, saslauthd, and dovecot:</p>
<p class="command">chkconfig &#8211;levels 235 sendmail off<br />
chkconfig &#8211;levels 235 postfix on<br />
chkconfig &#8211;levels 235 saslauthd on<br />
chkconfig &#8211;levels 235 dovecot on<br />
/etc/init.d/sendmail stop<br />
/etc/init.d/postfix start<br />
/etc/init.d/saslauthd start<br />
/etc/init.d/dovecot 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 LOGIN PLAIN</p>
<p>everything is fine.</p>
<p class="system">[root@server1 ssl]# telnet localhost 25<br />
Trying 127.0.0.1&#8230;<br />
Connected to localhost.localdomain (127.0.0.1).<br />
Escape character is &#8216;^]&#8217;.<br />
220 server1.example.com ESMTP Postfix<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 LOGIN PLAIN<br />
250-AUTH=LOGIN PLAIN<br />
250 8BITMIME<br />
quit<br />
221 Bye<br />
Connection closed by foreign host.<br />
[root@server1 ssl]#</p>
<p>Type</p>
<p class="command">quit</p>
<p>to return to the system&#8217;s shell.</p>
<h4>10.1 Maildir</h4>
<p>dovecot uses Maildir format (not mbox), so if you install ISPConfig on the server, please make sure you enable Maildir under <span class="system">Management -&gt; Server -&gt; Settings -&gt; Email</span>. ISPConfig will then do the necessary configuration.</p>
<p>If you do not want to install ISPConfig, then you must 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>
<h3>11 Apache2 With PHP</h3>
<p>Now we install Apache with PHP (this is PHP 4.3.9; CentOS does not provide PHP5 packages):</p>
<p class="command">yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel</p>
<p>Then edit <span class="system">/etc/httpd/conf/httpd.conf</span>:</p>
<p class="command">vi /etc/httpd/conf/httpd.conf</p>
<p>and change <span class="system">DirectoryIndex</span> to</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>[...]

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

[...]</pre>
</td>
</tr>
</table>
<p>Now configure your system to start Apache at boot time:</p>
<p class="command">chkconfig &#8211;levels 235 httpd on</p>
<p>Start Apache:</p>
<p class="command">/etc/init.d/httpd start</p>
<h4>11.1 Disable PHP Globally</h4>
<p>(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/httpd/conf.d/php.conf</span> and comment out the <span class="system">AddType </span> line:</p>
<p class="command">vi /etc/httpd/conf.d/php.conf</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>#

# PHP is an HTML-embedded scripting language which attempts to make it

# easy for developers to write dynamically generated webpages.

#LoadModule php4_module modules/libphp4.so

#

# Cause the PHP interpreter to handle files with a .php extension.

#

#AddType application/x-httpd-php .php

# AddType application/x-httpd-php-source .phps

#

# Add index.php to the list of files that will be served as directory

# indexes.

#

DirectoryIndex index.php</pre>
</td>
</tr>
</table>
<p>Afterwards we restart Apache:</p>
<p class="command">/etc/init.d/httpd restart</p>
<h3>12 ProFTPd</h3>
<p>ISPConfig has better support for <span class="system">proftpd </span> than <span class="system">vsftpd</span>, so let&#8217;s remove <span class="system">vsftpd</span>:</p>
<p class="command">yum remove vsftpd</p>
<p>Because CentOS has no <span class="system">proftpd</span> package, we must use a third-party <span class="system">yum</span> repository to install it:</p>
<p class="command">cd /etc/yum.repos.d/<br />
wget http://centos.karan.org/kbsingh-CentOS-Extras.repo<br />
rpm &#8211;import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt</p>
<p>Now we can install <span class="system">proftpd</span>:</p>
<p class="command">yum install proftpd</p>
<p>Let&#8217;s create <span class="system">proftpd</span>&#8216;s system startup links and start it:</p>
<p class="command">chkconfig &#8211;levels 235 proftpd on<br />
/etc/init.d/proftpd start</p>
<p>Then    create the file <span class="system">/etc/pam.d/ftp </span> with the following content (otherwise you will not be able to log in with system users using FTP):</p>
<p class="command">vi /etc/pam.d/ftp</p>
<table align="center" bgcolor="#cccccc" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td>
<pre>#%PAM-1.0

auth    required        pam_unix.so     nullok

account required        pam_unix.so

session required        pam_unix.so</pre>
</td>
</tr>
</table>
<p>and restart <span class="system">proftpd</span>:</p>
<p class="command">/etc/init.d/proftpd restart</p>
<h3>13 Webalizer</h3>
<p>To install webalizer, just run</p>
<p class="command">yum install webalizer</p>
<h3>14 Synchronize The System Clock</h3>
<p>If you want to have the system clock synchronized with an NTP server do the following:</p>
<p class="command">yum install ntp</p>
<p class="command">chkconfig &#8211;levels 235 ntpd on<br />
ntpdate 0.pool.ntp.org<br />
/etc/init.d/ntpd start</p>
<h3>15 Install Some Perl Modules</h3>
<p>ISPConfig comes with SpamAssassin which needs a few Perl modules to work. We install the required Perl modules with a single command:</p>
<p class="command">yum install perl-DBI perl-Net-DNS perl-Digest-SHA1</p>
<p>We also need the module <span class="system">HTML::Parser</span>. We could install the CentOS package <span class="system">perl-HTML-Parser</span>, but this version is too old for the SpamAssassin version that comes with ISPConfig. It would result in the following error message during ISPConfig installation:</p>
<p class="system">REQUIRED module out of date: HTML::Parser</p>
<p>Therefore we must install the latest <span class="system">HTML::Parser</span> using the Perl shell.</p>
<p>Run the following command to start the Perl shell:</p>
<p class="command">perl -MCPAN -e shell</p>
<p>If you run the Perl shell for the first time you will be asked some questions. In most cases the default answers are ok. Because there&#8217;s no <span class="system">ncftp</span> package for CentOS, the Perl shell cannot find the programs <span class="system">ncftpget</span> and <span class="system">ncftp</span>, and you&#8217;ll see something like this:</p>
<p class="system">Warning: ncftpget not found in PATH<br />
Where is your ncftpget program? []<br />
Warning: ncftp not found in PATH<br />
Where is your ncftp program? []</p>
<p>It&#8217;s ok to hit <span class="system">ENTER</span> in both cases.</p>
<p>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.</p>
<p>Now type in the following command to install the Perl module <span class="system">HTML::Parser</span>:</p>
<p class="command">install HTML::Parser</p>
<p>If the installation is successful, you&#8217;ll see a line like this at the end:</p>
<p class="system">/usr/bin/make install &#8212; OK</p>
<p>Type</p>
<p class="command">q</p>
<p>afterwards to leave the Perl shell.</p>
<h3>16 The End</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.</p>
<h4>16.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 CentOS&#8217; suExec is compiled with <span class="system">/var/www </span> as <span class="system">Doc_Root</span>. Run</p>
<p class="command">/usr/sbin/suexec -V</p>
<p>and the output should look like this:</p>
<p class="system">[root@server1 ~]# /usr/sbin/suexec -V<br />
-D AP_DOC_ROOT=&#8221;/var/www&#8221;<br />
-D AP_GID_MIN=100<br />
-D AP_HTTPD_USER=&#8221;apache&#8221;<br />
-D AP_LOG_EXEC=&#8221;/var/log/httpd/suexec.log&#8221;<br />
-D AP_SAFE_PATH=&#8221;/usr/local/bin:/usr/bin:/bin&#8221;<br />
-D AP_UID_MIN=500<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>
<h3>17 Links</h3>
<ul>
<li>CentOS: <a href="http://www.centos.org/" target="_blank">http://www.centos.org</a></li>
<li>ISPConfig: <a href="http://www.ispconfig.org/" target="_blank">http://www.ispconfig.org</a></li>
</ul>
<p><a href="http://leadingvoices.lipscomb.edu/membership/8492/">other</a><br />
<a href="http://www.businesssolutions.msu.edu/index.php/member/49820/">click here</a><br />
<a href="http://students.law.umich.edu/mjil/index.php/member/31484/">click here</a><br />
<a href="http://pahma.berkeley.edu/delphi/modules/auth/profile.php?uid=4230">clicky</a><br />
<a href="http://web.cfa.arizona.edu/drumline/phpBB2/profile.php?mode=viewprofile&#038;u=1715">other</a><br />
<a href="http://docking.cis.udel.edu/community/show_user.php?userid=50606">other</a><br />
<a href="http://ogb.wfu.edu/07/index.php?/member/7429/">other</a><br />
<a href="http://gd.risd.edu/www/member/91743/">friendly link</a><br />
<a href="http://opentopo.sdsc.edu/jforum-2.1.7-b3/user/profile/6128.page">friendly link</a><br />
<a href="http://www.ncv.unsw.edu.au/index.php/member/26983/">read more</a><br />
<a href="http://www.sfx.act.edu.au/index.php/member/27677/">read more</a><br />
<a href="http://www.skidmore.edu/academics/art/member/12024/">friendly link</a><br />
<a href="http://www.herkimer.edu/member/1686/">clicky</a><br />
<a href="http://knight.miami.edu/index.php/member/103638/">click here</a><br />
<a href="http://interactiondesign.sva.edu/member/81233/">friendly link</a></p>
<div style='clear:both'></div>
]]></content:encoded>
			<wfw:commentRss>http://linewbie.com/2008/01/perfect-server-series-centos-46-server-setup-lamp-email-dns-ftp-ispconfig.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

