<?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>Brandon Checketts &#187; Linux System Administration</title> <atom:link href="http://www.brandonchecketts.com/archives/category/linux-system-administration/feed" rel="self" type="application/rss+xml" /><link>http://www.brandonchecketts.com</link> <description>Web Programming, Linux System Administation, and other geeky stuff</description> <lastBuildDate>Sun, 25 Jul 2010 00:50:58 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Southeast Linux Fest Presentation on MySQL Replication</title><link>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication</link> <comments>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication#comments</comments> <pubDate>Mon, 14 Jun 2010 02:01:51 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LUG]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=460</guid> <description><![CDATA[I was fortunate to be selected to give a presentation at the 2010 Southeast Linux Fest held this year in Greenville, SC. The topic was MySQL replication which I picked from a similar presentation I gave about about 1.5 years ago at my local LUG.   I&#8217;ve configured plenty of replicated servers and I [...]]]></description> <content:encoded><![CDATA[<p>I was fortunate to be selected to give a presentation at the 2010 <a
href="http://www.southeastlinuxfest.org/">Southeast Linux Fest</a> held this year in Greenville, SC. The topic was MySQL replication which I picked from a similar presentation I gave about about 1.5 years ago at my <a
href="http://www.uga.edu/chugalug/">local LUG</a>.   I&#8217;ve configured plenty of replicated servers and I think that I understand it well enough to explain it to others.</p><p>The 2-hour presentation is about half slides and half demo.  Throughout the course of the presentation I set up a simple master-slave.  Then I add a second slave.   Taking it a step farther I set up the three servers to replicate in a chain, and finally I configure them to replicate in a full circle so that changes made on one are propagated to all of the others.  I intentionally do things that break replication at certain points to show some of the limitations and configurable features that can help it to work.</p><p>Slides for the presentation are available <a
href="/downloads/self2010-mysql-replication.odp">OpenOffice format</a>.</p><p>The presentation was recorded, so hopefully the SELF team will have those videos available shortly.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Skipping the DROP TABLE, CREATE TABLE statements in a large mysqldump file.</title><link>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements</link> <comments>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements#comments</comments> <pubDate>Wed, 28 Apr 2010 14:03:52 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=451</guid> <description><![CDATA[I have a large table of test data that I&#8217;m copying into some development environments.  I exported the table with a mysqldump which has a DROP TABLE and CREATE TABLE statements at the topDROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
`somecol` varchar(10) NOT NULL default '',
... other columns ...
[...]]]></description> <content:encoded><![CDATA[<p>I have a large table of test data that I&#8217;m copying into some development environments.  I exported the table with a mysqldump which has a DROP TABLE and CREATE TABLE statements at the top</p><pre>
DROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
  `somecol` varchar(10) NOT NULL default '',
   ... other columns ...
  PRIMARY KEY  (`somecol`),
  KEY `isbn10` (`somecol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
</pre><p>The problem is that the developer has altered the table and re-importing the test data would undo those changes.  Editing the text file is impractical because of its size (500 MB gzipped).  So I came up with this workaround which just slightly alters the SQL using sed so that it doesn&#8217;t try to drop or recreate the table.  It comments out the DROP TABLE line, and creates the new table in the test database instead of the real database.</p><pre>
zcat bigfile.sql.gz |sed "s/DROP/-- DROP/"|sed "s/CREATE TABLE /CREATE TABLE test./"|mysql databasename
</pre>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Sleeping for a random amount of time in a shell script</title><link>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script</link> <comments>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script#comments</comments> <pubDate>Fri, 26 Mar 2010 21:17:05 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=444</guid> <description><![CDATA[You can use the special $RANDOM environment variable to get a random number and divide it by the maximum number of seconds that you want to wait.  Use the remainder as the number of seconds to sleep since it will always be between zero and the max you specified.  This example will sleep [...]]]></description> <content:encoded><![CDATA[<p>You can use the special $RANDOM environment variable to get a random number and divide it by the maximum number of seconds that you want to wait.  Use the remainder as the number of seconds to sleep since it will always be between zero and the max you specified.  This example will sleep anywhere between zero and 10 minutes (600 seconds)</p><pre>
 /bin/sleep/sleep   `/usr/bin/expr $RANDOM % 600`
</pre><p>Purists will note that it isn&#8217;t truly random.  The maximum value for $RANDOM is 32767 which is not evenly divisible by most likely values, but it is close enough.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Installing SVN and Trac on a CentOS 5 server</title><link>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server</link> <comments>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server#comments</comments> <pubDate>Fri, 19 Mar 2010 20:13:35 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=442</guid> <description><![CDATA[Make sure that you have the RPMForge repository enabled.  Install Subversion, mod_dav_svn, and trac.  This will install a few required dependencies (ie: neon and some python utils)# yum install subversion mod_dav_svn mod_python tracCreate a directory for your repositories, and an initial repository for testing, and create your htpasswd file.  Then create a [...]]]></description> <content:encoded><![CDATA[<p>Make sure that you have the <a
href="https://rpmrepo.org/RPMforge/Using">RPMForge repository enabled</a>.  Install Subversion, mod_dav_svn, and trac.  This will install a few required dependencies (ie: neon and some python utils)</p><pre>
# yum install subversion mod_dav_svn mod_python trac
</pre><p>Create a directory for your repositories, and an initial repository for testing, and create your htpasswd file.  Then create a trac environment and set it up.</p><pre>
# mkdir /home/svn/
# svnadmin create testrepo
# chown -R apache:apache /home/svn/*
# htpasswd -c  /home/svn/.htpasswd brandon

#mkdir /home/trac/
# trac-admin /home/trac/ initenv
    ... answer questions as appropriate ...
# chown apache:apache /home/trac/*
# htpasswd -c  /home/svn/.htpasswd brandon
</pre><p>Add this to your Apache configuration in the relevant place (I like to put it under an SSL VirtualHost)</p><pre>
    &lt;Location /svn&gt;
        DAV svn
        SVNParentPath /home/svn/
        #SVNListParentPath on
        # Authentication
        AuthType Basic
        AuthName "RoundSphere SVN Repository"
        AuthUserFile /home/svn/.htpasswd
        Order deny,allow
        Require valid-user
    &lt;/Location&gt;
    &lt;Location /trac&gt;
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /home/trac
        PythonOption TracUriRoot /trac
        # Authentication
        AuthType Basic
        AuthName “MyCompany Trac Environment"
        AuthUserFile /home/svn/.htpasswd
        Require valid-user
    &lt;/Location&gt;
</pre><p>Now test to make sure that you can view your test repository in a browser and that it prompts for a username and password as desired:</p><p>https://your-hostname/svn/testrepo/</p><p>You should retrieve a plain looking page that mentions the name of your repository and that it is at Revision 0</p><p>You should also be able to access your trac installation at</p><p>https://your-hostname/trac/</p><p>Customize your logo, change the home page, start making some tickets, using the wiki and get to work.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Installing the Pandora One client on 64-bit Ubuntu 9.10</title><link>http://www.brandonchecketts.com/archives/installing-the-pandora-one-client-on-64-bit-ubuntu-910</link> <comments>http://www.brandonchecketts.com/archives/installing-the-pandora-one-client-on-64-bit-ubuntu-910#comments</comments> <pubDate>Tue, 26 Jan 2010 16:51:41 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Linux Desktop]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=436</guid> <description><![CDATA[I was surprised and happy to see that the Pandora One client should work on Linux.  It uses the Adobe Air framework which means that Pandora doesn&#8217;t have to write a specific Linux variant.
However, installing it on a modern 64-Bit Ubuntu 9.10 install took just a bit of manipulation to get it [...]]]></description> <content:encoded><![CDATA[<p>I was surprised and happy to see that the <a
href="http://www.pandora.com/desktop_app">Pandora One client</a> <strong>should</strong> work on Linux.  It uses the Adobe Air framework which means that Pandora doesn&#8217;t have to write a specific Linux variant.</p><p>However, installing it on a modern 64-Bit Ubuntu 9.10 install took just a bit of manipulation to get it to work.  Pandora provides some basic instructions for Linux users <a
href="http://blog.pandora.com/faq/#1662">here</a>, even though Linux is officially unsupported.  Those instructions, along with the Adobe AIR notes <a
href="http://kb2.adobe.com/cps/408/kb408084.html">here</a> provided enough information for me to get it installed and working.</p><p>Here&#8217;s what I did:</p><ul><li>Start out <a
href="http://www.pandora.com/desktop_app">at the Pandora One site</a></li><li>Click on the &quot;Download Pandora Desktop&quot; link and save that file to /tmp</li><li>Follow the link to Install Adobe Air and save that file to /tmp also</li><li>Open a shell, and chmod the Adobe Air installer to 755 and then run it.</li><li>Go through the Adobe AIR install until it completes</li><li>Once Adobe AIR is installed, you will need to put some 32-bit libraries in place to make it run correctly. Some of the steps on <a
href="http://kb2.adobe.com/cps/408/kb408084.html">Adobe&#8217;s site</a> work, and some don&#8217;t, so this is what I did</li><li>Download the two .deb files for <a
href="http://mirrors.kernel.org/ubuntu/pool/main/n/nss/libnss3-1d_3.12.0%7Ebeta3-0ubuntu1_i386.deb">libnss3</a> and <a
href="http://mirrors.kernel.org/ubuntu/pool/main/n/nspr/libnspr4-0d_4.7.1%7Ebeta2-0ubuntu1_i386.deb">Libnspr4</a> to /tmp</li><li>From your shell, run:<pre>
 sudo file-roller ./libnss3-1d_3.12.0~beta3-0ubuntu1_i386.deb
</pre></li><li>Navigate to data.tar.gz =&gt; /usr =&gt; lib.  Click on all of the files in that directory and click Extract.  Type in /usr/lib32/ so that they extract there, then close all of the file-roller windows.</li><li>Do the same thing with the libnspr4 .deb file that you downloaded</li><li>Copy the adobe cert store into place with this command:<pre>
 sudo cp /usr/lib/libadobecertstore.so /usr/lib32
</pre></li><li>Now you can finally install the Pandora application by running:<pre>
sudo Adobe\ AIR\ Application\ Installer /tmp/pandora_2_0_2.air
</pre><p> That should install the application correctly.  It will add an icon to Applications / Accessories.</li><li>Upon starting up the Pandora One client, it currently complains about connecting to an untrusted server for me.  I have to click to accept for this session each time</li></ul><p>Now you should be able to play your Pandora music from your 64-bit Ubuntu 9.10 box.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/installing-the-pandora-one-client-on-64-bit-ubuntu-910/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Speed up a Linux Software Raid Rebuild</title><link>http://www.brandonchecketts.com/archives/speed-up-a-linux-software-raid-rebuild</link> <comments>http://www.brandonchecketts.com/archives/speed-up-a-linux-software-raid-rebuild#comments</comments> <pubDate>Mon, 25 Jan 2010 21:08:16 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Data Recovery]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=432</guid> <description><![CDATA[I&#8217;m setting up software raid on a running server and it is taking forever for the initial sync of the raid drives on the 1TB hard disks.  It has been running for about 6 hours and says that it will take about 5 days (7400 minutes) as this pace:[root@host ~]# cat /proc/mdstat
md1 : active [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m <a
href="http://www.brandonchecketts.com/archives/setting-up-software-raid-on-a-running-centos-5-server">setting up software raid on a running server</a> and it is taking forever for the initial sync of the raid drives on the 1TB hard disks.  It has been running for about 6 hours and says that it will take about 5 days (7400 minutes) as this pace:</p><pre>
[root@host ~]# cat /proc/mdstat
md1 : active raid1 sdb3[1] sda3[2]
      974559040 blocks [2/1] [_U]
      [>....................]  recovery =  3.9% (38109184/974559040) finish=7399.1min speed=2108K/sec
</pre><p>I did some read and write tests directly to the drives using dd to make sure that they were working okay, and they can operate at about 100 MB/s</p><pre>
[root@host ~]# dd if=/dev/zero of=/dev/sda2 bs=1024 count=1024000
    1048576000 bytes (1.0 GB) copied, 10.8882 seconds, 96.3 MB/s
[root@host ~]# dd if=/dev/zero of=/dev/sdb2 bs=1024 count=1024000
    1048576000 bytes (1.0 GB) copied, 11.1162 seconds, 94.3 MB/s
[root@host ~]# dd if=/dev/sda2 of=/dev/null bs=1024 count=1024000
    1048576000 bytes (1.0 GB) copied, 10.2829 seconds, 102 MB/s
[root@host ~]# dd if=/dev/sdb2 of=/dev/null bs=1024 count=1024000
    1048576000 bytes (1.0 GB) copied, 10.5109 seconds, 99.8 MB/s
</pre><p>What I failed to realize is that there is a configurable limit for the min and max speed of the rebuild.  Those parameters are configured in /proc/sys/dev/raid/speed_limit_min and /proc/sys/dev/raid/speed_limit_max.   They default to a pretty slow 1MB/s minimum which was causing it to take forever.</p><p>Increasing the maximum limit didn&#8217;t automatically make it faster either.  I had to increase the minimum limit to get it to jump up to a respectable speed.</p><p>[root@host ~]# echo 100000 > /proc/sys/dev/raid/speed_limit_min</p><pre>
[root@host ~]# watch cat /proc/mdstat
Every 2.0s: cat /proc/mdstat
md1 : active raid1 sdb3[1] sda3[2]
      974559040 blocks [2/1] [_U]
      [=>...................]  recovery =  7.7% (75695808/974559040) finish=170.5min speed=87854K/sec
</pre><p>Now it is up around 87 MB/s and will take just a few hours to complete the rest of the drive.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/speed-up-a-linux-software-raid-rebuild/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>PHP Wrapper Class for a Read-only database</title><link>http://www.brandonchecketts.com/archives/php-wrapper-class-for-a-read-only-database</link> <comments>http://www.brandonchecketts.com/archives/php-wrapper-class-for-a-read-only-database#comments</comments> <pubDate>Tue, 05 Jan 2010 04:11:58 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=421</guid> <description><![CDATA[This is a pretty special case of a database wrapper class where I wanted to discard any updates to the database, but want SELECT queries to run against an alternative read-only database.  In this instance, I have a planned outage of a primary database server, but would like the public-facing websites and web services [...]]]></description> <content:encoded><![CDATA[<p>This is a pretty special case of a database wrapper class where I wanted to discard any updates to the database, but want SELECT queries to run against an alternative read-only database.  In this instance, I have a planned outage of a primary database server, but would like the public-facing websites and web services to remain as accessible as possible.</p><p>I wrote this quick database wrapper class that will pass all SELECT queries on to a local replica of the database, and silently discard any updates.   On this site almost all of the functionality still works, but it obviously isn&#8217;t saving and new information while the primary database is unavailable.</p><p>Here is my class.  This is intended as a wrapper to an ADOdb class, but it is generic enough that I think it would work for many other database abstraction functions as well.</p><pre>
class db_unavailable {
    var $readonly_db;

    function __construct($readonly_db)
    {
        $this->query_db = $readonly_db;
    }

    function query($sql)
    {
        $args = func_get_args();
        if (preg_match("#(INSERT INTO|REPLACE INTO|UPDATE|DELETE)#i", $args[0])) {
            // echo "Unable to do insert/replace/update/delete query: $sql\n";
            return true;
        } else {
            return call_user_func_array(array($this->readonly_db, 'query'), $args);
        }
    }

    function __call($function, $args)
    {
        return call_user_func_array(array($this->readonly_db, $function), $args);
    }
}
</pre><p>I simply create my $query_db object that points to the read-only database.  Then create my main $db object as a new db_unavailable() object.  Any select queries against $db will behave as they normally do, and data-modifying queries will be silently discarded.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/php-wrapper-class-for-a-read-only-database/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Booting from a Software Raid device on Ubunto Karmic (9.10)</title><link>http://www.brandonchecketts.com/archives/booting-from-a-software-raid-device-on-ubunto-karmic-910</link> <comments>http://www.brandonchecketts.com/archives/booting-from-a-software-raid-device-on-ubunto-karmic-910#comments</comments> <pubDate>Mon, 26 Oct 2009 19:00:41 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=411</guid> <description><![CDATA[Its a few days away from Karmic&#8217;s official release, and I&#8217;m putting together a new computer and thought I would give the new version a try.  I set everything up with Software raid, and it is still annoying to me that to do so on Ubuntu still requires the Alternate CD and a text-based [...]]]></description> <content:encoded><![CDATA[<p>Its a few days away from Karmic&#8217;s official release, and I&#8217;m putting together a new computer and thought I would give the new version a try.  I set everything up with Software raid, and it is still annoying to me that to do so on Ubuntu still requires the Alternate CD and a text-based install.</p><p>I configured the /boot partition to use a RAID1 array, as I normally do.  After getting most of the way through the install, I got a big red screen with the following error:</p><pre>
====================================
Unable to install GRUB in /dev/md0
Executing 'grub-install /dev/md0 failed'
This is a fatal error
====================================
</pre><p>I tried several variations on continuing, but nothing seemed to work.   Turns out that a <a
href="http://www.ubuntu.com/testing/karmic/beta?info=EXLINK">known issue</a> with Karmic is that this doesn&#8217;t work.  Actually the known issue says that grub is only installed to the first drive, but that was not my experience.</p><p><a
href="https://bugs.launchpad.net/bugs/427048">Bug 420748</a> gives some detail on the issue, and it seems that the change to Grub2 might have something to do with it.  From the red screen, I chose to proceed without installing a boot loader.  I Rebooted to Alternate CD, and chose to repair a broken installation. Once to a shell, I ran these commands to install grub to the master boot records on both drives</p><pre>
grub-install /dev/sda
grub-install /dev/sdb
</pre><p>I removed the CD and rebooted. It ended up at a grub shell. At which point I ran the following to boot into the system (note the difference in grub2 commands)</p><pre>
set root=(hd0,1)
linux /vmlinuz-2.6.31-14-generic ro root=/dev/md1 (use tab-completion on the kernel image filename)
initrd /initrd.img-2.6.31-14-generic (again, use tab-completion)
boot
</pre><p>At that point, it started up normally. Once logged in, I started a terminal and then ran this command as root to create a minimal grub.cfg file (note that it is no longer called menu.lst)</p><pre>
grub-mkconfig > /boot/grub/grub.cfg
</pre><p>I&#8217;m now able to reboot into a working system.  So much for a flawless install experience.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/booting-from-a-software-raid-device-on-ubunto-karmic-910/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Setting Up Virtualmin on an OpenVZ Guest</title><link>http://www.brandonchecketts.com/archives/setting-up-virtualmin-on-an-openvz-guest</link> <comments>http://www.brandonchecketts.com/archives/setting-up-virtualmin-on-an-openvz-guest#comments</comments> <pubDate>Mon, 07 Sep 2009 17:42:04 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Add new tag]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=399</guid> <description><![CDATA[I&#8217;m experimenting with a hosting control panel and am interested in Virtualmin.   I generally avoid web-based control panels, because they generally make direct configuration via the command line and manually editing config files very difficult.  However one of Virtualmin&#8217;s goals is to not interfere with such manual configurations.   I&#8217;ve had [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m experimenting with a hosting control panel and am interested in <a
href="http://www.virtualmin.com/">Virtualmin</a>.   I generally avoid web-based control panels, because they generally make direct configuration via the command line and manually editing config files very difficult.  However one of Virtualmin&#8217;s goals is to not interfere with such manual configurations.   I&#8217;ve had plenty of clients who use Webmin, and they seem to do a good job, so Virtualmin seems like a good choice.</p><p>These are the steps that I went through to get a new OpenVZ guest set up with the GPL version of Virtualmin.</p><p>Download a CentOS 5 OS template and create the guest</p><pre>
# wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz
# vzctl create &lt;VEID&gt; --ostemplate centos-5-x86_64
</pre><p>I replaced all of these limits in /etc/vz/&lt;VEID&gt;.conf.  This is based off of a different running machine with some fairly generous limits.   Most importantly, it includes 1GB of RAM.</p><pre>
# UBC parameters (in form of barrier:limit)
KMEMSIZE="43118100:44370492"
LOCKEDPAGES="256:256"
PRIVVMPAGES="262144:262144"
SHMPAGES="21504:21504"
NUMPROC="2000:2000"
PHYSPAGES="0:9223372036854775807"
VMGUARPAGES="65536:65536"
OOMGUARPAGES="26112:9223372036854775807"
NUMTCPSOCK="360:360"
NUMFLOCK="380:420"
NUMPTY="16:16"
NUMSIGINFO="256:256"
TCPSNDBUF="10321920:16220160"
TCPRCVBUF="1720320:2703360"
OTHERSOCKBUF="4504320:16777216"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="5000:5000"
DCACHESIZE="3409920:3624960"
NUMFILE="18624:18624"
AVNUMPROC="180:180"
NUMIPTENT="128:128"
</pre><p>Then set up some host-specific parameters and start it up.</p><pre>
# vzctl set &lt;VEID&gt; --ipadd 10.0.0.1 --hostname yourhostname.com --nameserver 4.2.2.1 --diskspace 4G --save
# vzctl start &lt;VEID&gt;
# vzctl enter &lt;VEID&gt;
</pre><p>You are now logged in to the guest, where you can download and install virtualmin</p><pre>
# yum update
# cd /root
# wget http://software.virtualmin.com/gpl/scripts/install.sh
# sh install.sh
 Continue? (y/n) y
</pre><p>That should install without significant errors.  Finally, set a password for root, and then log in to Virtualmin to go through the post-installation configuration</p><pre>
passwd root
</pre><p>Login at https://&lt;your-ip&gt;:10000/  and go through the post-installation configuration</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/setting-up-virtualmin-on-an-openvz-guest/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ProFTPd allows multipled DefaultRoot lines for flexible chrooting</title><link>http://www.brandonchecketts.com/archives/proftpd-allows-multipled-defaultroot-lines-for-flexible-chrooting</link> <comments>http://www.brandonchecketts.com/archives/proftpd-allows-multipled-defaultroot-lines-for-flexible-chrooting#comments</comments> <pubDate>Thu, 02 Jul 2009 19:25:45 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Security]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=385</guid> <description><![CDATA[The ProFTPd documentation gives good examples of how to use the DefaultRoot directive to chroot users to a specific directory.
A customer today wanted to have different chroot directories for different groups of users.  The documentation didn&#8217;t mention if it was okay to include multiple DefaultRoot lines.  After some experimenting, I can verify [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://www.proftpd.org/docs/directives/linked/config_ref_DefaultRoot.html">ProFTPd documentation</a> gives good examples of how to use the DefaultRoot directive to chroot users to a specific directory.</p><p>A customer today wanted to have different chroot directories for different groups of users.  The documentation didn&#8217;t mention if it was okay to include multiple DefaultRoot lines.  After some experimenting, I can verify that it is allowed and works well.</p><p>I used something like this in /etc/proftpd/proftpd.conf</p><pre>
DefaultRoot                     ~ jailed
DefaultRoot                     ~/../.. othergroup
</pre><p>Users in the group &#8216;jailed&#8217; are chrooted to their own home directory immediately upon logging in.   Users in the &#8216;othergroup&#8217; are chrooted two levels up from their home directory.  If you want to get really specific, each user generally has a group of their own, so you can effectively do this a the user-level as well.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/proftpd-allows-multipled-defaultroot-lines-for-flexible-chrooting/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 5/12 queries in 0.120 seconds using disk

Served from: www.brandonchecketts.com @ 2010-09-10 16:10:13 -->