<?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>sxg.com</title>
	<atom:link href="http://www.sxg.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sxg.com</link>
	<description>The personal site of Gilbert Serex - Linux enthusiast &#38; Internet entrepreneur with a background in Electronic Engineering</description>
	<lastBuildDate>Sun, 05 May 2013 18:19:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Plesk 11 to VM – Part 3: Customisation and migration</title>
		<link>http://www.sxg.com/plesk-11-to-vm-part-3-customisation-and-migration/</link>
		<comments>http://www.sxg.com/plesk-11-to-vm-part-3-customisation-and-migration/#comments</comments>
		<pubDate>Sun, 05 May 2013 15:38:14 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[customisation]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mailboxes]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[plesk 11]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=748</guid>
		<description><![CDATA[Intro In this series of Best Practice articles I talk about migrating websites and emails from a Plesk 11 run server to a Virtualmin run server. It describes in details the steps involved, including the eventual pitfalls and other thing &#8230; <a href="http://www.sxg.com/plesk-11-to-vm-part-3-customisation-and-migration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Intro</h2>
<p>In this series of Best Practice articles I talk about migrating websites and emails from a Plesk 11 run server to a Virtualmin run server. It describes in details the steps involved, including the eventual pitfalls and other thing I came across whilst doing it. Note that this documentation is addressed to people with medium expertise in linux/system administration.</p>
<h1>Useful customisation</h1>
<p>Most of VM defaul settings are fine, however in order to make it a little easier to migrate websites, the following mods are useful.</p>
<h2>Server Template &#8211; Apache directives</h2>
<p>As Plesk websites are hosted under $Documentroot/httpdocs this can be set by default before creating website by editing the Apache website default config:</p>
<p>VM Menu &gt; Server Templates &gt; Default Settings &gt; Edit template section: apache website</p>
<p>Change: <strong>DocumentRoot ${HOME}/public_html</strong><br />
To:<strong> DocumentRoot ${HOME}/httpdocs</strong></p>
<p>Change:<strong> &lt;Directory ${HOME}/public_html&gt;</strong><br />
To:<strong> &lt;Directory ${HOME}/httpdocs&gt;</strong></p>
<p>Under &#8220;<b>Users&#8217; website subdirectory to create</b>&#8220;.</p>
<p>Change:<strong> Default (<tt>public_html</tt>)</strong><br />
To: <strong><label for="html_dir_def_0">Directory under home</label> [httpdocs]</strong></p>
<h2>Account Plans</h2>
<p>One may customise them to match previous Plesk hosting &#8220;plans&#8221;, however this is not mandatory.</p>
<h1>Virtual website creation &#8211; Admin username</h1>
<p>The only requirement in this process is to create the Administration username as a &#8220;Custom username&#8221; giving it the domain.tld name (i.e. mydomain.com). This way the websites paths will end up being: /home/domain.tld, which makes it easier to do a path change from /var/www/vhosts to /home wherever there are scripts configurations containing full paths.</p>
<h1>Perl</h1>
<p>I am a perl script writer thus I use perl extensively, over the years I have created scripts that require a few additional modules. I shall not go into details with them (yet), however there&#8217;s an important bit I must mention, some perl scripts I use have a different #!. Some point to the sometimes non-existent /usr/local/bin/perl, so in order to avoid these script throwing an error I simply link it to the whereis perl (usally /usr/bin/perl or /bin/perl):</p>
<pre>ln -s /usr/bin/perl /usr/local/bin/perl</pre>
<h1>Website content transfer</h1>
<p>To transfer website content from Plesk to VM it is a matter of rsyncing each website with the rsync command,  to minimise the load, the following commands are run at nice 20 from the source server, note that the target server must have the virtual server already configured prior to doing this, otherwise an error will be thrown:</p>
<pre>rsync -avz --rsh='ssh -p{port}' /var/qmail/mailnames/{domain}/{user}/  root@{server}:/home/{domain}/homes/{user}/</pre>
<p>Where:</p>
<ul>
<li>port is the ssh port (if different than 22, which is recommended for security)</li>
<li>domain is the domain to be transferred</li>
<li>target is is the target server IP or domain</li>
</ul>
<p>Depending on the size of the website this might take some time. Note that I am not really needing to transfer statistical information over. most if not all the required files are under httpdocs and cgi-bin in my case.</p>
<p>After the transfer, on the target server, ownership of the directories must be set:</p>
<pre>chown -R {username}:{username} /home/{domain}/httpdocs /home/{domain}/cgi-bin</pre>
<p>Where:</p>
<ul>
<li>username is the owner of the httpd and cgi-bin content (in my case I created a username matching the domain, making it easier to find the correct directory under /home when working over the CLI.</li>
<li>domain is the domain</li>
</ul>
<h1>Email content transfer</h1>
<p>The operation of transferring emails to the target server are pretty much the same as website transfer, with a couple of exceptions.</p>
<pre>nice -20 rsync -avz --rsh='ssh -p{port}' /var/qmail/mailnames/{domain} root@{target}:/home/{domain}/home/</pre>
<p>Where:</p>
<ul>
<li>port is the ssh port (if different than 22, which is recommended for security)</li>
<li>domain is the domain to be transferred</li>
<li>target is is the target server IP or domain</li>
</ul>
<p>After the transfer, on the target server, ownership of the directories must be set:</p>
<p><strong>IMPORTANT</strong>: note user is user.domain (not just domain)</p>
<pre>chown -R {user}.{domain}:{domain} /home/{domain}/homes/{user}/</pre>
<p>Where:</p>
<ul>
<li>user is the name of the user</li>
<li>domain is the name of the domain</li>
</ul>
<h4>IMAP changes (At client level, here using Thunderbird)</h4>
<p>Server name: no change<br />
Username: replace @ with .<br />
Connection security: from SSL/TLS to STARTTLS<br />
Authentication method: from encrypted password to normal password</p>
<h4>SMTP changes (At client level, here using Thunderbird)</h4>
<p>Server name: no change<br />
Port from 25 to 587<br />
Connection security: from SSL/TLS to STARTTLS<br />
Authentication method: from encrypted password to normal password<br />
Username: replace @ with .</p>
<h1>Database content transfer</h1>
<p>Source server</p>
<pre>mysqlcheck --optimize {database} --auto-repair  -uadmin -p`cat /etc/psa/.psa.shadow`
mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` --flush-logs --opt {database} &gt; {database}.sql</pre>
<p>Where:</p>
<ul>
<li>database is the database name</li>
</ul>
<p>Target server (after rsyncing all the dbs dumps on it)</p>
<p>VM Menu &gt; Edit Databases &gt; (manage current database usually called {domain}_{tld}) or create a new one if required.<br />
click Manage &#8230;<br />
Click Execute SQL<br />
Run SQL from file Tab<br />
From local file (browse to file)<br />
Click Execute</p>
<h1>Special characters</h1>
<p>Sites  with accents (like French&#8217;s)</p>
<p>The charset must be edited in the following Module:</p>
<p>Select Domain &gt; Menu &gt; Services &gt; Configure Website &gt; Languages &gt;  Character set for documents     (x) iso-8859-1</p>
<p>Save, apply changes.</p>
<p style="text-align: center;"><a href="http://www.sxg.com/wp-content/uploads/2013/05/languages.gif"><img class="wp-image-765 aligncenter" alt="languages" src="http://www.sxg.com/wp-content/uploads/2013/05/languages.gif" width="817" height="424" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/plesk-11-to-vm-part-3-customisation-and-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plesk 11  to VM &#8211; Part 1: Why move?</title>
		<link>http://www.sxg.com/migrating-plesk-11-to-virtualmin-best-practice-i-why/</link>
		<comments>http://www.sxg.com/migrating-plesk-11-to-virtualmin-best-practice-i-why/#comments</comments>
		<pubDate>Sat, 23 Mar 2013 18:17:09 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[best]]></category>
		<category><![CDATA[Cent OS]]></category>
		<category><![CDATA[control panels]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[plesk 11]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=677</guid>
		<description><![CDATA[Intro In this series of Best Practice articles I talk about migrating websites and emails from a Plesk 11 run server to a Virtualmin run server. It describes in details the steps involved, including the eventual pitfalls and other thing &#8230; <a href="http://www.sxg.com/migrating-plesk-11-to-virtualmin-best-practice-i-why/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Intro</h2>
<p>In this series of Best Practice articles I talk about migrating websites and emails from a Plesk 11 run server to a Virtualmin run server. It describes in details the steps involved, including the eventual pitfalls and other thing I came across whilst doing it. Note that this documentation is addressed to people with medium expertise in linux/system administration.</p>
<h1><img class="alignright" alt="Fed up with Plesk?" src="http://www.sxg.com/wp-content/uploads/2013/03/plesk2virtualmin.gif" width="300" height="197" />Fed up with Plesk?</h1>
<p>Since  2003 I have been using two brands of Dedicated Servers Control Panels: Ensim (RIP) and <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.parallels.com/uk/products/plesk/">Plesk</a>. So it&#8217;s died <img src='http://www.sxg.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  oh well, Ensim was an awful CP, never liked it, I liked Plesk (from 8 to 11) a bit more and it has been my selected Control Panel for many years. However the time has come to make way for a relatively new comer: Virtualmin or VM for short, a very mature and simpler CP indeed with a vibrant <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.virtualmin.com/forums">Community</a>.</p>
<p>Deciding to select another Control Panel is a big decision, especially when your bottom line is at stake, so after having extensively tested and used VM for the last few months I finally decided to make the move, VM is slick, simple and easy to use, it&#8217;s like Ronseal, it does what it says on the tin.</p>
<h1><span id="more-677"></span>Plesk who it is really for?</h1>
<p>Less and less for me as I do not resell nor hosts 1000&#8242;s of websites, Plesk is probably best for that. However the latest incarnation of Plesk (at least as it was given to me by my service provider) is getting a little too much, some menus about &#8220;Business Management&#8221; which may be well made but I didn&#8217;t get the chance to try, it didn&#8217;t work <img src='http://www.sxg.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  and some serious problems with email servicing [off topic]not to mention all my scripts using sendmail.pm were denied access to smtp locally, apart for a few minutes when I changed the server var to the local IP, then it failed again, DC has no ideas<strong>!</strong>)[/off topic].</p>
<p>Most of my customers websites are not accessed via ftp often (the port is opened to a select few) all is done via web interface.</p>
<h1>Virtualmin</h1>
<p>I stumbled upon Virtualmin by accident, I knew Webmin from many years ago and never really saw what to use it for, I then got a very <a title="Check them, they're good!" href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.hostineuro.com">cheap VPS</a> with Ubuntu 11.10 (I am on now 12.04 writing this) and sourced Webmin to play about. It turned out that I should have not installed Webmin first but Virtualmin which is mentionned on webmin.com, installing Webmin before Virtualmin <a title="Bare webserver setup" href="http://www.sxg.com/bare-webserver-setup/">messed up</a>.  So I reset the VPS with the recommended OS of the day (CentOS 6 64) and installed Virtualmin via their <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.webmin.com/virtualmin.html">archive</a>.</p>
<h1>Benefits of VM</h1>
<p>The main benefits of Virtualmin, in my opinion, are as follow:</p>
<ul>
<li>Free</li>
<li>Speedy community support</li>
<li>Does not interfere with the native OS</li>
<li>Good Integration with <em>csf</em> Firewall and Cpan and whatever else.</li>
<li>Fast, uncluttered Interface</li>
<li>Simpler Website / Email / User management (I don&#8217;t do resellers etc.)</li>
<li>Direct access to the rest of the appliance with via Webmin</li>
<li>Entirely customisable, add/remove edit any of the many, many available modules</li>
</ul>
<p>Virtualmin install is a breeze, simply download the archive, unpack it and invoke the install.sh script, the rest is childs play. The OS of choice for me is CentOS 6 64 which is ready to be used with Virtualmin pretty much out  of the box.</p>
<p><a href="http://www.sxg.com/wp-content/uploads/2013/03/install_vm.gif"><img class="alignright size-full wp-image-698" alt="install.sh" src="http://www.sxg.com/wp-content/uploads/2013/03/install_vm.gif" width="601" height="622" /></a></p>
<h1>Decisions, decisions</h1>
<p>Migrating to VM from Plesk brings its own set of challenges, the main one is the websites &#8220;DocumentRoot&#8221;; Plesk puts everything in /var/www/vhosts, VM is a /home matter. So before migration it is to be decided whether set VM to have DocumentRoot pointing to /var/www/vhosts or keep the default, this could cause potential suexec conflicts, so I decided to leave VM with the default (/home). So the first thing to think about is to replace all absolute paths in all scripts (if any) from /var/www/vhosts to /home, second, a bog standard import of Plesk backups to VM, although the simplest and fastest way, causes major headaches; Plesk stores websites under /var/www/vhosts/domain.tld but VM [rightly] stores them under /home/username, where <em>username</em> is Plesk&#8217;s ftp credentials to log onto each websites, so unless you rename all ftp users to domain.tld in Plesk&#8230; this means that a Plesk backup import can be a bit of a headache.</p>
<p>If, like me, you&#8217;ve got a few dozen websites, the decision is to create all websites in VM manually with the administrative user name as the domain name (like example.tld) is what I will go for (you can always add the old Plesk username as a secondary account for your ftp customers if required).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/migrating-plesk-11-to-virtualmin-best-practice-i-why/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plesk 11 to VM &#8211; Part 2: Bare server set up</title>
		<link>http://www.sxg.com/migrating-plesk-11-to-virtualmin-ii-bare-server-setup/</link>
		<comments>http://www.sxg.com/migrating-plesk-11-to-virtualmin-ii-bare-server-setup/#comments</comments>
		<pubDate>Sat, 23 Mar 2013 18:16:56 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[bare server]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[csf]]></category>
		<category><![CDATA[passwordless ssh]]></category>
		<category><![CDATA[ptr]]></category>
		<category><![CDATA[rkhunter]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=685</guid>
		<description><![CDATA[Intro In this series of best practice articles I talk about migrating websites and emails from a Plesk 11 managed server to a Virtualmin managed server. It describes in some details the steps involved in doing it remedy the pitfalls &#8230; <a href="http://www.sxg.com/migrating-plesk-11-to-virtualmin-ii-bare-server-setup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Intro</h2>
<p>In this series of best practice articles I talk about migrating websites and emails from a Plesk 11 managed server to a Virtualmin managed server. It describes in some details the steps involved in doing it remedy the pitfalls and other thing I came across whilst doing it. Note that this documentation is address to people with medium expertise in linux/system administration.</p>
<h1>Hardware</h1>
<p>A fresh install of a super fast multi-core web server with sufficient RAM and [Hardware] RAID 1 partitioned as follow:<span id="more-685"></span></p>
<ul>
<li>/ = 12GB</li>
<li>/swap =&gt; RAMx2 (recommended) however I set it to RAMx1 as the RAM rarely &#8220;swaps&#8221;.</li>
<li>/var = 1/2 of the rest of the space</li>
<li>/home = 1/2 of the rest of the space.</li>
</ul>
<p>As I have a few websites to run, a 250GB HDD was my choice, so /var and /home are about 100GB each which gives me more than enough space for the moment, bearing in mind that one can always increase this easily by swapping bigger RAID mirrors one after the other followed by a quick partition resize.</p>
<h1>Partitions allocation</h1>
<p>I chose to split /var and /home from / because:</p>
<ol>
<li>/home will contain all the websites and emails</li>
<li>/var usually contains log files, firewall, partition, users information etc.</li>
<li>/var will contain an image backup of /home and / (I am planning to use <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://r1soft.idera.com/tools/linux-hot-copy">hot copy</a>)</li>
</ol>
<h1>Backup</h1>
<p>The RAID 1 disk setup pretty much solves the &#8220;disk failure&#8221; challenge, but not data loss due to human error (or otherwise). So a solid backup strategy is essential. My plans are currently to have an image snapshot made of the bare server before adding websites, to do this I have been quite impressed by the backup products from <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://r1soft.idera.com">Idera</a>, more particularly &#8220;Server Backup&#8221; which is free with some disabled features (like remote backups management), however I feel it might be a little too much for me, I really need a simpler interface to use, that is why I was initially interested in their &#8220;Hot Copy&#8221; product, which I haven&#8217;t tested yet. With Hot copy, I would take a snap shot of /home on /var and vice versa which I would then upload to a backup server. Simple and neat.</p>
<p>Providing that Hot Copy does not interfere with the OS too much (I like the OS to remain &#8220;as is&#8221; to avoid conflicts (like Plesk has recently given me with Emails refusing to be send using Qmail, only Postfix worked, one of the reason I give up on Plesk. Too much interfering).</p>
<h1>Initial Steps</h1>
<p>The very first thing to do on a brand new server is:</p>
<ol>
<li>Check that the IP address [range] is not <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.mxtoolbox.com/blacklists.aspx">Blacklisted</a> for sending spam</li>
<li>Set the hostname and Reverse (<a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://en.wikipedia.org/wiki/Reverse_DNS_lookup">PTR</a>) pointer accordingly</li>
<li>Install <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.rootkit.nl/projects/rootkit_hunter.html">rkhunter</a> and run it with
<pre>rkhunter -c --update --propupd</pre>
</li>
<li>Change SSH port and activate <a title="Passwordless SSH" href="http://www.sxg.com/passwordless-ssh/">passwordless</a> authentication</li>
<li>Install <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.webmin.com/virtualmin.html">Virtualmin</a> and <a href="http://www.sxg.com/index-shtml-in-virtualmin/">customise the Directoryindex directive</a> and the <a title="Permalink to Primary Default Website in Virtualmin (Apache)" href="http://www.sxg.com/primary-default-website-in-virtualmin-apache/" rel="bookmark">Primary Default Website</a> <del>you may also do additional customisation outlined here</del> (page to be created)</li>
<li>Install <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.configserver.com/cp/csf.html">Configserver&#8217;s csf </a> and use their security checker to harden the appliance</li>
<li>install hotcopy <del>more about what to do here</del> (&lt;to be written)</li>
</ol>
<h1> Non essential installs (but recommended)</h1>
<p>In addition to the above minimum installs. Here are a few more things that, I reckon is a good idea to have:</p>
<h2>screen</h2>
<p><a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://en.wikipedia.org/wiki/GNU_Screen">Screen</a> is a great app when working with ssh, it allows you to close your terminal window without losing your remote session, screen &#8220;attaches&#8221; terminal window to your terminal and &#8220;detaches&#8221; itself when you close your window (or your office internet connection drops for whatever reason), this is particularly useful when you don&#8217;t want to leave your terminal opened when a long process is being run (like a backup etc.).</p>
<h2>tree</h2>
<p><a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://en.wikipedia.org/wiki/Tree_%28Unix%29">tree</a> is used by one of my perl scripts to do fast, recursive line replacements in files within a directory.</p>
<p>Use yum to install any additional applications, like:</p>
<pre>yum install screen tree</pre>
<h1>Server stats &#8211; Munin</h1>
<p>I used to have HotSaNIC on my previous dedicated, however since this application is over 10 years old now, it&#8217;s a little arduous to install. After having tested two alternatives, namely Nagios and Munin, I went for Munin.</p>
<p>Munin is exactly like Hot Sanic but with more graphs than you can shake a stick at. However installing Munin on Centos 6 is not a straight forward thing, an additional (epel) repository the must be added.</p>
<pre>cd ~
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh ~/epel-release-6-8.noarch.rpm
yum install munin munin-node</pre>
<p><span style="text-decoration: underline;"><strong>Important!: The Epel repository must be disabled after the install otherwise Virtualmin updates incompatible packages resulting in some application no longer working</strong></span></p>
<p>To disable the epel repository, edit /etc/yum.repos.d/epel.repo and change enabled=0 to 1 under the [epel] section:</p>
<pre>[epel]
....
enabled=0 #(was 1)
...</pre>
<p>Normally Munin installs everything pretty much as it should, all I had to do is create a username login and password (below the username is <em>Munin</em>, but it could be anything, like admin, joe etc.):</p>
<pre>htpasswd -c /etc/munin/munin-htpasswd Munin</pre>
<p>The default location for the Munin graphs are under /var/www/html/ (VM default), to enable access to this folder, <a title="Primary Default Website in Virtualmin (Apache)" href="http://www.sxg.com/primary-default-website-in-virtualmin-apache/">this httpd.conf hack must be done</a>. Otherwise the munin.conf must be changed accordingly.</p>
<h2>Start Munin at boot</h2>
<p>Munin does not start at boot by default, this is why it must be enabled with:</p>
<pre>chkconfig munin-node on</pre>
<h1>Post install snags</h1>
<p>Once all the above is installed it&#8217;s time to run some tests. To this end it is best to create a virtual server to check all is working as it should, in my case, it almost always involves the hostname and email (Postfix) service.</p>
<h2>Issue 1: Setting a hostname up</h2>
<p>The most important aspect of a web server, yet the bit that always catches everyone with little experience in the field. In a brand new server, the hostname can be anything the Sysadmin has decided to use by default for its server pool install. So it must be changed.</p>
<p>The command to check the current hostname is:</p>
<pre># hostname
somename</pre>
<p>Where &#8220;somename&#8221; is the current name of the host that needs changing</p>
<p>To set a new hostname and make it coherent for the appliance, two files must be edited:</p>
<ul>
<li>/etc/hosts</li>
<li>/etc/sysconfig/network</li>
</ul>
<h3>/etc/hosts</h3>
<p>The default entries in <strong>/etc/hosts</strong> are usually:</p>
<pre>127.0.0.1   localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost.localdomain localhost6 localhost6.localdomain6</pre>
<p>A third line must be added with the hostname and IP address (i.e. hostname = some.domain.net &amp; IP = 111.222.001.111):</p>
<pre>127.0.0.1   localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost.localdomain localhost6 localhost6.localdomain6
111.222.001.111 some.domain.net</pre>
<h3>/etc/sysconfig/network</h3>
<p>The other file is<strong> /etc/sysconfig/network</strong> which should look like:</p>
<pre>NETWORKING=yes
HOSTNAME="some.domain.net"</pre>
<p>Where &#8220;some.domain.net&#8221; is your Fully Qualified Domain Name (FQDN)</p>
<p>The above will not be taken in consideration immediately but after a reboot, to avoid rebooting and set the hostname immediately simply type:</p>
<pre>hostname some.domain.net</pre>
<h2>Issue 2: Postfix and SMTP</h2>
<p>I always have trouble with emails, it&#8217;s a total mystery to me as to why it should be so much of a pain in the backside to get working. There&#8217;re almost always problems with email service! (at least for me).</p>
<h3>Summary of possible problems</h3>
<p>In my latest install here are the errors reported by Virtualmin I encountered:</p>
<ol>
<li>postfix: fatal: parameter inet_interfaces: no local interface found for {IP address here}</li>
<li>The procmail command /usr/bin/procmail is owned by group mail, when it should be owned by root. Email may not be properly delivered or checked (&#8230;.)</li>
<li>The sending of emails via SMTP (SSLTLS/plain password on port 587) was timing out.</li>
<li>Automatic BCCing of outgoing email cannot be enabled unless a BCC map is defined in the Postfix Mailserver module, or manually in the Postfix configuration file. Otherwise it must be turned off on the module configuration page.</li>
</ol>
<p>Below are the lines that needed replaced (or added) to sort issue 1 to 3 &#8211; stop postfix first!:</p>
<p><strong>Note that a backup of any files before editing is RECOMMENDED. </strong>In my case I did a hotcopy first <img src='http://www.sxg.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>For /etc/postfix/main.cf:</p>
<pre>inet_interfaces = localhost 
changed to &gt;&gt;
inet_interfaces = all
---
mailbox_command = /some/where/procmail 
changed to &gt;&gt;
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

Added:
======
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
mailbox_size_limit = 0
allow_percent_hack = no</pre>
<p>For /etc/postfix/master.cf:</p>
<pre>smtp      inet  n       -       n       -       -       smtpd
changed to &gt;&gt;
smtp  inet    n       -       n       -       -       smtpd -o smtpd_sasl_auth_enable=yes
---
Added :
=======
submission    inet    n       -       n       -       -       smtpd -o smtpd_sasl_auth_enable=yes</pre>
<p>Note: the above provided <span style="text-decoration: underline;">for info only</span>, no responsibility held in any events, I had tried just about everything when I recalled that I luckily had a fully operational VPS from which I simply copied the master.cf and main.cf without forgetting to change the &#8220;mydestination&#8221; option to the correct hostname, it did the trick.</p>
<p>Below is the changes made to fix issue 4:</p>
<blockquote><p>Automatic BCCing of outgoing email cannot be enabled unless a BCC map is defined in the Postfix Mailserver module, or manually in the Postfix configuration file. Otherwise it must be turned off on the module configuration page.</p></blockquote>
<p style="text-align: left;">In VM Go to Webmin &gt; Servers &gt; Postfix Mail Server &gt; BCC Mapping and set the <strong>Sender BCC</strong> as follow (mine was &#8220;No Map Set&#8221;):</p>
<p style="text-align: center;"><img class=" wp-image-744 aligncenter" alt="bccmapping" src="http://www.sxg.com/wp-content/uploads/2013/03/bccmapping.gif" width="609" height="268" /></p>
<p>Once all is set as it should a nice message from VM:</p>
<p><span style="color: #339966;">.. your system is not ready for use by Virtualmin.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/migrating-plesk-11-to-virtualmin-ii-bare-server-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reverting to passworded SSH (root) logins</title>
		<link>http://www.sxg.com/reverting-to-passworded-ssh-root-logins/</link>
		<comments>http://www.sxg.com/reverting-to-passworded-ssh-root-logins/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 18:44:34 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[centos 6 (64bits)]]></category>
		<category><![CDATA[key pairs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[passwordless]]></category>
		<category><![CDATA[permitrootlogin]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[revert]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd_config]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=667</guid>
		<description><![CDATA[My normal ssh logins are with public keys authentication (aka passwordless), however, under certain circumstances I&#8217;d like to revert back to good old passwords logins. Like when I want to transfer a Plesk server across another server using the Plesk Migration &#38; &#8230; <a href="http://www.sxg.com/reverting-to-passworded-ssh-root-logins/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My normal ssh logins are with public keys authentication (aka <a title="Passwordless SSH" href="http://www.sxg.com/passwordless-ssh/">passwordless</a>), however, under certain circumstances I&#8217;d like to revert back to good old passwords logins. Like when I want to transfer a Plesk server across another server using the Plesk Migration &amp; Transfer manager.</p>
<p>After scouring the Net for some inspiration, which failed, and some tinkering, I finally found a neat solution to switch between the two (passwordless and normal authentication logins) quickly, the process is relatively simple* but frankly puzzling IMHO. I shall explain why:<span id="more-667"></span></p>
<p>By default, most sshd_config files state:</p>
<pre>#PermitRootLogin yes</pre>
<p>Which is meant to be the &#8220;default&#8221; because it is commented out. This line matters little when PKI is in use. However it seems that it is not the case [the default being "yes" as it is commented out] as if I specifically uncomment the line:</p>
<pre>PermitRootLogin yes</pre>
<p>&#8230;and restart the sshd service, I can login the server with the following command:</p>
<pre>ssh -o PubkeyAuthentication=no root@host</pre>
<p>If the line is &#8220;defaulted&#8221; (with a#). I am unsuccessful :-(</p>
<h1>Plesk Migration (or other applications requiring password ssh)</h1>
<p>So, when an application like the Plesk Migration &amp; Transfer Manager requires a ssh username/password pair, under the current [passwordless] set up just edit the sshd_config file to change the following:</p>
<pre>PubkeyAuthentication yes</pre>
<p>to:<strong></strong></p>
<pre>PubkeyAuthentication no</pre>
<p>restart sshd afterwards and you&#8217;re good.</p>
<p><span style="font-size: 10px; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase;">*This set up is on a centos 6 64</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/reverting-to-passworded-ssh-root-logins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yum clamav upgrade broken on virtualmin VPS</title>
		<link>http://www.sxg.com/yum-clamav-upgrade-broken-on-virtualmin-vps/</link>
		<comments>http://www.sxg.com/yum-clamav-upgrade-broken-on-virtualmin-vps/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 16:17:57 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[centos 6 64]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[clamd]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[virtualmin]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=662</guid>
		<description><![CDATA[I got a vps with virtualmin installed, I recently upgraded clam antivirus using webmin/virtualmin, this resulted in the clamd failing to start. After some research it turns out that I am running clamd with user clam instead of clamav. Yet &#8230; <a href="http://www.sxg.com/yum-clamav-upgrade-broken-on-virtualmin-vps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I got a vps with virtualmin installed, I recently upgraded clam antivirus using webmin/virtualmin, this resulted in the clamd failing to start.</p>
<p>After some research it turns out that I am running clamd with user clam instead of clamav. Yet yum upgrades clam with the user clamav and other directories in the configuration;</p>
<p>In short here is what I experienced after the upgrade (these must be changed back into the /etc/clamd.conf file):<span id="more-662"></span></p>
<ul>
<li>The user changed from clam to clamav</li>
<li>The initial path to /var/lib/clamav changed to /var/clamav</li>
</ul>
<p>The initial user (clam) was changed for the /var/run/clamav to clamav, this folder and it&#8217;s content have to be chow&#8217;ed back to clam</p>
<p>After this I was able to start clamd again.</p>
<p>Typical errors when trying to start clamd:</p>
<pre>service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Error: cli_loaddb(): No supported database files found in /var/clamav</pre>
<pre>service clamd start
<span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;">Starting Clam AntiVirus Daemon: ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!)..</span></pre>
<pre>service clamd start
Starting Clam AntiVirus Daemon: ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!). ERROR: Can't initialize the internal logger</pre>
<p>&nbsp;</p>
<div id="ap_listener_added"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/yum-clamav-upgrade-broken-on-virtualmin-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Primary Default Website in Virtualmin (Apache)</title>
		<link>http://www.sxg.com/primary-default-website-in-virtualmin-apache/</link>
		<comments>http://www.sxg.com/primary-default-website-in-virtualmin-apache/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 14:40:43 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[default server]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[Munin]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=652</guid>
		<description><![CDATA[When no virtual websites are in existence, The Apache web server will point to /var/www/html and /var/www/cgi-bin in a base install of Virtualmin (the default). However when a Virtual website is created, this changes to the first available virtual site, &#8230; <a href="http://www.sxg.com/primary-default-website-in-virtualmin-apache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When no virtual websites are in existence, The Apache web server will point to <em>/var/www/html</em> and<em> /var/www/cgi-bin</em> in a base install of <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.virtualmin.com/">Virtualmin</a> (the default). However when a Virtual website is created, this changes to the first available virtual site, so for example, if the hostname is <em>some.domain.com</em> and no virtual sites are configured, typing this <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://en.wikipedia.org/wiki/Uniform_resource_locator">URL</a> in a browser will serve the content in<em> /var/www/html</em>. If a virtual site called <em>virtualsite.com</em> is created, the same request will serve the content of <em>/home/virtualsite/public_html</em>.</p>
<h1>By design this is normal</h1>
<p>Whilst this is the way Apache is designed and there&#8217;s nothing wrong with that, it becomes a problem when some applications are only available outside the virtual server realm (i.e. not suexec&#8217;ed). For example the server has <strong>Nagios</strong> or <strong>Munin</strong> installed and you want to be able to access it even after a virtual server has been created. The solution is to manually create the first virtual server and call it the same as the server <em>hostname</em> (<em>some.domain.com</em>).</p>
<p><span id="more-652"></span></p>
<h2>Example of a manually edited httpd.conf</h2>
<p>Below is an example of the content of my current config file, the domain have been renamed to protect the innocents. Note that this must be the <strong>first</strong> Virtual Server. (to make things easier, I first created a virtual server and used it as a template, this server was then deleted)</p>
<pre>#### DEFAULT virtual server - edited by Gilbert
#### Port 80
&lt;VirtualHost 001.008.003.126:80&gt;
ServerName some.domain.com
DocumentRoot /var/www/html
ErrorLog /var/log/error_log
CustomLog /var/log/access_log combined
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
&lt;Directory /var/www/html&gt;
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
&lt;/Directory&gt;
&lt;Directory /var/www/cgi-bin&gt;
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
&lt;/Directory&gt;
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
&lt;/VirtualHost&gt;
#### End port 80
#### Port 443 (SSL)
&lt;VirtualHost 001.008.003.126:443&gt;
ServerName some.domain.com
DocumentRoot /var/www/html
ErrorLog /var/log/error_log
CustomLog /var/log/access_log combined
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
&lt;Directory /var/www/html&gt;
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
&lt;/Directory&gt;
&lt;Directory /var/www/cgi-bin&gt;
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
&lt;/Directory&gt;
SSLEngine on
SSLCertificateFile /etc/webmin/domain.com.cert
SSLCertificateKeyFile /etc/webmin/domain.com.key
&lt;/VirtualHost&gt;</pre>
<p>Note that the above is for port 80 and 443 (SSL), the path to the SSL certificate file and key is my customisation, the files must be copied to the right place.</p>
<p><del>When a domain&#8217;s A record points to this server but there&#8217;s no matching virtual site, the default will return a 404. To avoid this, simply set the &#8220;Automatic Virtual Host&#8221; of the &#8220;Default Server&#8221; (Server &gt; Apache Webserver &gt; Existing Virtual Hosts [Tab] &gt; Default Server &gt; Automatic Virtual Hosts to: /var/www/html.</del></p>
<p>The above  makes ALL Virtual sites point to the default path, so avoid.</p>
<p>This is one of many ways to do it. It just worked as required for my own needs.</p>
<p>It is also to be noted that this virtual site is not showing in the list of &#8220;virtual  Servers&#8221; in the Virtualmin Control Panel which is I think a rather good idea as I will not be able to have it deleted by accident!</p>
<div id="ap_listener_added"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/primary-default-website-in-virtualmin-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SSL smtp on Virtualmin</title>
		<link>http://www.sxg.com/ssl-smtp-on-virtualmin/</link>
		<comments>http://www.sxg.com/ssl-smtp-on-virtualmin/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 18:33:29 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=645</guid>
		<description><![CDATA[By default, virtual servers aren&#8217;t setting up SMTP to use SSL. Following this information regarding SSL SMTP I am just summarizing:  netstat -an &#124; grep :465 Returns nothing, so. vi /etc/postfix/master.cf find the lines: #smtps inet n - n - - &#8230; <a href="http://www.sxg.com/ssl-smtp-on-virtualmin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>By default, virtual servers aren&#8217;t setting up SMTP to use SSL. Following <a href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.virtualmin.com/node/16747">this information regarding SSL SMTP</a> I am just summarizing:</p>
<pre> netstat -an | grep :465</pre>
<p>Returns nothing, so.</p>
<pre>vi /etc/postfix/master.cf</pre>
<p>find the lines:</p>
<pre>#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING</pre>
<p>And uncomment them:</p>
<p><span id="more-645"></span></p>
<pre>smtps inet n - n - - smtpd
 -o smtpd_tls_wrappermode=yes
 -o smtpd_sasl_auth_enable=yes
 -o smtpd_client_restrictions=permit_sasl_authenticated,reject
 -o milter_macro_daemon_name=ORIGINATING</pre>
<p>After that, restarting postfix (I also include the saslauth, it wont hurt but I am not sure it is necessary) and checking if port 465 worked:</p>
<pre>/etc/init.d/postfix restart
/etc/init.d/saslauthd restart
netstat -an | grep :465
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN</pre>
<p>I was still getting an error in my maillog:</p>
<p><em>warning: No server certs available. TLS won&#8217;t be enabled</em></p>
<p>So I needed to create a certificate. to do this using Virtualmin is dead simple (I quote):</p>
<p><em>The simplest way to do that would be to pick a Virtual Server that exists on your server whose name you&#8217;d like on the SSL certs. Let&#8217;s assume you have a Virtual Server named &#8220;example.com&#8221;, and that&#8217;s the name you&#8217;d like on your SSL certs.</em></p>
<p>(edit: I personally used my main host website to keep things together)</p>
<p><em>Firstly, go into Edit Virtual Server, go into Enabled Features, and check &#8220;SSL website enabled&#8221;, then hit save. That&#8217;ll generate an SSL cert that is put into Apache.</em></p>
<p><em>The next step would be to get that cert into your mail setup.</em></p>
<p><em>To do that, go into Server Configuration -&gt; Manage SSL Certificate, and click &#8220;Copy to Postfix&#8221;. That&#8217;ll setup Postfix with that new SSL cert you just created.</em></p>
<p><em>I don&#8217;t recall if that actually restarts Postfix&#8230; if not, you may need to manually restart it with &#8220;/etc/init.d/postfix restart&#8221;.</em></p>
<p>After this, I am able to set SMTP to use STARTTLS port 587 with plain password to send emails using the server <img src='http://www.sxg.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/ssl-smtp-on-virtualmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>index.shtml and #include virtual in Virtualmin</title>
		<link>http://www.sxg.com/index-shtml-in-virtualmin/</link>
		<comments>http://www.sxg.com/index-shtml-in-virtualmin/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 17:06:04 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[directives]]></category>
		<category><![CDATA[directoryindex]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[includes]]></category>
		<category><![CDATA[NOEXEC]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shtml]]></category>
		<category><![CDATA[side]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=641</guid>
		<description><![CDATA[For some reason the default virtualmin install does not have index.shtml in the Directoryindex directive. To enable it, one must edit the directive: Virtualmin &#62; Services &#62; Configure Website &#62; Edit Directives  Find the following line: DirectoryIndex index.html index.htm index.php &#8230; <a href="http://www.sxg.com/index-shtml-in-virtualmin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For some reason the default virtualmin install does not have index.shtml in the Directoryindex directive. To enable it, one must edit the directive:</p>
<p><code>Virtualmin &gt; Services &gt; Configure Website &gt; Edit Directives </code></p>
<p>Find the following line:</p>
<pre>DirectoryIndex index.html index.htm index.php index.php4 index.php5</pre>
<p>Add index.shml at the end  of the line:</p>
<pre>DirectoryIndex index.html index.htm index.php index.php4 index.php5 index.shtml</pre>
<p>Click &#8220;Save&#8221; then &#8220;Apply Changes&#8221; (on the top right hand side of the &#8220;Virtual Server Options&#8221; page). Checking your virtual website will show the index.shtml page.</p>
<h1>To make it a default configuration</h1>
<p>In order to enable  this for all further virtual websites:</p>
<p><span id="more-641"></span><code>Virtualmin &gt; System Settings &gt; Server Templates &gt; Default Settings &gt; Apache website &gt; Directives and settings for new websites<br />
</code></p>
<p>Find the following line:</p>
<pre>DirectoryIndex index.html index.htm index.php index.php4 index.php5</pre>
<p>Add index.shml at the end  of the line:</p>
<pre>DirectoryIndex index.html index.htm index.php index.php4 index.php5 index.shtml</pre>
<p>Click &#8220;Save&#8221;</p>
<p>The same can be applied in the &#8220;Settings For Sub-Servers&#8221; Template.</p>
<h1>#include virtual</h1>
<p>I have some cgi scripts that are included in my shtml files. to enable include executions in the default virtualmin setup. some changes must be made in the same files as above:</p>
<p>Find:</p>
<pre>Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch</pre>
<p>and replace with (remove NOEXEC):</p>
<pre>Options -Indexes +Includes +SymLinksIfOwnerMatch</pre>
<p>Retarting the Apache server will enable #include virtual=&#8221;/cgi-bin/somescript.cgi&#8221; directive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/index-shtml-in-virtualmin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virtualmin Virtual Servers (GPL)</title>
		<link>http://www.sxg.com/virtualmin-virtual-servers-gpl/</link>
		<comments>http://www.sxg.com/virtualmin-virtual-servers-gpl/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 15:26:19 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[centos 6 (64bits)]]></category>
		<category><![CDATA[configserver]]></category>
		<category><![CDATA[csf lfd]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[localhost: 143]]></category>
		<category><![CDATA[virtualmin]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[webmin]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=616</guid>
		<description><![CDATA[Following my last post I now found out that Webmin does not allow multi virtual servers , BUT there is a module called Virtualmin Virtual Servers (GPL) which is what I need. To save myself hassle, I installed a compatible &#8230; <a href="http://www.sxg.com/virtualmin-virtual-servers-gpl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Following my <a title="Bare webserver setup" href="http://www.sxg.com/bare-webserver-setup/">last post</a> I now found out that Webmin does not allow multi virtual servers <img src='http://www.sxg.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> , BUT there is a module called <a title="Virtualmin" href="http://www.sxg.com/cgi-bin/axs/ax.pl?http://www.webmin.com/virtualmin.html">Virtualmin Virtual Servers (GPL)</a> which is what I need.</p>
<p>To save myself hassle, I installed a compatible OS (CentOS 6 64bit) and simply installed virtualmin from the install.sh command after downloading it:</p>
<pre>cd /root
wget http://software.virtualmin.com/gpl/scripts/install.sh
sh ./install.sh</pre>
<p>After this my next  move was to install csf lfd from configserver.com:</p>
<pre>wget http://www.configserver.com/free/csf.tgz
tar zxvf csf.tgz
cd csf
sh ./install.sh</pre>
<p>Once installed integrate it in Webmin and you&#8217;re good to go.</p>
<h1>Email access problems</h1>
<p>All worked well from the word go except SMTP/POP3 (Dovecot) server; I was getting <strong>Failed to connect to localhost:143 : Connection refused </strong> (as well as port 993,995,110 and 25) when trying to connect either via my email client or usermin.</p>
<p>System Information was reporting that Dovecot IMAP / POP3 Server was offline, and trying to start Dovecot failed:</p>
<pre>Starting dovecot: Error: socket() failed: Address family not supported by protocol
Error: service(pop3-login): listen(::, 110) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(pop3-login): listen(::, 995) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 143) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 993) failed: Address family not supported by protocol
Fatal: Failed to start listeners</pre>
<p>After editing the /etc/dovecot/dovecot.conf file and commenting out/insert: <em>listen = *</em>  Here is how my edited file looks like:</p>
<pre># A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::
listen = *</pre>
<p>Now, why would Dovecot server come with this line disabled is baffling, anyway, after this, Dovecot starts fine allowing usermin and email clients to connect without problems:</p>
<p><img class="alignleft size-full wp-image-635" alt="dovecot" src="http://www.sxg.com/wp-content/uploads/2013/01/dovecot.gif" width="477" height="32" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/virtualmin-virtual-servers-gpl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server heartbeat</title>
		<link>http://www.sxg.com/server-heartbeat/</link>
		<comments>http://www.sxg.com/server-heartbeat/#comments</comments>
		<pubDate>Sun, 06 Jan 2013 20:16:49 +0000</pubDate>
		<dc:creator>bib</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.sxg.com/?p=599</guid>
		<description><![CDATA[This little perl program allows you to check the availability of an IP address via a cron command that outputs the result in a text file. #!/usr/bin/perl # This script pings IP addresses # # In a live application, read &#8230; <a href="http://www.sxg.com/server-heartbeat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This little perl program allows you to check the availability of an IP address via a cron command that outputs the result in a text file.</p>
<pre>#!/usr/bin/perl
# This script pings IP addresses
#
# In a live application, read host list
# from a config file
@hosts = ("192.168.1.1","192.168.1.19");
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900;
$mon += 1;
$min = sprintf("%02d", $min);
$sec = sprintf("%02d", $sec);
$mon = sprintf("%02d", $mon);
$mday = sprintf("%02d", $mday);
$year = sprintf("%02d", $year % 100);

@live = ();
foreach $h (@hosts) {
        $r = `ping -c2 $h`;
        if ($r =~ /2 re/) {
                push @live,$h;
                }
        }
$alive = "@live";
print ("You have $alive on $mday $mon $year @ $hour:$min:$sec\n");</pre>
<p>This script can then be used in a cron like:</p>
<pre>*/5 * * * * /path/to/file/pingtest.pl &gt;&gt; /some/path/pingtest.txt</pre>
<p>This command will write the result on a new line in the file called pingtest.txt every 5 minutes. Which will look like that:</p>
<pre>You have 192.168.1.1 192.168.1.19 on 06 01 13 @ 20:05:01
You have 192.168.1.1 192.168.1.19 on 06 01 13 @ 20:10:01
You have 192.168.1.1 192.168.1.19 on 06 01 13 @ 20:15:01</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sxg.com/server-heartbeat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
