<?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>maxgarrick.com &#187; tuning</title>
	<atom:link href="http://maxgarrick.com/tag/tuning/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxgarrick.com</link>
	<description>Come take a look under the hood</description>
	<lastBuildDate>Sun, 08 Mar 2009 23:32:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to create a minimal LAMP stack in OpenVZ</title>
		<link>http://maxgarrick.com/how-to-create-a-minimal-lamp-stack-in-openvz/</link>
		<comments>http://maxgarrick.com/how-to-create-a-minimal-lamp-stack-in-openvz/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 00:01:38 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://maxgarrick.com/?p=36</guid>
		<description><![CDATA[Creating a minimal LAMP stack in OpenVZ:
Start with a pre-created centos-5 OpenVZ template &#38; install required packages:


# Create centos-5 OpenVZ container:
vzctl create 1056 --ostemplate centos-5-x86_64-minimal
vzctl set 1056 --ipadd 192.168.0.56 --nameserver 123.123.123.123 --save
vzctl start 1056

# Update software &#38; install packages:
vzctl 1056 install yum
vzctl enter 1056
yum upgrade

# Install packages -- the &#34;.x86_64&#34; tells yum to only
# install [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a minimal LAMP stack in OpenVZ:</p>
<p>Start with a pre-created centos-5 OpenVZ template &amp; install required packages:</p>
<pre class="brush: bash">

# Create centos-5 OpenVZ container:
vzctl create 1056 --ostemplate centos-5-x86_64-minimal
vzctl set 1056 --ipadd 192.168.0.56 --nameserver 123.123.123.123 --save
vzctl start 1056

# Update software &amp; install packages:
vzctl 1056 install yum
vzctl enter 1056
yum upgrade

# Install packages -- the &quot;.x86_64&quot; tells yum to only
# install the 64-bit packages and not the i386 packages.
yum install vim-enhanced.x86_64 mysql.x86_64 mysql-server.x86_64 \
httpd.x86_64 httpd-devel.x86_64 wget.x86_64 which.x86_64 \
php.x86_64 make.x86_64 gcc.x86_64 gcc-c++.x86_64

# Clean up leftover files from yum:
yum clean all
</pre>
<p>Next, tune Apache to fit our development 256MB OpenVZ container. If you have more memory dedicated to your container, consider increasing these settings. Edit the prefork MPM section of /etc/httpd/conf/httpd.conf:</p>
<pre class="brush: php">
&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;&amp;lt;&lt;/span&gt;IfModule prefork.c&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;
StartServers       2
MinSpareServers    1
MaxSpareServers   8
ServerLimit      8
MaxClients       8
MaxRequestsPerChild  4000
&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;lt;/IfModul&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: white; color: black; display: inline; font-size: inherit;&quot;&gt;e&amp;gt;&lt;/span&gt;&lt;/span&gt;
</pre>
<p>Let&#8217;s lock down the MySQL root user before starting up services:</p>
<pre class="brush: bash">
mysql -u root mysql
mysql&gt; update user set password=password(&#039;mynewsecurepassword&#039;) \
where user=&#039;root&#039;;
mysql&gt; flush privileges;
mysql&gt; exit
</pre>
<p>Start services and ensure that services start when the machine boots up:</p>
<pre class="brush: bash">
chkconfig --levels 345 httpd
chkconfig --levels 345 mysqld
service httpd start
service mysqld start
</pre>
<p>Finally: test!</p>
<p>This will give you a slimmed down LAMP stack, suitable for running small web applications on top.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxgarrick.com/how-to-create-a-minimal-lamp-stack-in-openvz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
