<?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>Massimo Rosasco&#187; linux</title>
	<atom:link href="http://www.rosasco.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rosasco.com</link>
	<description>Zen and the Art of The Internet</description>
	<lastBuildDate>Thu, 05 Aug 2010 20:59:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Build a Hosting Server with Debian Sarge, Webmin, Virtualmin</title>
		<link>http://www.rosasco.com/build-a-hosting-server-with-debian-sarge-webmin-virtualmin/</link>
		<comments>http://www.rosasco.com/build-a-hosting-server-with-debian-sarge-webmin-virtualmin/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 19:37:50 +0000</pubDate>
		<dc:creator>massimo</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rosasco.com/?p=5</guid>
		<description><![CDATA[These are my notes for building a hosting server with Debian, webmin, virtualmin. I put them here so I know they are here and always available. After the plain Debian Sarge install, do this: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; 1) Edit /etc/apt/sources.list and upgrade system # #deb file:///cdrom/ sarge main # deb cdrom:[Debian GNU/Linux 3.1 r0a _Sarge_ - Official [...]]]></description>
			<content:encoded><![CDATA[<p>These are my notes for building a hosting server with Debian, webmin, virtualmin.<br />
I put them here so I know they are here and always available.</p>
<p>After the plain Debian Sarge install, do this:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1) Edit /etc/apt/sources.list and upgrade system</p>
<p>#<br />
#deb file:///cdrom/ sarge main<br />
#<br />
deb cdrom:[Debian GNU/Linux 3.1 r0a _Sarge_ - Official i386 Binary-1 (20050607)]/ unstable contrib main<br />
#<br />
deb http://security.debian.org/ stable/updates main contrib<br />
## Debian Stable (sarge)<br />
deb http://ftp.us.debian.org/debian/ testing main contrib non-free<br />
deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free<br />
#<br />
## Aggiornamenti della sicurezza<br />
deb http://security.debian.org/ sarge/updates main contrib<br />
deb-src http://security.debian.org/ sarge/updates main contrib<br />
#</p>
<p>then</p>
<p>>apt-get update<br />
>apt-get upgrade</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
2) Download the apache source and recompile it to use /home instead of /var/www as the &#8211;suexec-docroot</p>
<p>Download the apache source:</p>
<p># cd /usr/src<br />
# apt-get source apache<br />
# apt-get build-dep apache</p>
<p>In the main apache archive edit the file debian/rules and change the &#8211;suexec-docroot to /home directory (or a subdirecty where the domains are stored). Then build and install the modified package:</p>
<p># dpkg-buildpackage -b<br />
# dpkg -i ../apache_version-revision_arch.deb</p>
<p>This process needs to be performed for each update of the apache package.<br />
My current is 1.3.34-2</p>
<p>For suexec to work properly all files that should be run with suexec must run through cgi. For php change the apache config file httpd.conf as follows:</p>
<p>AddHandler cgi-script .php .cgi .sh .pl</p>
<p>This tells apache to treat php (and perl) scripts as cgi scripts. Now, every section where CGIs should be enabled needs:</p>
<p>Options +ExecCGI</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
3) Install bind</p>
<p># apt-get install bind<br />
# apt-get install libapache-mod-ssl</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
4) Install Webmin</p>
<p>Install webmin</p>
<p># wget http://belnet.dl.sourceforge.net/sourceforge/webadmin/webmin-1.270.tar.gz<br />
# tar -xvzf webmin-1.270.tar.gz<br />
# cd webmin-1.270<br />
# ./setup.sh /usr/local/webmin</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
5) Install Postfix</p>
<p># apt-get install postfix</p>
<p>Then, in the webmin Postfix module, browse to Postfix:Virtual Domains. Enter a type of database, and a filename for the virtual map database into the Domain mapping lookup tables field. For Linux is<br />
hash:/etc/postfix/virtual.<br />
Save and apply.</p>
<p>Next, we&#8217;ll to move the mail spool to the /home partition.<br />
Browse to Postfix:Local Delivery.<br />
Edit the Spool directory option and enter /home/mail.<br />
Save and Apply.</p>
<p>In order for POP or IMAP to work, those servers will need to know how to find the mail spool. The easiest thing to do is to create a symbolic link from /var/spool/mail to /home/mail.</p>
<p># ln -s /home/mail /var/spool/mail</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
6) Configure apache</p>
<p>a- Apache must be configured for Virtual Hosting.<br />
From within Webmin go to Apache:Networking and Addresses, enter either a local address or select the &#8220;Include all addresses&#8221; option.<br />
Then click Save.<br />
Or add a line like this to the http.conf file:</p>
<p>NameVirtualHost 192.168.1.248</p>
<p>b- In httpd.conf change the lines Options e Allowoverride with these:</p>
<p>AllowOverride All<br />
Options Indexes Includes FollowSymLinks MultiViews</p>
<p>and change the block dealing with the &#8220;public_html&#8221; Userdir with this block:</p>
<p>#<br />
# Control access to UserDir directories.  The following is an example<br />
# for a site where these directories are restricted to read-only.<br />
#</p>
<p>AllowOverride All<br />
Options Indexes Includes FollowSymLinks MultiViews</p>
<p>Order allow,deny<br />
Allow from all</p>
<p>Order deny,allow<br />
Deny from all</p>
<p>c- Comment alias images</p>
<p>#    Alias /images/ /usr/share/images/</p>
<p>#<br />
#         Options MultiViews<br />
#         AllowOverride None<br />
#         Order allow,deny<br />
#         Allow from all<br />
#</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
7) Install Webalizer, Logrotate, Proftpd</p>
<p>Simple as that:</p>
<p># apt-get install webalizer<br />
# apt-get install logrotate<br />
# apt-get install proftpd</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
 <img src='http://www.rosasco.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Install virtualmin</p>
