<?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>Wes Ray &#187; Linux</title>
	<atom:link href="http://www.wessray.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wessray.com</link>
	<description>Just another idiot with a blog</description>
	<lastBuildDate>Fri, 12 Nov 2010 09:21:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring Google&#8217;s Mod_pagespeed for Apache in Fedora or Ubuntu</title>
		<link>http://www.wessray.com/linux/configuring-googles-mod_pagespeed-with-fedora-or-ubuntu/</link>
		<comments>http://www.wessray.com/linux/configuring-googles-mod_pagespeed-with-fedora-or-ubuntu/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 00:26:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>

		<guid isPermaLink="false">http://www.wessray.com/?p=127</guid>
		<description><![CDATA[
		
		
		
		I recently have been on an incredible optimization kick server and application side and tonight I came across a module for Apache written by Google.  Its actually freaking amazing and its running on this site right now.  Right now its combining and minifying my css (had a problem with the js and one [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/linux/configuring-googles-mod_pagespeed-with-fedora-or-ubuntu/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Configuring+Google%26%238217%3Bs+Mod_pagespeed+for+Apache+in+Fedora+or+Ubuntu";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>I recently have been on an incredible optimization kick server and application side and tonight I came across a module for Apache written by Google.  Its actually freaking amazing and its running on this site right now.  Right now its combining and minifying my css (had a problem with the js and one of these shitty wordpress modules so I left it out), removing whitespace, and caching (yes, awesome.) the list goes on and it improved performance quite a bit (fuck ya?). It&#8217;s all done automagically with just a bit of configuration (takes like what, 2 fucking minutes?).</p>
<h2>My Speed Improvments</h2>
<p>Now I have APC, and Memcache doing some dirty work for me and believe me those two make a HUGE difference already, but after installing this I saw about an average of <strong>33%</strong>ish speed improvments.  from about <strong>4-5 second</strong> page loads (have a lot of external shit on here that im about to get rid of).  to about <strong>1.8-3</strong> second page loads.  Believe me it makes a huge difference, and I hope this Google Gold helps you out.</p>
<p>
If you view the source of this page you&#8217;ll notice that there is a lack of whitespace, just one of the optimizations.
</p>
<h2>Lets install mod_pagespeed</h2>
<p>
<strong><a href="http://code.google.com/speed/page-speed/download.html" target="_blank">Download it.</a></strong> The commands below are straight from Google&#8217;s site where the download is located.  But I&#8217;m going to give you a quickstart to configure it, down and dirty, even simple.
</p>
<p>
From what Google says on their page, the Google repository will be added to your system to keep mod_pagespeed upt o date.  If you dont want that, just run the following code before you install</p>
<pre class="brush: bash;">
sudo touch /etc/default/mod-pagespeed
</pre>
</p>
<p>As root run these if you are in a <strong>Debian/Ubuntu</strong> Enviornment.</p>
<pre class="brush: bash;">
dpkg -i mod-pagespeed-*.deb
apt-get -f install
</pre>
</p>
<p>If you are using <strong>Fedora/CentOS</strong></p>
<pre class="brush: bash;">
yum install at
rpm -i mod-pagespeed-*.rpm
</pre>
</p>
<h2>Now lets configure this sucker.</h2>
<p><strong>Debian/Ubuntu Linux distributions</strong></p>
<pre class="brush: bash;">
sudo nano /etc/apache2/mods-available/pagespeed.conf
</pre>
<p>On <strong>CentOS/Fedora</strong>:</p>
<pre class="brush: bash;">
sudo nano /etc/httpd/conf.d/pagespeed.conf
</pre>
</p>
<p>Now that we&#8217;re in the file, just paste this configuration in and restart apache and you&#8217;re good to go, the automagic happens and it fucking works. Place the code below right before the </IfModule> closing tag so you have your own block of configurations.</p>
<p><pre class="brush: bash;">
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters rewrite_css,rewrite_javascript
ModPagespeedEnableFilters inline_css,inline_javascript
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters insert_img_dimensions
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_quotes
ModPagespeedDomain http://www.whateveryoursiteis.com
</pre>
<p>Save the file, and restart apache and notice the huge improvement.</p>
<p>If you want more options, and believe me there are some go to Google <a href="http://code.google.com/speed/page-speed/docs/using_mod.html" target="_blank">directly</a> and read a bit.</p>
<p>Enjoy.</p>
<p>-Wes</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/linux/configuring-googles-mod_pagespeed-with-fedora-or-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Fedora 13 PHP/ MySQL Server with Nginx and reverse proxy to Apache</title>
		<link>http://www.wessray.com/php/configuring-fedora-13-php-mysql-server-with-nginx-and-reverse-proxy-to-apache/</link>
		<comments>http://www.wessray.com/php/configuring-fedora-13-php-mysql-server-with-nginx-and-reverse-proxy-to-apache/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 00:04:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.wessray.com/?p=120</guid>
		<description><![CDATA[
		
		
		
		Ok so I&#8217;m going to make this article quick, simple and to the point.  Fuck the bullshit, lets get ya&#8217;ll setup with nginx with a  reverse proxy to apache in less than an hour.   Now this article is made for VPS type system such as linode or slicehost.  We&#8217;re starting at the point in which [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/php/configuring-fedora-13-php-mysql-server-with-nginx-and-reverse-proxy-to-apache/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Configuring+Fedora+13+PHP%2F+MySQL+Server+with+Nginx+and+reverse+proxy+to+Apache";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Ok so I&#8217;m going to make this article quick, simple and to the point.  Fuck the bullshit, lets get ya&#8217;ll setup with <strong>nginx </strong>with a  reverse proxy to <strong>apache </strong>in less than an hour.   Now this article is made for VPS type system such as linode or slicehost.  We&#8217;re starting at the point in which you have Fedora 13 actually installed, base system.  So lets get started.</p>
<h2>Install Nginx</h2>
<p>Lets start by installing nginx, start the service and configure it to start at boot.</p>
<pre class="brush: bash;">
yum install nginx
service nginx start
chkconfig nginx on
</pre>
<h2>Now lets install php, mysql and some dependencies.</h2>
<p>Was going to use fast-cgi but it crashes so often, so I created a reverse proxy into apache.</p>
<pre class="brush: bash;">
yum install httpd httpd-devel php php-cli php-devel mysql php-mysql mysql-server php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy sendmail
</pre>
<h2>Configuring nginx</h2>
<pre class="brush: bash;">
nano /etc/nginx/nginx.conf
</pre>
<p>Once inside the file, change these two values</p>
<pre class="brush: bash;">
worker_processes  5;
keepalive_timeout  2;
</pre>
<p>Similar to apache you can set virtual hosts.  First lets start by editing the example in the nginx.conf file.</p>
<p>You can define the vhost in server {} containers. Now lets modify the default vhost:</p>
<p>server_name _; makes this a default vhost ( so lets change this to specify a certain domain e.g. www.something.com).</p>
<p>In the location / part, add index.php to the index line. root <strong>/usr/share/nginx/html;</strong>
<p>
This is your DocumentRoot in an apache virtual host, so you can change it to whatever you want..I prefer the /var/www/ directories.
<p>The important part for PHP is the location <strong>~ \.php$ {}</strong> container. You need to uncomment it to enable it. Change the root line to the web site&#8217;s document root (e.g. root /usr/share/nginx/html; or whatever you directory you chose.).  Be sure to pass .php to <strong>127.0.0.1:8080</strong> to proxy php files to apache (we&#8217;ll edit httpd.conf later).</p>
<h2>Apache as proxy</h2>
<pre class="brush: bash;">
nano /etc/httpd/conf/httpd.conf
</pre>
<p>Pass through to apache port 8080</p>
<pre class="brush: bash;">
Listen 127.0.0.1:8080
</pre>
<p>configure the virtualhost to reflect the same path as the nginx vhost.</p>
<h2>Install and configure MySQL</h2>
<p>Make sure its ready for startup and start it up</p>
<pre class="brush: bash;">
chkconfig mysqld on
/etc/init.d/mysqld start
</pre>
<h3>Now lets install MySQL securely</h3>
<pre class="brush: bash;">
mysql_secure_installation
</pre>
<p>
>Enter Current Root Password : <strong>Hit Enter</strong><br />
>Set Root Password : </strong>Hit Enter</strong><br />
Now enter your password twice<br />
The rest are your choice, I hit enter all the way through.
</p>
<h2>Install APC and other Dev Tools</h2>
<p>Lets install some dependencies, most are just needed on a dev server anyway, so group install.  Fail2ban is to keep users from attacking your site, they will be banned after 5 failed attemps to login for 10 mins.  You can change the configuration in /etc/fail2ban/</p>
<pre class="brush: bash;">
yum groupinstall 'Development Tools'
yum groupinstall 'Development Libraries'
yum install php-pecl-apc
yum install fail2ban
yum install mlocate

chkconfig fail2ban on
chkconfig httpd on
chkconfig nginx on
chkconfig mysqld on
updatedb
</pre>
<p> In the fail2ban configuration file you can change additional settings, they are very self explanatory. To edit fail2ban configuration go to:</p>
<pre class="brush: bash;">
nano /etc/fail2ban/jail.conf
</pre>
<p><strong>Now guess what, you&#8217;re done.  If you have any questions, just leave a comment and I&#8217;ll be sure to answer it, enjoy the nginx server.</strong></p>
<h2> Feeling Generous??</h2>
<p>Sign up for a linode VPS, I pay $20 a month and it fucking rocks</p>
<p>My <a href="http://www.linode.com/?r=2bf9ae77ecd8e759a2b79bf1011e1c3147d93525" target="_blank">Linode.com</a> Referral Code <strong>2bf9ae77ecd8e759a2b79bf1011e1c3147d93525</strong></p>
<p>-<strong>Wes</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/php/configuring-fedora-13-php-mysql-server-with-nginx-and-reverse-proxy-to-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring PHP Web server on Fedora 11</title>
		<link>http://www.wessray.com/php/configuring-php-mysql-web-server-on-fedora-11/</link>
		<comments>http://www.wessray.com/php/configuring-php-mysql-web-server-on-fedora-11/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 18:25:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://wessray.com/?p=19</guid>
		<description><![CDATA[Creating a Fedora 11 Web server for php, mysql, apache, ]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/php/configuring-php-mysql-web-server-on-fedora-11/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Configuring+PHP+Web+server+on+Fedora+11";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>This is going to be a quick and simple tutorial on how to setup a Fedora 11 Linux Server with PHP, MySQL, Apache and phpmyadmin.  Now I&#8217;m assuming you already have the OS installed on your machine.  Most of you will be using cloud servers, mine is from <a href="http://www.linode.com/?r=2bf9ae77ecd8e759a2b79bf1011e1c3147d93525" target="_blank"><em><strong>Linode.com</strong></em></a>.  You will need to have shell access to your server.  If you have very little experience with linux I suggest you brush up and learn a <strong><a href="http://howtoforge.com/" target="_blank"><em>little syntax</em></a></strong> so you aren&#8217;t shooting in the dark.</p>
<p>Ok, so lets get started with the actual configuration of the server.   At this point I AM ASSUMING you have the operating system installed and its just a bare canvas.</p>
<h3>Here we go, hold on kids.</h3>
<p>The first step that is needed to taken is open up your terminal, I personally use <strong><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank"><em>PuTTY</em></a></strong>, a free telnet/ssh client.  One you are logged in make sure you have full access to the system, whether it be <strong>root </strong>or <strong>sudo</strong>.</p>
<p>Now lets install PHP and MySQL. These will be commands you type in the terminal.  We will be installing the apache, mysql and php and configuring them.</p>
<ul> <code> </code></p>
<li><strong>yum -y install httpd php mysql mysql-server php-mysql</strong></li>
</ul>
<p>We set chkconfig so that when rebooted the servers will start automatically, and we do this like so.</p>
<ul> <code> </code></p>
<li><strong>chkconfig httpd on</strong></li>
<li><strong>chkconfig mysqld on</strong></li>
</ul>
<p>Now that Apache and MySQL are starting with the server, we can configure MySQL</p>
<ul>
<li><strong>mysqladmin -u root &#8216;root_pw_of_your_choice&#8217;</strong></li>
</ul>
<p>Now lets install phpMyAdmin, a mysql database management tool.</p>
<ul> <code> </code></p>
<li><strong>yum install phpMyAdmin.noarch</strong></li>
</ul>
<p>Since that has been taken care of let, lets open up the phpmyadmin config.</p>
<ul>
<li><strong>nano /etc/httpd/conf.d/phpMyAdmin.conf</strong></li>
</ul>
<p>At this point what we need to do is comment out a certain section. Notice that I have a # which denotes comment out</p>
<p><strong>#&lt;Directory /usr/share/phpMyAdmin/&gt;<br />
#   order deny,allow<br />
#   deny from all<br />
#   allow from 127.0.0.1<br />
#&lt;/Directory&gt;</strong></p>
<p>Next we are going to jump into the httpd.conf, otherwise known as the Apache Config File</p>
<ul>
<li><strong>nano /etc/httpd/conf/httpd.conf</strong></li>
</ul>
<p>Once in there you are going to want to change a section</p>
<p><strong>&lt;Directory /&gt;<br />
Options FollowSymLinks<br />
<span style="color: #000000; background-color: #00ff00;">AllowOverride All</span><br />
&lt;/Directory&gt;</strong></p>
<p>You will want to set it to AllowOverride All, by default it should be set to none, but we dont want that.</p>
<p>Now at the end of the file add these to make your IP address directly or URL go directly to phpMyAdmin unless you set a virtualhost otherwise.  You need to put all of this at the bottom of your<strong> httpd.conf</strong> file</p>
<p><strong>&lt;VirtualHost your.ip:80&gt;<br />
ServerAdmin youremail@server.com<br />
DocumentRoot /usr/share/phpMyAdmin/</p>
<p>ServerName yourIP<br />
ServerAlias yourIP</p>
<p>ErrorLog logs/home-error_log<br />
CustomLog logs/home-access_log common<br />
&lt;/VirtualHost&gt;</p>
<p>Include /etc/httpd/conf/sites-production/*<br />
Include /etc/httpd/conf/sites-development/*</strong></p>
<p>Save and close the conf file and finally create your folders than you included, e.g</p>
<ul>
<li><strong>mkdir /etc/httpd/conf/sites-production</strong></li>
<li><strong>mkdir /etc/httpd/conf/sites-development</strong></li>
</ul>
<p>Now that the config file directories are made, lets make the place holders for the actual website content</p>
<ul>
<li><strong>/var/www/sites-production</strong></li>
<li><strong>/var/www/sites-development</strong></li>
</ul>
<p>That about sums it up for the base server setup on fedora 11 for a linode VPS.  If you want more PHP Packages just run this command and you should have everything you need.</p>
<p><strong>yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel</strong></p>
<p>If you need any MySQL help for setting up users, I reccomend this site</p>
<p><a href="http://www.databasef1.com/tutorial/mysql-create-user.html" target="_blank"> http://www.databasef1.com/tutorial/mysql-create-user.html</a></p>
<p>If any help is needed feel free to leave comments and I will respond.  Good luck!</p>
<h2> Feeling Generous??</h2>
<p>Sign up for a linode VPS, I pay $20 a month and it fucking rocks</p>
<p>My <a href="http://www.linode.com/?r=2bf9ae77ecd8e759a2b79bf1011e1c3147d93525" target="_blank">Linode.com</a> Referral Code <strong>2bf9ae77ecd8e759a2b79bf1011e1c3147d93525</strong></p>
<p>-<strong>Wes</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/php/configuring-php-mysql-web-server-on-fedora-11/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

