<?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>Analysis and Review &#187; Apache</title>
	<atom:link href="http://analysisandreview.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://analysisandreview.com</link>
	<description>Brain Dumps For All</description>
	<lastBuildDate>Thu, 26 Jan 2012 20:58:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FreeBSD 8 LAMP Install for WordPress</title>
		<link>http://analysisandreview.com/unix/freebsd-8-lamp-install-for-wordpress/</link>
		<comments>http://analysisandreview.com/unix/freebsd-8-lamp-install-for-wordpress/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:48:15 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[BAMP]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[FAMP]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[Rollback]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=658</guid>
		<description><![CDATA[How to install FreeBSD 8 for WordPress. It&#8217;s a basic LAMP install but since we&#8217;re not using linux it should be called BAMP or maybe FAMP? Who cares.. here are the steps to install FreeBSD 8 with apache, mySQL, PHP then install wordpress. I&#8217;ll be using ports of course for this entire install. I&#8217;m assuming ]]></description>
			<content:encoded><![CDATA[<p><a href="http://analysisandreview.com/wp-content/blogs.dir/5/files/uploads/2010/02/beastie.png"><img class="alignright size-full wp-image-683" src="http://analysisandreview.com/wp-content/blogs.dir/5/files/uploads/2010/02/beastie.png" alt="" width="178" height="196" /></a>How to install FreeBSD 8 for WordPress. It&#8217;s a basic LAMP install but since we&#8217;re not using linux it should be called BAMP or maybe FAMP? Who cares.. here are the steps to install FreeBSD 8 with apache, mySQL, PHP then install wordpress.</p>
<p>I&#8217;ll be using ports of course for this entire install. I&#8217;m assuming that you have the proper hardware for this type installation.</p>
<p>Start with a minimal installation of freeBSD 8</p>
<p><span id="more-658"></span></p>
<p>Bypass the headache and host on vps or dedicated servers with <a rel="nofollow" href="http://www.dpbolvw.net/click-2907135-10751178" target="_blank">pre-installed LAMP here</a>.</p>
<p>Update the server ports &#8211; <a rel="nofollow" href="http://www.freebsd.org/doc/handbook/ports-using.html" target="_blank">freebsd guide on ports</a></p>
<p>First update your port tree</p>
<pre class="brush: bash; title: ; notranslate">portsnap fetch update *if this is the first time do a portsnap fetch extract</pre>
<p>List available update</p>
<pre class="brush: bash; title: ; notranslate">pkg_version -vIL=</pre>
<p>Once you have updated your Ports Collection, before attempting a port upgrade, you should check /usr/ports/UPDATING. This file describes various issues and additional steps users may encounter and need to perform when updating a port, including such things as file format changes, changes in locations of configuration files, or other such incompatibilities with previous versions.</p>
<p>Upgrade your ports with</p>
<pre class="brush: bash; title: ; notranslate">portupgrade -rR</pre>
<p>Okay now that your freeBSD server ports are updates lets do Binary updates <a rel="nofollow" href="http://www.freebsd.org/doc/en/books/handbook/updating-freebsdupdate.html" target="_blank">freebsd-update</a>.</p>
<pre class="brush: bash; title: ; notranslate">freebsd-update fetch</pre>
<pre class="brush: bash; title: ; notranslate">freebsd-update install</pre>
<p>Then reboot</p>
<pre class="brush: bash; title: ; notranslate">shutdown -r now</pre>
<p>Verify update took place</p>
<pre class="brush: bash; title: ; notranslate">uname -a</pre>
<p>Rollback if necessary</p>
<pre class="brush: bash; title: ; notranslate">freebsd-update rollback</pre>
<p><strong>Now lets install Apache, PHP, mysql and phpMyAdmin on your freeBSD 8 web server.</strong></p>
<p>First install the latest <strong>apache </strong>from ports.</p>
<pre class="brush: bash; title: ; notranslate">cd /usr/ports/www/apache22/
make config install clean
echo 'apache22_enable=&quot;YES&quot;' &lt;&lt; /etc/rc.conf
echo 'apache22ssl_enable=&quot;YES&quot;' &lt;&lt; /etc/rc.conf
echo 'accf_http_ready=&quot;YES&quot;' &lt;&lt; /etc/rc.conf &amp;amp;&amp;amp; kldload accf_http</pre>
<p>Now install <strong>PHP</strong></p>
<pre class="brush: bash; title: ; notranslate">cd /usr/ports/lang/php5
make config install clean
cd /usr/ports/lang/php5-extensions  ** enable &lt;strong&gt;mysql &lt;/strong&gt;extensions **
make config install clean</pre>
<p>Now modify your httpd.conf &#8211; Add the following entries to /usr/local/etc/apache22/httpd.conf directly after all the LoadModule lines</p>
<pre class="brush: bash; title: ; notranslate">AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps</pre>
<p>now locate IfModule mod_dir.c and add index.php</p>
<pre class="brush: bash; title: ; notranslate">DirectoryIndex index.php index.html index.htm</pre>
<p>Last but not least get a good php.ini file setup</p>
<pre class="brush: bash; title: ; notranslate">cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini</pre>
<p>Restart apache and</p>
<pre class="brush: bash; title: ; notranslate">/usr/local/etc/rc.d/apache22 start</pre>
<p>Now its time for <strong>mySQL </strong>installation, configuration and setup</p>
<pre class="brush: bash; title: ; notranslate">cd /usr/ports/databases/mysql50-server
make install WITH_OPENSSL=yes
make distclean
echo 'mysql_enable=&quot;YES&quot;' &lt;&lt; /etc/rc.conf</pre>
<p>Start mysql server and change root password</p>
<pre class="brush: bash; title: ; notranslate">/usr/local/etc/rc.d/mysql-server start
mysqladmin -u root password sumcrazypaswrd
mysql -u root -p    *make sure you can log in*
rm /root/.history  *remove history so password isn't exposed*</pre>
<p>Create a configuration file for mysql in /etc/my.cnf</p>
<pre class="brush: bash; title: ; notranslate">[client]
port=29912
[mysqld]
port=29912
bind-address=127.0.0.1</pre>
<p>Now lets install configure and setup <strong>phpMyAdmin</strong></p>
<pre class="brush: bash; title: ; notranslate">cd /usr/ports/databases/phpmyadmin
make config install clean
cd /usr/local/www/phpMyAdmin &amp;amp;&amp;amp; cp config.sample.inc.php
config.inc.php
vi config.inc.php
$cfg['blowfish_secret'] = 'sdf934sdfgHijh98Y';</pre>
<p>open httpd.conf and Alias</p>
<pre class="brush: bash; title: ; notranslate">Alias /phpmyadmin /usr/local/www/phpMyAdmin</pre>
<p>Now allow who you want to access it</p>
<pre class="brush: bash; title: ; notranslate">        &lt;Directory &quot;/usr/local/www/phpmyadmin'&lt;
Order allow,deny
        Allow from all   *or allow from 222.114.123.0/12*
&lt;/Directory&lt;</pre>
<p>you&#8217;ll want https when you connect to phpmyadmin so lets enable https and make some httpd.conf changes</p>
<p><strong>Create your certificate</strong></p>
<p>In order to access phpmyadmin of ssl you need to get https going on apache. You can buy an SSL certificate generated by a trusted CA such as Thwate or Verisign, or you can generate one yourself using OpenSSL. I borrowed a ton of infor from <a href="http://www.freebsdmadeeasy.com/tutorials/freebsd/create-a-ca-with-openssl.php">freebsdmadeeasy.com</a></p>
<p>lets get the openssl.cnf file ready</p>
<pre class="brush: bash; title: ; notranslate">vi /etc/ssl/openssl.cnf
dir = /root/sslCA
default_days = 3650</pre>
<p>Now set up the directories</p>
<pre class="brush: bash; title: ; notranslate">cd ~root/
mkdir sslCA
chmod 700 sslCA
chmod 700 sslCA
mkdir certs private newcerts
echo 1000 &lt; serial
touch index.txt
cd ~root/sslCA
openssl req -new -x509 -days 3650 -extensions v3_ca -keyout private/cakey.pem -out cacert.pem -config /etc/ssl/openssl.cnf</pre>
<p>The CA should now be all set.. test with more;</p>
<pre class="brush: bash; title: ; notranslate">more ~root/sslCA/cacert.pem
more ~root/sslCA/private/cakey.pem</pre>
<p>Now lets generate an SSL certificate for apache</p>
<pre class="brush: bash; title: ; notranslate">cd ~root/sslCA
openssl req -new -nodes -out yourhostname-req.pem -keyout private/yourhostname-key.pem -config /etc/ssl/openssl.cnf
openssl ca -config /etc/ssl/openssl.cnf -out yourhostname-cert.pem -infiles yourhostname-req.pem</pre>
<p>Lets put everything where it needs to be.</p>
<pre class="brush: bash; title: ; notranslate">mkdir /etc/ssl/crt
mkdir /etc/ssl/key
cp ~root/sslCA/yourhostname-cert.pem /etc/ssl/crt
cp ~root/sslCA/private/yourhostname-key.pem /etc/ssl/key</pre>
<p>And finally add the SSL virtual host</p>
<p>Find the below line in your httpd.conf and take the comment hash out.</p>
<pre class="brush: bash; title: ; notranslate"># Secure (SSL/TLS) connections
Include etc/apache22/extra/httpd-ssl.conf</pre>
<p>Now modify your httpd-ssl.conf</p>
<pre class="brush: bash; title: ; notranslate">ServerName ssl.yourhostname.com
SSLCertificateFile /etc/ssl/crt/yourhostname-cert.pem
SSLCertificateKeyFile /etc/ssl/key/yourhostname-key.pem
DocumentRoot &quot;/etc/www/apache22/data&quot;      ** whatever your location is**
ErrorLog &quot;/var/log/httpd-error.log&quot;
TransferLog &quot;/var/log/httpd-access.log&quot;</pre>
<p>In /usr/local/etc/apache22/extra/httpd-default.conf, disable ServerSignature to prevent the server from showing more information than it has to. Make sure the server-status and the server-info sections in /usr/local/etc/apache22/extra/httpd-info.conf are commented out.</p>
<p>Finally restart apache</p>
<pre class="brush: bash; title: ; notranslate">/usr/local/etc/rc.d/apache22 restart</pre>
<p>Now install <strong>wordpress</strong></p>
<pre class="brush: bash; title: ; notranslate">cd /usr/ports/wordpress
make install clean</pre>
<p>do a locate wordpress and move file to web root</p>
<pre class="brush: bash; title: ; notranslate">locate wordpress
cp /usr/local/www/data/wordpress/* /usr/local/whatever web root is</pre>
<p>go into web root and copy wp-config-sample.php to wp-config.php</p>
<p>navigate to https://hostname/phpmyadmin and create wordpress db &#8211; add that name to wp-config.php</p>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/freebsd-8-lamp-install-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

