<?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 Linux</description>
	<lastBuildDate>Wed, 18 Aug 2010 00:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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. Restart Apache
/etc/init.d/apache2 [...]]]></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 for SMTP [...]]]></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 you [...]]]></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[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 -u root -p)
# Create the database
CREATE [...]]]></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. Create a folder for the SASL PID file</p>
<p><code>mkdir -p /var/spool/postfix/var/run/saslauthd<br />
</code></p>
<p>10. 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>11. 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>12. 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>13. 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>14. 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>4</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 system is started (pico /etc/fstab)
curlftpfs#{username}:{password}@{host} [...]]]></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>0</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 and [...]]]></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>
		<item>
		<title>Installing and configuring Samba</title>
		<link>http://www.debiantutorials.com/installing-and-configuring-samba/</link>
		<comments>http://www.debiantutorials.com/installing-and-configuring-samba/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 22:43:07 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=127</guid>
		<description><![CDATA[Samba is a free software re-implementation of SMB/CIFS networking protocol providing file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part of an Active Directory domain.
1. Install the base packages
apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>Samba is a free software re-implementation of SMB/CIFS networking protocol providing file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part of an Active Directory domain.</p>
<p>1. Install the base packages</p>
<p><code>apt-get install samba<br />
> WORKGROUP (Type the workgroup you would like to use here)<br />
> No<br />
</code><span id="more-127"></span></p>
<p>2. Create a directory to share (optional)</p>
<p><code>mkdir /var/sambashare<br />
</code></p>
<p><em>Replace the directory with the actual one you would like to share or skip this step if it's already available</em></p>
<p>3. Create a user, map the new user in the samba password database and grant access to the directory</p>
<p><code>useradd user1<br />
smbpasswd -a user1<br />
chown user1 /var/sambashare<br />
</code></p>
<p>4. Configure samba (pico /etc/samba/smb.conf)</p>
<p><code>[sambashare]<br />
path = /var/sambashare<br />
browseable = yes<br />
writeable = yes<br />
valid users = user1<br />
</code></p>
<p><em>Add these lines to the end of your Samba configuration file</em></p>
<p>5. Restart the samba daemon</p>
<p><code>/etc/init.d/samba restart<br />
</code></p>
<p>6. Now you can access your share from Windows by typing: \\ipaddress\sambashare. Use the username and password defined in step 3 when prompted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-and-configuring-samba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySql database replication (master/slave)</title>
		<link>http://www.debiantutorials.com/mysql-database-replication-masterslave/</link>
		<comments>http://www.debiantutorials.com/mysql-database-replication-masterslave/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 23:14:27 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=125</guid>
		<description><![CDATA[In this tutorial we'll create a simple one-way master/slave database replication. You must have at least one master and one slave but you can use multiple slaves.
Master
1. Configure master to listen on all ip addresses (pico /etc/mysql/my.cnf)
#bind-address            = 127.0.0.1

Comment out this line or remove [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we'll create a simple one-way master/slave database replication. You must have at least one master and one slave but you can use multiple slaves.</p>
<p><strong>Master</strong></p>
<p>1. Configure master to listen on all ip addresses (pico /etc/mysql/my.cnf)</p>
<p><code>#bind-address            = 127.0.0.1<br />
</code><span id="more-125"></span></p>
<p><em>Comment out this line or remove it</em></p>
<p>2. Configure server id, log file location and which databases are allowed to be replicated (pico /etc/mysql/my.cnf)</p>
<p><code>server-id               = 1<br />
log_bin                 = /var/log/mysql/mysql-bin.log<br />
binlog_do_db            = {database}<br />
</code></p>
<p><em>Replace {database} with the one you would like to replicate</em></p>
<p>3. Restart MySql</p>
<p><code>/etc/init.d/mysql restart<br />
</code></p>
<p>4. Create a user and allow it to act as slave for this server (mysql -u root -p)</p>
<p><code>GRANT REPLICATION SLAVE ON *.* TO {username}@'{ip}' IDENTIFIED BY '{password}';<br />
FLUSH PRIVILEGES;<br />
</code></p>
<p><em>{username} = Your preferred username<br />
{password} = Your password<br />
{ip} = IP address of the slave system or % to allow all ip addresses</em></p>
<p>5. Show current log file and position (mysql -u root -p)</p>
<p><code>SHOW MASTER STATUS;<br />
</code></p>
<p>This will return something like this:</p>
<p><code>+------------------+----------+--------------+------------------+<br />
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+------------------+----------+--------------+------------------+<br />
| mysql-bin.000004 |     2751 | {database}   |                  |<br />
+------------------+----------+--------------+------------------+<br />
</code></p>
<p><em>Keep the file name and position. It will be used later on the slave</em></p>
<p>6. Transfer data from the master to the slave</p>
<p>You can do this using various methods including exporting and importing using phpMyAdmin, creating a database dump from the master and import to the slave and "LOAD DATA FROM MASTER".</p>
<p><strong>Slave</strong></p>
<p>1. Configure this server to be a slave for the master MySql server (pico /etc/mysql/my.cnf)</p>
<p><code>server-id               = 2<br />
master-host             = {master_ip}<br />
master-user             = {username}<br />
master-password         = {password}<br />
master-connect-retry    = 60<br />
replicate-do-db         = {database}<br />
</code></p>
<p><em>{master_ip} = The ip of the master server<br />
{username} = The username you provided earlier on the master server<br />
{password} = The password you provided earlier on the master server<br />
{database} = The database you want to replicate</em></p>
<p>2. Restart MySql</p>
<p><code>/etc/init.d/mysql restart<br />
</code></p>
<p>3. Final configurations to make the slave replicate with the master (mysql -u root -p)</p>
<p><code>SLAVE STOP;<br />
CHANGE MASTER TO MASTER_HOST='{master_ip}', MASTER_USER='{username}', MASTER_PASSWORD='{password}', MASTER_LOG_FILE='{log_file}', MASTER_LOG_POS={log_position};<br />
SLAVE START;<br />
</code></p>
<p><em>{master_ip} = The ip of the master server<br />
{username} = The username you provided earlier on the master server<br />
{password} = The password you provided earlier on the master server<br />
{log_file} = Log file name from the master (ex. mysql-bin.000004)<br />
{log_position} = Log position from the master (ex. 2751)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/mysql-database-replication-masterslave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Port forwarding with iptables</title>
		<link>http://www.debiantutorials.com/port-forwarding-with-iptables/</link>
		<comments>http://www.debiantutorials.com/port-forwarding-with-iptables/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 23:46:03 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=122</guid>
		<description><![CDATA[In this tutorial we'll set up a simple port forwarding (NAT) using iptables.
1. Enable ip forward
echo "1" > /proc/sys/net/ipv4/ip_forward

2. Append routing rules to the nat table
iptables -t nat -A PREROUTING -p tcp -s 0/0 -d {local_ip} --dport {local_port} -j DNAT --to {destination_ip}:{destination_port}
iptables -t nat -A POSTROUTING -o eth0 -d {destination_ip} -j SNAT --to-source {local_ip}


{local_ip}: A [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we'll set up a simple port forwarding (NAT) using iptables.</p>
<p>1. Enable ip forward</p>
<p><code>echo "1" > /proc/sys/net/ipv4/ip_forward<br />
</code><span id="more-122"></span></p>
<p>2. Append routing rules to the nat table</p>
<p><code>iptables -t nat -A PREROUTING -p tcp -s 0/0 -d {local_ip} --dport {local_port} -j DNAT --to {destination_ip}:{destination_port}<br />
iptables -t nat -A POSTROUTING -o eth0 -d {destination_ip} -j SNAT --to-source {local_ip}<br />
</code></p>
<ul>
<li>{local_ip}: A ip address mapped on the local system</li>
<li>{local_port}: The port you would like to listen on</li>
<li>{destination_ip}: Destination ip address</li>
<li>{destination_port}: Destination port</li>
</ul>
<p>3. Now you can access http://{local_ip}:{local_port} and would actually be getting response from http://{destination_ip}:{destination_port}</p>
<p><strong>A working example</strong></p>
<p>If the ip address of your system is 32.64.128.200 and you import the following rules, you would be able to connect to http://32.64.128.200:8080 and actually see the Google search engine because 216.239.59.105:80 is one of Google's web servers.</p>
<p><code>iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 32.64.128.200 --dport 8080 -j DNAT --to 216.239.59.105:80<br />
iptables -t nat -A POSTROUTING -o eth0 -d 216.239.59.105 -j SNAT --to-source 32.64.128.200<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/port-forwarding-with-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing ntop network monitoring tool</title>
		<link>http://www.debiantutorials.com/installing-ntop-network-monitoring-tool/</link>
		<comments>http://www.debiantutorials.com/installing-ntop-network-monitoring-tool/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 20:27:21 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ntop]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=114</guid>
		<description><![CDATA[ntop is a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntop is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform and on Win32 as well.
ntop users can use a a web browser [...]]]></description>
			<content:encoded><![CDATA[<p>ntop is a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntop is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform and on Win32 as well.</p>
<p>ntop users can use a a web browser (e.g. netscape) to navigate through ntop (that acts as a web server) traffic information and get a dump of the network status. In the latter case, ntop can be seen as a simple RMON-like agent with an embedded web interface.</p>
<p>1. Install required packages</p>
<p><code>apt-get install ntop<br />
</code><span id="more-114"></span></p>
<p>2. Set administrator password</p>
<p><code>ntop --set-admin-password<br />
</code></p>
<p>3. Configure ntop to use your correct network adapter if it's not eth0 (optional)</p>
<p><code>dpkg-reconfigure ntop<br />
 > eth0 (or your network adapter)<br />
 > ntop<br />
</code></p>
<p>4. Start ntop</p>
<p><code>/etc/init.d/ntop start<br />
</code></p>
<p>Now you can access ntop web admin on a location similar to this one: http://192.168.1.100:3000. Just make sure you replace the IP address with your server IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-ntop-network-monitoring-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
