<?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>ServerAdmins.NET &#187; howto</title>
	<atom:link href="http://serveradmins.net/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://serveradmins.net</link>
	<description>Stuff for Server Admins...</description>
	<lastBuildDate>Fri, 09 Jul 2010 16:46:09 +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>XCache 1.3.0 install &#8211; with cPanel and CentOS</title>
		<link>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/</link>
		<comments>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 04:57:58 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[opcode]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[xcache]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=79</guid>
		<description><![CDATA[XCache PHP Opcode Cacher installation on CentOS and cPanel]]></description>
			<content:encoded><![CDATA[<p>Hey there!</p>
<p>I figure it&#8217;s been a little bit, so I&#8217;ve gone ahead and decided to update the XCache installer for version 1.3.0, and my favorite control panel, cPanel. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is incredibly easy to do and should get a basic/barebones XCache installation up and going fairly quickly on your CentOS  + cPanel machine.</p>
<p>First, let&#8217;s grab our XCache sources&#8230;<br />
<code><br />
cd /usr/src/<br />
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz<br />
</code></p>
<p>Now, go ahead and unarchive the source, and change into the XCache build dir&#8230;<br />
<code>tar -xzvf xcache-1.3.0.tar.gz<br />
cd xcache-1.3.0<br />
</code></p>
<p>Let&#8217;s prep our sources for the current PHP ecosystem&#8230;<br />
<code><br />
root@SERVER [/usr/src/xcache-1.3.0]# phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
</code></p>
<p>Now that should have gotten everything sorted with our sources so the XCache install is ready for our PHP version and environment, Let&#8217;s go ahead and kick off the build!  Keep in mind, this build should be fairly fast and lightweight.</p>
<p><code><br />
./configure &#038;&#038; make &#038;&#038; make install<br />
</code><br />
The above line basically says &#8220;Run configure, if that is successful w/o errors, run a make, and if that finishes w/o error, run the install&#8221;.  Once this is complete, you should see a line that says something like the following&#8230;<br />
<code><br />
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20060613/<br />
</code><br />
This is going to be where our xcache.so file is located, however when cPanel builds your php.ini file, it&#8217;s going to have that set already.  So getting the base module loaded is as simple as running the following command.<br />
<code><br />
echo "extension=xcache.so" >> /usr/local/lib/php.ini<br />
</code><br />
After that, you should be able to do a quick check of the PHP CLI and verify that it loaded properly with the &#8216;php -v&#8217; command&#8230;<br />
<code><br />
root@SERVER [/usr/src/xcache-1.3.0]# php -v<br />
PHP 5.2.13 (cli) (built: Jun 16 2010 09:27:33)<br />
Copyright (c) 1997-2010 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies<br />
    with XCache v1.3.0, Copyright (c) 2005-2009, by mOo<br />
</code></p>
<p>And there you go, you can safely restart Apache now and you should be serving cached content.  Please keep in mind, you&#8217;ll need to configure your XCache setup to ensure everything is working properly, all we&#8217;ve done here is install the base module.</p>
<p>I&#8217;d suggest taking a look at our other article regarding the tuning of XCache for a bit more information on this. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://serveradmins.net/tuning-xcache-for-fun-and-profit/"></p>
<p>That does it for now!</p>
<p></a></p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto show the current runlevel in linux&#8230;</title>
		<link>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/</link>
		<comments>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/#comments</comments>
		<pubDate>Fri, 28 May 2010 12:51:17 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rc3.d]]></category>
		<category><![CDATA[runlevel]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=76</guid>
		<description><![CDATA[How to detect and change the current runlevel in Linux]]></description>
			<content:encoded><![CDATA[<p>Quick one here, mostly for my own notes than anything else. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>An easy way to see the existing runlevel is with the &#8216;who -r&#8217; command.</p>
<p><code><br />
root@server:~ # who -r<br />
         run-level 3  May 22 03:54                   last=S<br />
</code></p>
<p>Here we show the last boot and current runlevel (3).   In order to modify this, you can open up /etc/inittab and look for the following line.</p>
<p><code><br />
id:3:initdefault:<br />
</code></p>
<p>This shows that runlevel 3 is the default one kicked off by init on a bootup.</p>
<p>For what it&#8217;s worth, this refers to the directories in /etc/rc.d/rcX.d/, where X is  #.  The number correlates to the runlevel of your machine, and all of the scripts stored in that directory are executed when that runlevel is enabled.</p>
<p>TMYK!</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto enable CGI in the builtin OSX webserver</title>
		<link>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/</link>
		<comments>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/#comments</comments>
		<pubDate>Sat, 15 May 2010 00:24:13 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enable]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=74</guid>
		<description><![CDATA[How to setup and enable the builtin Apache webserver in OSX to handle CGI and Perl Applications]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve caught myself writing more code on my Macbook and for the first time in&#8230; YEARS, not needing an internet connection to actually be productive.  To be quite honest, it&#8217;s a bit weird. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, the first thing I wanted was the ability to run/exec CGI via a webserver.   At first, I was thinking I&#8217;d go about a source build of Apache, and then I remembered OSX comes with one built in.    Huzzah!</p>
<p>So, first let&#8217;s enable the builtin webserver.</p>
<p>System Preferences -> Sharing, and then click on &#8220;Web Sharing&#8221;.   Go ahead and close out the window now, you&#8217;ve just fired off Apache.  (hooray!).  You should now be able to open your browser of choice and go to http://127.0.0.1/~<username /.   Since I login as 'chrismm', I go to http://127.0.0.1/~chrismm/ .   Here you should see the nifty default page.</p>
<p>Now, the document root is going to be off of your user account in /sites/.   My user is chrismm on my machine, so /Users/chrismm/Sites/ is my public HTML.   Any web content you want to view with the above URL needs to go off of this directory.  Go ahead and add the obligatory "Helloworld.html", I'll wait. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now that that's done and functioning, I needed to get some hawt hawt Perl/CGI action going on.   This, was incredibly easy.</p>
<p>OSX's main httpd.conf does a per-user http include in /private/etc/apache2/users/<username>.conf, so once again for me, it was /private/etc/apache2/users/chrismm.conf.   This file contains just a super basic Directory configuration for apache to parse and we only need to make one quick change here&#8230;</p>
<p>First and foremost, we need to be the root user, so go ahead and open up Terminal (Finder->Applications->Utilities -> Terminal), and type &#8216;sudo su -&#8217; .   Here, you&#8217;ll be prompted to enter your password.</p>
<p>Keep in mind as soon as you do this, you are the root user on your machine, ***BE VERY CAREFUL AS IF YOU ARE NOT YOU CAN END UP WITH A WORTHLESS WORKSTATION ***.</p>
<p>Now, go ahead and open up the include for your user, at /private/etc/apache2/users/</username><username>.conf, and make the following changes.</p>
<p>Original:<br />
<code><br />
maynard:beta root# cat /private/etc/apache2/users/chrismm.conf<br />
<directory "/Users/chrismm/Sites/"><br />
    Options Indexes MultiViews<br />
    AllowOverride None<br />
    Order allow,deny<br />
    Allow from all<br />
</directory><br />
</code><code></p>
<p>Needs to be changed to....</p>
<p></code><code><br />
maynard:beta root# cat /private/etc/apache2/users/chrismm.conf<br />
<directory "/Users/chrismm/Sites/"><br />
    Options Indexes MultiViews ExecCGI<br />
    AllowOverride None<br />
    Order allow,deny<br />
    Allow from all<br />
</directory><br />
</code></p>
<p>See that?  All I added was &#8220;ExecCGI&#8221; at the end of that Options statement.   We&#8217;re halfway done now!  </p>
<p>One more change&#8230;</p>
<p>Go ahead and open up &#8216;/private/etc/apache2/original/httpd.conf&#8217; in your text editor of choice, and search for &#8221;    #AddHandler cgi-script .cgi&#8221;</p>
<p>Go ahead and remove the &#8216;#&#8217; mark, save and exit.</p>
<p>Now, let&#8217;s restart the webserver&#8230; </p>
<p><code><br />
killall -HUP httpd<br />
</code></p>
<p>Done!</p>
<p>And now, you can use your CGI and be happy. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></username></p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating the FreeBSD Ports tree, easily&#8230;</title>
		<link>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/</link>
		<comments>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:18:00 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[fastest_cvsup]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[portsnap]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=52</guid>
		<description><![CDATA[How to get your FreeBDS ports tree updated and current, one way or another... =)

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m feeling a bit lazy tonight, and wanted to get an update here, so for a bit I&#8217;ll show you a handy little tool to update your ports tree on FreeBSD.  After that, I&#8217;ll show you the ugly, old method.</p>
<p>Quick and easy&#8230;</p>
<p>Newer versions of FreeBSD come equipped with the &#8216;portsnap&#8217; utility.  This, makes it *VERY* simple to update your ports tree.  </p>
<p>For your first run, do this&#8230;<br />
<code><br />
portsnap fetch &#038;&#038; portsnap extract<br />
</code></p>
<p>This is going to grab a snapshot of the current ports tree, and simply extract it over your new tree, replacing *everything* as it goes.  You should only run the &#8216;extract&#8217; command the first time you run portsnap.</p>
<p>After that, you&#8217;ll want to run the following for any further updates&#8230;</p>
<p><code><br />
portsnap fetch &#038;&#038; portsnap update<br />
</code></p>
<p>Not only is this much quicker, it doesn&#8217;t overwrite everything. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to use this in a cron&#8217;d task, you should use the &#8216;portsnap cron 1&#8242; command.   It should be noted the number appended to the end of this is the number in seconds that portsnap will randomize the start of the app from.  For example, if you say &#8216;cron 2000&#8242;, portsnap will kick off *sometime* in the next 2000 seconds.  The reasoning for this is for larger serverfarms.  If you&#8217;re running that in cron on all of them and give portsnap a large window, it will keep them all from starting at the same time, loading the BSD servers and abusing your bandwidth.   I used 1 in the command above as I wasn&#8217;t really looking to use that. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Keep in mind this will only fetch the updates, you still need to update the tree afterwords&#8230;</p>
<p>A cron entry for this would look something like the following&#8230;</p>
<p><code><br />
0 3 * * * root /usr/sbin/portsnap cron &#038;&#038; /usr/sbin/portsnap update<br />
</code></p>
<p>So for normal, day to day operation once you&#8217;ve initialized your ports tree the following is what you&#8217;ll want to use and update.</p>
<p><code><br />
/usr/sbin/portsnap fetch &#038;&#038; /usr/sbin/portsnap update<br />
</code></p>
<p>Now, if you don&#8217;t have portsnap, you should use the following method to update your ports tree.  We&#8217;re going to go oldschool with cvsup here.</p>
<p>Edit:  From reader Bazzoola points out that this is outdated and antiquated and well, he&#8217;s 100% right.   Any current installations of FreeBSD should have the portsnap utility installed so this shouldn&#8217;t be necessary.  Consider it here for the sake of memories. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First of all, let&#8217;s find our fastest cvsup mirror&#8230;</p>
<p><code><br />
[root@R34 ~]# cd /usr/ports/sysutils/fastest_cvsup/<br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]# make &#038;&#038; make install<br />
</code></p>
<p>This is going to install the &#8216;fastest_cvsup&#8217; port&#8230;  Afterwords, for the US locale, you can run the following to find your fastest cvsup mirror&#8230;</p>
<p><code><br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]# fastest_cvsup  -c us<br />
>>  Querying servers in countries: us<br />
--> Connecting to cvsup.us.freebsd.org [72.233.193.64]...<br />
    - server replied: ! Access limit exceeded; try again later<br />
    - time taken: 69.51 ms<br />
--> Connecting to cvsup2.us.freebsd.org [130.94.149.166]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 27.19 ms<br />
--> Connecting to cvsup3.us.freebsd.org [128.31.0.28]...<br />
    - server replied: ! Access denied<br />
    - time taken: 31.65 ms<br />
--> Connecting to cvsup4.us.freebsd.org [149.20.64.73]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 55.77 ms<br />
--> Connecting to cvsup5.us.freebsd.org [208.83.20.166]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 36.99 ms<br />
--> Connecting to cvsup6.us.freebsd.org [64.202.113.190]...<br />
    * error: connect: Invalid argument<br />
--> Connecting to cvsup7.us.freebsd.org [64.215.216.140]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.64 ms<br />
--> Connecting to cvsup8.us.freebsd.org [216.165.129.134]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 6.23 ms<br />
--> Connecting to cvsup9.us.freebsd.org [128.205.32.21]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.28 ms<br />
--> Connecting to cvsup10.us.freebsd.org [69.147.83.48]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 54.01 ms<br />
--> Connecting to cvsup11.us.freebsd.org [63.87.62.77]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 35.11 ms<br />
--> Connecting to cvsup12.us.freebsd.org [128.205.32.24]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.86 ms<br />
--> Connecting to cvsup13.us.freebsd.org [128.205.32.24]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.54 ms<br />
--> Connecting to cvsup14.us.freebsd.org [216.87.78.137]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 34.63 ms<br />
--> Connecting to cvsup15.us.freebsd.org [35.9.37.225]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 23.49 ms<br />
--> Connecting to cvsup16.us.freebsd.org [128.143.108.35]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 23.47 ms<br />
--> Connecting to cvsup17.us.freebsd.org [65.212.71.21]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 35.93 ms<br />
--> Connecting to cvsup18.us.freebsd.org [128.205.32.84]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 3026.06 ms</p>
<p>>>  Speed Daemons:<br />
    - 1st: cvsup8.us.freebsd.org    6.23 ms<br />
    - 2st: cvsup16.us.freebsd.org   23.47 ms<br />
    - 3st: cvsup15.us.freebsd.org   23.49 ms<br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]#<br />
</code></p>
<p>Cvsup8 it is!</p>
<p>So now, let&#8217;s get our ports-supfile in place&#8230;</p>
<p><code><br />
cp /usr/share/examples/cvsup/ports-supfile /root/<br />
</code></p>
<p>Now edit /root/ports-supfile and look for the following line&#8230;</p>
<p><code>*default host=CHANGE_THIS.FreeBSD.org</code></p>
<p>And modify it to read&#8230;<br />
<code>*default host=csup8.freebsd.org</code></p>
<p>Now, run the following to get *everything* up to date&#8230;</p>
<p><code><br />
cvsup -g -L 2 /root/ports-supfile<br />
</code></p>
<p>Voila, you have an updated ports tree. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->