<p>Download it<br />
# wget http://download.webmin.com/download/virtualmin/virtual-server-2.611.wbm.gz</p>
<p>And install it from the &#8220;Webmin Modules&#8221; module</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
9) Install MySQL</p>
<p># apt-get install mysql-server</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
10) Let&#8217;s now install some useful libs</p>
<p># apt-get install libdbi-perl libdbd-mysql-perl libdigest-md5-perl libdigest-sha1-perl libimage-size-perl libmime-lite-perl libmime-perl libcompress-zlib-perl libmime-base64-perl liburi-perl libhtml-tagset-perl libhtml-parser-perl libwww-perl libwww-perl libgd-perl libmailtools-perl libunicode-maputf8-perl libstorable-perl libtime-hires-perl<br />
# apt-get install libxml-parser-perl<br />
# apt-get install libapache-mod-php4 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-gmp php4-imap php4-ldap php4-mcal php4-mcrypt php4-mhash php4-ming php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
11) Speed tips</p>
<p>Since I have to cope with poor man&#8217;s hardware, these are very precious tips</p>
<p>a-  Reduce the number of ttys started in your /etc/inittab:</p>
<p># comment out lines 2,3,etc and leave only no 1<br />
1:2345:respawn:/sbin/getty 38400 tty1<br />
#2:2345:respawn:/sbin/getty 38400 tty2<br />
#3:2345:respawn:/sbin/getty 38400 tty3</p>
<p>b- Tune MySQL to use less memory for cache. The best is to use the my-small.cnf sample config as /etc/my.cnf. Below is an example of what to put in /etc/my.cnf.</p>
<p>[mysqld]<br />
port = 3306<br />
socket = /var/lib/mysql/mysql.sock<br />
skip-locking<br />
set-variable = key_buffer=16K<br />
set-variable = max_allowed_packet=1M<br />
set-variable = thread_stack=64K<br />
set-variable = table_cache=4<br />
set-variable = sort_buffer=64K<br />
set-variable = net_buffer_length=2K</p>
<p>c- MySQL uses 10MBs of RAM for InnoDB tables. Remove support for InnoDB tables if you do not use them. To remove support for InnoDB, put the following lines in /etc/my.cnf</p>
<p>[mysqld]<br />
skip-innodb</p>
<p>d- Tune Apache to only have a small number of spare children running. An example of the Apache configuration section:</p>
<p>StartServers 1<br />
MinSpareServers 1<br />
MaxSpareServers 5<br />
ServerLimit 64<br />
MaxClients 64<br />
MaxRequestsPerChild 4000</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
12) Install Greylisting for Postfix<br />
The postgrey package is a greylisting implementation for postfix.<br />
It is pretty simple to set-up and stops from 70% to 90% of spam.<br />
If you want to know more go <a title="greylisting" target="_blank" href="http://projects.puremagic.com/greylisting/">here.</a></p>
<p>apt-get install postgrey</p>
<p>webmin go to Servers:Postfix Configuration:SMTP Server Options and on</p>
<p>&#8220;Restrictions on recipient addresses&#8221;</p>
<p>put this string:</p>
<p>check_policy_service inet:127.0.0.1:60000,reject_unauth_destination</p>
<p>Save and Apply.</p>
<p>Then check what&#8217;s happening on /var/log/mail.log.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
I&#8217;ve picked something here and there to put this together. If someone finds that I am infringing their copyright, please let me know and I will delete/change the offending part. thank you</p>
<div class="ziczacp"><script type="text/javascript">zz_url=encodeURIComponent('http://www.rosasco.com/build-a-hosting-server-with-debian-sarge-webmin-virtualmin/');zz_t='2';zz_title=encodeURIComponent('Build a Hosting Server with Debian Sarge, Webmin, Virtualmin ');</script><script src="http://ziczac.it/a/e/zz.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rosasco.com/build-a-hosting-server-with-debian-sarge-webmin-virtualmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
