<?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>Debian Tutorials &#187; lenny</title>
	<atom:link href="http://www.debiantutorials.com/tag/lenny/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian based Linux distros</description>
	<lastBuildDate>Tue, 27 Dec 2011 01:15:56 +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 LAMP (Apache, PHP and MySql in Linux)</title>
		<link>http://www.debiantutorials.com/how-to-install-lamp-apache-php-and-mysql-in-linux/</link>
		<comments>http://www.debiantutorials.com/how-to-install-lamp-apache-php-and-mysql-in-linux/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 15:20:39 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Etch]]></category>
		<category><![CDATA[Jaunty Jackalope]]></category>
		<category><![CDATA[Karmic Koala]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=393</guid>
		<description><![CDATA[Here's a basic guide on how to get Apache2, PHP5 and MySql working on most Debian based distros in a few easy steps. 1. Install Apache2 and PHP5 (as an Apache module) apt-get install apache2 php5 libapache2-mod-php5 php5-mysql 2. Install MySql server apt-get install mysql-server 3. At this point you may need to restart Apache [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2011/08/lamp.jpg" alt="Trac" align="right" style="margin-left:10px" /><br />
Here's a basic guide on how to get Apache2, PHP5 and MySql working on most Debian based distros in a few easy steps.</p>
<p>1. Install Apache2 and PHP5 (as an Apache module)</p>
<p><code>apt-get install apache2 php5 libapache2-mod-php5 php5-mysql<br />
</code><span id="more-393"></span></p>
<p>2. Install MySql server</p>
<p><code>apt-get install mysql-server<br />
</code></p>
<p>3. At this point you may need to restart Apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
<p>3. Create a test php file</p>
<p><code>echo "&lt;?php phpinfo(); ?&gt;" > /var/www/info.php<br />
</code></p>
<p><em>The default document root for Debian is in /var/www so you can access the test file on this location: http://yourserver/info.php</em></p>
<p>3. Install phpMyAdmin (optional but preferred by most developers and administrators)</p>
<p><code>apt-get install phpmyadmin<br />
</code></p>
<p><em>By default, phpmyadmin will be accessible on: http://yourserver/phpmyadmin</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/how-to-install-lamp-apache-php-and-mysql-in-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing eAccelerator</title>
		<link>http://www.debiantutorials.com/installing-eaccelerator/</link>
		<comments>http://www.debiantutorials.com/installing-eaccelerator/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 11:09:48 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=375</guid>
		<description><![CDATA[eAccelerator is a free open-source PHP accelerator &#038; optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code [...]]]></description>
			<content:encoded><![CDATA[<p>eAccelerator is a free open-source PHP accelerator &#038; optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.</p>
<p>eAccelerator only works with mod_php or php in fastcgi mode. It can't be used in cgi or cli because eAccelerator needs to set up shared memory, and this can only be done when all php instances that need to access it are forks of the first process.</p>
<p>1. Download the eAccelerator source. The latest version is mirrored on www.debiantutorials.com as it's not available on the official site anymore.</p>
<p><code>cd /tmp<br />
wget http://www.debiantutorials.com/static/eaccelerator-0.9.6.1.tar.bz2<br />
</code><span id="more-375"></span></p>
<p>2. Extract</p>
<p><code>tar -xvjf eaccelerator-0.9.6.1.tar.bz2<br />
</code></p>
<p>3. Install php5-dev</p>
<p><code>apt-get install php5-dev<br />
</code></p>
<p>3. Compile and install the eAccelerator</p>
<p><code>phpize<br />
./configure<br />
make<br />
make install<br />
</code></p>
<p>4. Configure eAccelerator as PHP extension (create a new config file: pico /etc/php5/conf.d/eaccelerator.ini)</p>
<p><code>extension="eaccelerator.so"<br />
eaccelerator.shm_size="16"<br />
eaccelerator.cache_dir="/var/cache/eaccelerator"<br />
eaccelerator.enable="1"<br />
eaccelerator.optimizer="1"<br />
eaccelerator.check_mtime="1"<br />
eaccelerator.debug="0"<br />
eaccelerator.filter=""<br />
eaccelerator.shm_max="0"<br />
eaccelerator.shm_ttl="0"<br />
eaccelerator.shm_prune_period="0"<br />
eaccelerator.shm_only="0"<br />
eaccelerator.compress="1"<br />
eaccelerator.compress_level="9"<br />
</code></p>
<p>5. Create a cache directory</p>
<p><code>mkdir -p /var/cache/eaccelerator<br />
chmod 0777 /var/cache/eaccelerator<br />
</code></p>
<p>5. Restart apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-eaccelerator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrade from lenny to squeeze</title>
		<link>http://www.debiantutorials.com/upgrade-from-lenny-to-squeeze/</link>
		<comments>http://www.debiantutorials.com/upgrade-from-lenny-to-squeeze/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 10:30:22 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=364</guid>
		<description><![CDATA[Debian has released a stable version of Debian 6.0 (squeeze). If you're running previous version of Debian, you can easily upgrade. 1. Update all packages currently installed to the latest lenny versions apt-get update apt-get upgrade 2. Replace all occurrences of lenny with squeeze in the apt sources file (pico /etc/apt/sources.list). Here's an example of [...]]]></description>
			<content:encoded><![CDATA[<p>Debian has released a stable version of Debian 6.0 (squeeze). If you're running previous version of Debian, you can easily upgrade.</p>
<p>1. Update all packages currently installed to the latest lenny versions</p>
<p><code>apt-get update<br />
apt-get upgrade<br />
</code><span id="more-364"></span></p>
<p>2. Replace all occurrences of lenny with squeeze in the apt sources file (pico /etc/apt/sources.list). Here's an example of what the file could look like after the change:</p>
<p><code>deb http://ftp.uk.debian.org/debian/ squeeze main non-free<br />
deb-src http://ftp.uk.debian.org/debian/ squeeze main non-free<br />
deb http://security.debian.org/ squeeze/updates main contrib<br />
deb-src http://security.debian.org/ squeeze/updates main contrib<br />
</code></p>
<p>3. Update apt repository</p>
<p><code>apt-get update<br />
</code></p>
<p>4. Upgrade apt, dpkg and aptitude packages first</p>
<p><code>apt-get install apt dpkg aptitude<br />
</code></p>
<p>5. Do a dist-upgrade to upgrade the rest of the system</p>
<p><code>apt-get dist-upgrade<br />
</code></p>
<p>6. Reboot</p>
<p><code>reboot<br />
</code></p>
<p>7. Check the debian version</p>
<p><code>cat /etc/debian_version<br />
</code></p>
<p>It should read version 6.0.0 or greater</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/upgrade-from-lenny-to-squeeze/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to upgrade to PHP 5.3 on Debian Lenny</title>
		<link>http://www.debiantutorials.com/how-to-install-upgrade-to-php-5-3-on-debian-lenny/</link>
		<comments>http://www.debiantutorials.com/how-to-install-upgrade-to-php-5-3-on-debian-lenny/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 20:55:00 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=361</guid>
		<description><![CDATA[Dotdeb provides a repository with PHP 5.3 for lenny and it's easy to upgrade: 1. Add these lines to the apt sources (pico /etc/apt/sources.list) deb http://php53.dotdeb.org stable all deb-src http://php53.dotdeb.org stable all 2. Download and import the dotdeb key wget http://www.dotdeb.org/dotdeb.gpg cat dotdeb.gpg &#124; sudo apt-key add - 3. Update apt and dist-upgrade apt-get update [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dotdeb.org/">Dotdeb</a> provides a repository with PHP 5.3 for lenny and it's easy to upgrade:</p>
<p>1. Add these lines to the apt sources (pico /etc/apt/sources.list)</p>
<p><code>deb http://php53.dotdeb.org stable all<br />
deb-src http://php53.dotdeb.org stable all<br />
</code><span id="more-361"></span></p>
<p>2. Download and import the dotdeb key</p>
<p><code>wget http://www.dotdeb.org/dotdeb.gpg<br />
cat dotdeb.gpg | sudo apt-key add -<br />
</code></p>
<p>3. Update apt and dist-upgrade</p>
<p><code>apt-get update<br />
apt-get dist-upgrade<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/how-to-install-upgrade-to-php-5-3-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Install XCache</title>
		<link>http://www.debiantutorials.com/install-xcache/</link>
		<comments>http://www.debiantutorials.com/install-xcache/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 23:08:53 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xcache]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=233</guid>
		<description><![CDATA[XCache is a fast, stable PHP opcode cacher that has been tested and is now running on production servers under high load. It overcomes a lot of problems that has been with other competing opcachers such as being able to be used with new PHP versions. 1. Installing the XCache package apt-get install php5-xcache 2. [...]]]></description>
			<content:encoded><![CDATA[<p>XCache is a fast, stable  PHP opcode cacher that has been tested and is now running on production servers under high load. It overcomes a lot of problems that has been with other competing opcachers such as being able to be used with new PHP versions.</p>
<p>1. Installing the XCache package</p>
<p><code>apt-get install php5-xcache<br />
</code><span id="more-233"></span></p>
<p>2. Restart Apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
<p>That's it. XCache is now installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/install-xcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Dovecot IMAP and POP daemon with MySql backend</title>
		<link>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/</link>
		<comments>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:06:03 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[pop3]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=197</guid>
		<description><![CDATA[Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written primarily with security in mind. Dovecot primarily aims to be a lightweight, fast and easy to set up open source mailserver. It's assumed that you have already installed and configured Postfix according to this tutorial: Installing Postfix with MySql backend and SASL [...]]]></description>
			<content:encoded><![CDATA[<p>Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written primarily with security in mind. Dovecot primarily aims to be a lightweight, fast and easy to set up open source mailserver.</p>
<p>It's assumed that you have already installed and configured Postfix according to this tutorial:<br />
<a href="http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/">Installing Postfix with MySql backend and SASL for SMTP authentication</a></p>
<p>1. Install required packages</p>
<p><code>apt-get install dovecot-imapd dovecot-pop3d<br />
</code><span id="more-197"></span></p>
<p>2. Configure Dovecot (pico /etc/dovecot/dovecot.conf)</p>
<p><code>protocols = imap imaps pop3 pop3s<br />
ssl_disable = no<br />
mail_location = maildir:/home/vmail/%d/%n<br />
auth default {<br />
	passdb sql {<br />
	  args = /etc/dovecot/dovecot-sql.conf<br />
	}<br />
	userdb sql {<br />
	  args = /etc/dovecot/dovecot-sql.conf<br />
	}<br />
}<br />
disable_plaintext_auth = no<br />
user = vmail<br />
</code></p>
<p><em>Add or edit the above properties and leave everything else with the default value or configure according to your needs</em></p>
<p>3. Configure the MySql connector (pico /etc/dovecot/dovecot-sql.conf)</p>
<p><code>driver = mysql<br />
connect = host=127.0.0.1 dbname={database} user={username} password={password}<br />
default_pass_scheme = CRYPT<br />
password_query = SELECT email as user, password FROM users WHERE email = '%u'<br />
user_query = SELECT CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') as home, '5000' as uid, '5000' as gid FROM users WHERE email = '%u'<br />
</code></p>
<p><em>{database} = MySql database name<br />
{username} = MySql username<br />
{password} = MySql password</em></p>
<p>4. Restart Dovecot daemon</p>
<p><code>/etc/init.d/dovecot restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing Courier POP3 and IMAP daemon with MySql backend</title>
		<link>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/</link>
		<comments>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 11:02:31 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[courier]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[pop3]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=191</guid>
		<description><![CDATA[The Courier mail transfer agent (MTA) is an integrated mail/groupware server based on open commodity protocols, such as ESMTP, IMAP, POP3, LDAP, SSL, and HTTP. Courier provides ESMTP, IMAP, POP3, webmail, and mailing list services within a single, consistent, framework. In this tutorial we'll only use the Courier POP3 and IMAP services. It's assumed that [...]]]></description>
			<content:encoded><![CDATA[<p>The Courier mail transfer agent (MTA) is an integrated mail/groupware server based on open commodity protocols, such as ESMTP, IMAP, POP3, LDAP, SSL, and HTTP. Courier provides ESMTP, IMAP, POP3, webmail, and mailing list services within a single, consistent, framework. In this tutorial we'll only use the Courier POP3 and IMAP services.</p>
<p>It's assumed that you have already installed and configured Postfix according to this tutorial: <a href="http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/">Installing Postfix with MySql backend and SASL for SMTP authentication</a></p>
<p>1. Install required packages</p>
<p><code>apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl<br />
</code><span id="more-191"></span></p>
<p>2. Make Courier use MySql backend (pico /etc/courier/authdaemonrc)</p>
<p><code>authmodulelist="authmysql"<br />
</code></p>
<p>3. Configure the MySql connector (pico /etc/courier/authmysqlrc)</p>
<p><code>MYSQL_SERVER 127.0.0.1<br />
MYSQL_USERNAME {username}<br />
MYSQL_PASSWORD {password}<br />
MYSQL_PORT 0<br />
MYSQL_DATABASE {database}<br />
MYSQL_USER_TABLE users<br />
MYSQL_CRYPT_PWFIELD password<br />
MYSQL_UID_FIELD 5000<br />
MYSQL_GID_FIELD 5000<br />
MYSQL_LOGIN_FIELD email<br />
MYSQL_HOME_FIELD "/home/vmail"<br />
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')<br />
MYSQL_QUOTA_FIELD quota<br />
</code></p>
<p><em>{database} = MySql database name<br />
MySql username<br />
MySql password</em></p>
<p>4. Restart Courier daemons</p>
<p><code>/etc/init.d/courier-authdaemon restart<br />
/etc/init.d/courier-imap restart<br />
/etc/init.d/courier-imap-ssl restart<br />
/etc/init.d/courier-pop restart<br />
/etc/init.d/courier-pop-ssl restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Postfix with MySql backend and SASL for SMTP authentication</title>
		<link>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/</link>
		<comments>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 10:45:13 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[tls]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=186</guid>
		<description><![CDATA[Postfix is a free and open source mail transfer agent (MTA). It is intended as a fast, easy-to-administer, and secure alternative to the widely-used Sendmail MTA. Install and configure Postfix 1. Install Postfix and SASL apt-get install postfix postfix-mysql libsasl2-modules-sql sasl2-bin libsasl2-2 postfix-tls libpam-mysql > Internet Site > host.domain.com 2. Create database and tables (mysql [...]]]></description>
			<content:encoded><![CDATA[<p>Postfix is a free and open source mail transfer agent (MTA). It is intended as a fast, easy-to-administer, and secure alternative to the widely-used Sendmail MTA.</p>
<p><strong>Install and configure Postfix</strong></p>
<p>1. Install Postfix and SASL</p>
<p><code>apt-get install postfix postfix-mysql libsasl2-modules-sql sasl2-bin libsasl2-2 postfix-tls libpam-mysql<br />
> Internet Site<br />
> host.domain.com<br />
</code><span id="more-186"></span></p>
<p>2. Create database and tables (mysql -u root -p)</p>
<p><code># Create the database<br />
CREATE DATABASE mail;<br />
&nbsp;<br />
# Create user and allow him to read from the mail database<br />
GRANT SELECT ON mail.* TO '{username}'@'localhost' IDENTIFIED BY '{password}';<br />
FLUSH PRIVILEGES;<br />
&nbsp;<br />
# Select the mail database<br />
USE mail;<br />
&nbsp;<br />
# Create table containing domains handled by this mail server<br />
CREATE TABLE domains (<br />
	domain varchar(255) NOT NULL,<br />
	PRIMARY KEY (domain)<br />
) TYPE=MyISAM;<br />
&nbsp;<br />
# Create table for e-mail address forwardings<br />
CREATE TABLE forwardings (<br />
	source varchar(255) NOT NULL,<br />
	destination varchar(255) NOT NULL,<br />
	PRIMARY KEY (source)<br />
) TYPE=MyISAM;<br />
&nbsp;<br />
# Create table for e-mail accounts / users<br />
CREATE TABLE users (<br />
	email varchar(255) NOT NULL,<br />
	password varchar(255) NOT NULL,<br />
	quota int(10) DEFAULT '104857600',<br />
	PRIMARY KEY (email)<br />
) TYPE=MyISAM;<br />
&nbsp;<br />
# Create table for transports<br />
CREATE TABLE transport (<br />
	domain varchar(255) NOT NULL,<br />
	transport varchar(255) NOT NULL,<br />
	UNIQUE KEY domain (domain)<br />
) TYPE=MyISAM;<br />
</code></p>
<p><em>{username} = A new MySql user used by Postfix to access the MySql data<br />
{password} = A password for the new MySql user</em></p>
<p>3. Create Postfix to MySql mappings</p>
<p>Domains (pico /etc/postfix/mysql-virtual_domains.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = domains<br />
select_field = 'virtual'<br />
where_field = domain<br />
hosts = 127.0.0.1<br />
</code></p>
<p>Forwards (pico /etc/postfix/mysql-virtual_forwardings.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = forwardings<br />
select_field = destination<br />
where_field = source<br />
hosts = 127.0.0.1<br />
</code></p>
<p>Mailboxes / Users (pico /etc/postfix/mysql-virtual_mailboxes.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = users<br />
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')<br />
where_field = email<br />
hosts = 127.0.0.1<br />
</code></p>
<p>E-mail to E-mail (pico /etc/postfix/mysql-virtual_email2email.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = users<br />
select_field = email<br />
where_field = email<br />
hosts = 127.0.0.1<br />
</code></p>
<p>Transports (pico /etc/postfix/mysql-virtual_transports.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = transport<br />
select_field = transport<br />
where_field = domain<br />
hosts = 127.0.0.1<br />
</code></p>
<p>Quota (pico /etc/postfix/mysql-virtual_mailbox_limit_maps.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = users<br />
select_field = quota<br />
where_field = email<br />
hosts = 127.0.0.1<br />
</code></p>
<p>Destinations (pico /etc/postfix/mysql-mydestination.cf)</p>
<p><code>user = {username}<br />
password = {password}<br />
dbname = mail<br />
table = transport<br />
select_field = domain<br />
where_field = domain<br />
hosts = 127.0.0.1<br />
</code></p>
<p><em>{username} = The username you selected for the new MySql user<br />
{password} = The password you selected for the new MySql user</em></p>
<p>4. Change permissions on the new files</p>
<p><code>chmod 640 /etc/postfix/mysql-*.cf<br />
chgrp postfix /etc/postfix/mysql-*.cf<br />
</code></p>
<p><em>Make sure they aren't readable by any user because the password is included</em></p>
<p>5. Create a local user and group for the virtual users</p>
<p><code>groupadd -g 5000 vmail<br />
useradd -g vmail -u 5000 vmail -d /home/vmail -m<br />
</code></p>
<p>6. Create certificates for TLS</p>
<p><code>openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509<br />
chmod 640 /etc/postfix/smtpd.key<br />
</code></p>
<p>7. Configure Postfix</p>
<p><code>postconf -e 'mydestination = localhost, proxy:mysql:/etc/postfix/mysql-mydestination.cf'<br />
postconf -e 'virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf'<br />
postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf'<br />
postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf'<br />
postconf -e 'virtual_mailbox_base = /home/vmail'<br />
postconf -e 'virtual_uid_maps = static:5000'<br />
postconf -e 'virtual_gid_maps = static:5000'<br />
postconf -e 'smtpd_sasl_auth_enable = yes'<br />
postconf -e 'smtpd_helo_required = yes'<br />
postconf -e 'broken_sasl_auth_clients = yes'<br />
postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'<br />
postconf -e 'smtpd_use_tls = yes'<br />
postconf -e 'smtpd_tls_cert_file = /etc/postfix/smtpd.cert'<br />
postconf -e 'smtpd_tls_key_file = /etc/postfix/smtpd.key'<br />
postconf -e 'strict_rfc821_envelopes = yes'<br />
postconf -e 'disable_vrfy_command = yes'<br />
postconf -e 'transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf'<br />
postconf -e 'virtual_create_maildirsize = yes'<br />
postconf -e 'virtual_mailbox_extended = yes'<br />
postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf'<br />
postconf -e 'virtual_mailbox_limit_override = yes'<br />
postconf -e 'virtual_maildir_limit_message = "Account is over quota"'<br />
postconf -e 'virtual_overquota_bounce = yes'<br />
postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps    $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'<br />
</code></p>
<p>8. Enable secure ports: 465 and 587 (pico /etc/postfix/master.cf)</p>
<p><code>smtps     inet  n       -       -       -       -       smtpd<br />
  -o smtpd_tls_wrappermode=yes<br />
  -o smtpd_sasl_auth_enable=yes<br />
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject<br />
  -o milter_macro_daemon_name=ORIGINATING<br />
&nbsp;<br />
587      inet  n       -       -       -       -       smtpd<br />
</code></p>
<p><strong>Configure SASL for SMTP authentication</strong></p>
<p>9. Add the postfix user to the sasl group</p>
<p><code>adduser postfix sasl<br />
</code></p>
<p>10. Create a folder for the SASL PID file</p>
<p><code>mkdir -p /var/spool/postfix/var/run/saslauthd<br />
</code></p>
<p>11. Enable SASL (pico /etc/default/saslauthd)</p>
<p><code>START=yes<br />
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"<br />
</code></p>
<p>12. Configure SASL to use the new PID file location (pico /etc/init.d/saslauthd)</p>
<p><code>PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"<br />
</code></p>
<p><em>Make sure you replace all PIDFILE definations in the file. This is set on a few places.</em></p>
<p>13. Configure PAM to use MySql backend for authentication (pico /etc/pam.d/smtp)</p>
<p><code>auth    required   pam_mysql.so user={username} passwd={password} host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1<br />
account sufficient pam_mysql.so user={username} passwd={password} host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1<br />
</code></p>
<p><em>{username} = The username you selected for the new MySql user<br />
{password} = The password you selected for the new MySql user</em></p>
<p>14. Configure Postfix to use SASl for SMTP authentication (pico /etc/postfix/sasl/smtpd.conf)</p>
<p><code>pwcheck_method: saslauthd<br />
mech_list: plain login<br />
allow_plaintext: true<br />
auxprop_plugin: mysql<br />
sql_hostnames: 127.0.0.1<br />
sql_user: {username}<br />
sql_passwd: {password}<br />
sql_database: mail<br />
sql_select: select password from users where email = '%u'<br />
</code></p>
<p><em>{username} = The username you selected for the new MySql user<br />
{password} = The password you selected for the new MySql user</em></p>
<p>15. Restart Postfix and SASL</p>
<p><code>/etc/init.d/saslauthd restart<br />
/etc/init.d/postfix restart<br />
</code></p>
<p><strong>Test MySql data</strong></p>
<p>1. Handle mail for a domain. This must be done if you will create mailboxes or forwards handled on this server.</p>
<p><code>INSERT INTO domains VALUES ('domain.com');<br />
</code></p>
<p>2. Create user/mailbox. Users will be able to receive mail and send mails using this server</p>
<p><code>INSERT INTO users VALUES ('user@domain.com', ENCRYPT('password'), 104857600);<br />
</code></p>
<p>3. Create forward. A e-mail address used to forward to another e-mail address or multiple e-mail addresses</p>
<p><code>INSERT INTO forwardings VALUES ('user2@domain.com', 'user@domain.com');<br />
</code></p>
<p>Forward to multiple e-mail addresses using a comma to seperate</p>
<p><code>INSERT INTO forwardings VALUES ('user3@domain.com', 'user@domain.com,user@gmail.com');<br />
</code></p>
<p>4. Forward all mails for a domain to another mail server</p>
<p><code>INSERT INTO transport VALUES ('domain.com', 'smtp:server2.domain.com');<br />
</code></p>
<p>Next step is to set up services to support POP3 and IMAP:<br />
<a href="http://www.debiantutorials.net/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/">Installing Courier POP3 and IMAP daemon with MySql backend / Install Courier</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Automated backups to FTP server using rsync and curlftpfs</title>
		<link>http://www.debiantutorials.com/automated-backups-to-ftp-server-using-rsync-and-curlftpfs/</link>
		<comments>http://www.debiantutorials.com/automated-backups-to-ftp-server-using-rsync-and-curlftpfs/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 16:45:26 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[curlftpfs]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=135</guid>
		<description><![CDATA[Using curlftpfs and FUSE, a ftp site is mapped to the local file system and rsync will backup files to the ftp server automatically. 1. Install required packages apt-get install curlftpfs rsync 2. Create directory to mount the ftp site mkdir /mnt/ftpbackup 3. Add the curlftpfs mount into fstab to make it mount everytime the [...]]]></description>
			<content:encoded><![CDATA[<p>Using curlftpfs and FUSE, a ftp site is mapped to the local file system and rsync will backup files to the ftp server automatically.</p>
<p>1. Install required packages</p>
<p><code>apt-get install curlftpfs rsync<br />
</code><span id="more-135"></span></p>
<p>2. Create directory to mount the ftp site</p>
<p><code>mkdir /mnt/ftpbackup<br />
</code></p>
<p>3. Add the curlftpfs mount into fstab to make it mount everytime the system is started (pico /etc/fstab)</p>
<p><code>curlftpfs#{username}:{password}@{host} /mnt/ftpbackup fuse rw,allow_other,uid={userid}      0       0<br />
</code></p>
<p><em>{username} = FTP username<br />
{password} = FTP password<br />
{host} = FTP host/ip<br />
{userid} = ID of a local user (ex. 1001)<br />
</em></p>
<p>4. Mount the ftp site</p>
<p><code>mount /mnt/ftpbackup<br />
</code></p>
<p>5. Backup using rsync</p>
<p><code>rsync -avz --no-owner --no-group /var/www /mnt/ftpbackup<br />
</code></p>
<p><em>All files in the /var/www folder will be synced to the remote machine into a folder named backup</em></p>
<p>6. Automate the backup using cron (crontab -e)</p>
<p><code>0 3 * * * rsync -az --no-owner --no-group /var/www /mnt/ftpbackup >> /dev/null 2>&#038;1<br />
</code></p>
<p><em>Your /var/www will be synced to the remote machine at 3am every day</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/automated-backups-to-ftp-server-using-rsync-and-curlftpfs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Securing unencrypted traffic with stunnel</title>
		<link>http://www.debiantutorials.com/securing-unencrypted-traffic-with-stunnel/</link>
		<comments>http://www.debiantutorials.com/securing-unencrypted-traffic-with-stunnel/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:54:44 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[stunnel]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=130</guid>
		<description><![CDATA[Stunnel can be used to provide secure encrypted connections for clients or servers that do not speak TLS or SSL natively. In this tutorial we'll secure Samba connection but you could use this for other services like SMTP, IMAP, POP3 etc. If you are securing a service where the client supports encrypting like SMTP, IMAP [...]]]></description>
			<content:encoded><![CDATA[<p>Stunnel can be used to provide secure encrypted connections for clients or servers that do not speak TLS or SSL natively. In this tutorial we'll secure Samba connection but you could use this for other services like SMTP, IMAP, POP3 etc.</p>
<p>If you are securing a service where the client supports encrypting like SMTP, IMAP and POP3 you can skip the client step.</p>
<p><strong>Server</strong></p>
<p>1. Install stunnel</p>
<p><code>apt-get install stunnel<br />
</code><span id="more-130"></span></p>
<p>2. Configure Samba to only listen on localhost only (pico /etc/samba/smb.conf)</p>
<p><code>interfaces = 127.0.0.0/8<br />
bind interfaces only = yes<br />
</code></p>
<p>3. Restart Samba</p>
<p><code>/etc/init.d/samba restart<br />
</code></p>
<p>4. Create SSL certificate and a key</p>
<p><code>openssl req -new -nodes -x509 -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem<br />
</code></p>
<p>5. Configure stunnel to listen for secure connections on port 8139 and forward to port 139 on localhost (pico /etc/stunnel/stunnel.conf)</p>
<p><code>cert = /etc/stunnel/stunnel.pem<br />
&nbsp;<br />
[smb]<br />
accept  = 8139<br />
connect = 139<br />
</code></p>
<p>6. Enable stunnel (pico /etc/default/stunnel4)</p>
<p><code>ENABLED=1<br />
</code></p>
<p>7. Start stunnel</p>
<p><code>/etc/init.d/stunnel4 restart<br />
</code></p>
<p><strong>Client</strong></p>
<p>1. Install stunnel and smbclient</p>
<p><code>apt-get install smbclient stunnel<br />
</code></p>
<p>2. Configure stunnel to listen for connections on localhost:139 and forward to the server on port 8139 using a secure connection (pico /etc/stunnel/stunnel.conf)</p>
<p><code>client = yes<br />
&nbsp;<br />
[smb]<br />
accept  = localhost:139<br />
connect = {ip}:8139<br />
</code></p>
<p><em>Replace {ip} with the IP address of your server previously configured</em></p>
<p>3. Enable stunnel (pico /etc/default/stunnel4)</p>
<p><code>ENABLED=1<br />
</code></p>
<p>4. Start stunnel</p>
<p><code>/etc/init.d/stunnel4 restart<br />
</code></p>
<p>5. Test the connection using smbclient</p>
<p><code>smbclient -U user1 //localhost/sambashare<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/securing-unencrypted-traffic-with-stunnel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
