<?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; freebsd</title>
	<atom:link href="http://analysisandreview.com/tag/freebsd/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>Replace sendmail with ssmpt to send email via Gmail</title>
		<link>http://analysisandreview.com/security/replace-sendmail-with-ssmpt-to-send-email-via-gmail/</link>
		<comments>http://analysisandreview.com/security/replace-sendmail-with-ssmpt-to-send-email-via-gmail/#comments</comments>
		<pubDate>Mon, 03 May 2010 18:50:27 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[MTA]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[ssmtp]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=756</guid>
		<description><![CDATA[Okay let&#8217;s set up your freebsd 8 system to use gmail as its MTA. This guide will assist you in setting up your server to send email via gmail with a secure logon. We&#8217;re replacing sendmail with ssmpt because ssmpt is so much easier to configure and sendmail is overkill when you just need to ]]></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>Okay let&#8217;s set up your freebsd 8 system to use gmail as its MTA. This guide will assist you in setting up your server to send email via gmail with a secure logon. We&#8217;re replacing sendmail with ssmpt because ssmpt is so much easier to configure and sendmail is overkill when you just need to send system mail and such. We&#8217;ll use gmail to relay the emails to the destination for us. So the flow will be a system job like cron will generate an email &#8211; your freeBSD server will send login to your gmail (securely) and use gmail to send the email. Gmail will limit you to 5,000 emails per day.<span id="more-756"></span></p>
<p>You&#8217;ll need a freeBSD server &#8211; ssmtp installed &#8211; a gmail account &#8211; about 5 minutes spare time</p>
<p>ssmtp will replace sendmail &#8211; all systems commands that use sendmail with automatically now use ssmtp &#8211; the sendmail command will still work just ssmpt will be used</p>
<p><strong>Step 1:</strong></p>
<p>Disable Sendmail completely by setting the following in your /etc/rc.conf file:</p>
<pre class="brush: bash; title: ; notranslate">sendmail_enable=&quot;NO&quot;
sendmail_submit_enable=&quot;NO&quot;
sendmail_outbound_enable=&quot;NO&quot;
sendmail_msp_queue_enable=&quot;NO&quot;</pre>
<p><strong>Step 2:</strong></p>
<p>killall sendmail</p>
<p><strong>Step 3:</strong></p>
<p>install ssmtp</p>
<p>cd /usr/ports/mail/ssmtp/</p>
<p>make install replace clean</p>
<p><strong>Step 4:</strong></p>
<p>Configure SSMTP &#8211; located here &#8211;&gt; cd /usr/local/etc/ssmtp/ssmpt.conf</p>
<pre class="brush: bash; title: ; notranslate">mailhub=smtp.gmail.com:465
UseTLS=YES
AuthUser=user@domainname.com
AuthPass=password222
FromLineOverride=YES
Hostname=yourhostname
RewriteDomain=sourcedomainame.com
Root=someuser@domainname.com</pre>
<p><strong>Step 5:</strong></p>
<p>enable ssmpt at boot</p>
<p>echo &#8216;ssmtp_enable=“YES”&#8217; &gt;&gt; /etc/rc.conf</p>
<p>FreeBSD says you <a href="http://www.freebsd.org/doc/en/books/handbook/mail-changingmta.html#MAIL-DISABLE-SENDMAIL">need a wrapper</a> but the doc is old or just incorrect &#8211; when you issue the make install replace clean that updates <tt>/etc/mail/mailer.conf with the correct info<br />
</tt></p>
<p><a href="http://blogs.techrepublic.com.com/security/?p=440">Chad Perrin</a> at Techrepublic laid down a useful explanation of the ssmtp.conf file options. I&#8217;ve included them below.</p>
<p>* root=user@example.com: This identifies what user account receives all mail for userid under 1000 on the local system. That basically means system accounts, such as the root user account. In other words, if your computer is trying to send your root account an e-mail message, it will send it to whatever e-mail address you specify her. This should normally be your primary e-mail account — probably the account for which you’re configuring sSMTP to send e-mails.</p>
<p>* AuthUser=username: The username indicated here should be the username used to log into the remote SMTP server. In many cases, this is the part of the e-mail address that comes before the @ sign in your e-mail address. In some cases, it may be the entire e-mail address, possibly with the @ replaced by a plus sign. Using the user@example.com example above, this means it the username entry might be user+example.com, depending on the SMTP server configuration.</p>
<p>* AuthPass=password: When authenticating, this is the password used with the username above. Because my e-mail password is stored in the file, I make sure the ssmtp.conf file permissions are set to 640 using the chmod command. This ensures that the ssmtp and system administrator accounts can access the file as needed (both to make sure the ssmtp process works properly and that I can edit the file as root when needed), but no unprivileged accounts have access to the contents of the file. For this to work, you will also need to ensure that you create an ssmtp user (with a command like pw useradd ssmtp -g nogroup -h &#8211; -s /sbin/nologin -d /nonexistent -c &#8220;sSMTP pseudo-user&#8221;) and set ownership of ssmtp.conf to that user (with a command like chown ssmtp ssmtp.conf).</p>
<p>* mailhub=mail.example.com: Set the mailhub option to the fully qualified hostname for the SMTP server you will be using, so that sSMTP knows where to send outgoing e-mails. This option may actually take the form mailhub=mail.example.com:465, which sets the port number to use when contacting the SMTP server to 465. This allows unencrypted connections to use 25 (the default port number for SMTP traffic), and 465 is the standard alternate port number for TLS- and SSL-protected SMTP connections.</p>
<p>* rewriteDomain=example.com: This tells sSMTP that your mail headers need to be edited to say that the domain name you use for your e-mail address will be listed as the source of your e-mail address. Failing to rewrite the source domain name in this manner may cause problems at the receiving end when your e-mail address arrives at its intended destination.</p>
<p>* hostname=hostname.domain: The hostname indicated here is the hostname of the computer you are using to compose and send e-mails. The .domain part may or may not be present. On Unix and Linux systems, you can find the hostname for your computer by entering the command hostname at the shell prompt.</p>
<p>* FromLineOverride=YES: The From: header in an e-mail handled by sSMTP can be overwritten at this point. Setting this to YES just uses the From: value provided by the program that sent the e-mail to sSMTP to be forwarded to the SMTP server in the first place. In my case, since I use mutt as my mail user agent, this means that setting FromLineOverride=YES will cause sSMTP to use whatever From: header line mutt provides.</p>
<p>* UseTLS=YES: At last, we’ve struck gold. This is the configuration line that tells sSMTP to encrypt its connection to the SMTP server, protecting your authentication username and password as well as the rest of the session.</p>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/security/replace-sendmail-with-ssmpt-to-send-email-via-gmail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to use Sendmail with FreeBSD</title>
		<link>http://analysisandreview.com/unix/how-to-use-sendmail-with-freebsd/</link>
		<comments>http://analysisandreview.com/unix/how-to-use-sendmail-with-freebsd/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 17:07:36 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[send mail]]></category>
		<category><![CDATA[Sendmail]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=750</guid>
		<description><![CDATA[Using sendmail with freebsd is easy. Here we will cover how to start and stop sendmail how to send mail with sendmail how to send mail from the terminal, cli, command prompt how to make sendmail start at boot time How to start and stop send mail: How to send mail with sendmail from the ]]></description>
			<content:encoded><![CDATA[<p>Using sendmail with freebsd is easy. Here we will cover<span id="more-750"></span></p>
<ul>
<li>how to start and stop sendmail</li>
<li>how to send mail with sendmail</li>
<li>how to send mail from the terminal, cli, command prompt</li>
<li>how to make sendmail start at boot time</li>
</ul>
<p>How to start and stop send mail:</p>
<ol>
<li>
<pre class="brush: php; title: ; notranslate">/etc/rc.d/sendmail  stop&lt;/li&gt;
	&lt;li&gt;/etc/rc.d/sendmail  start&lt;/li&gt;
	&lt;li&gt;/etc/rc.d/sendmail restart</pre>
</li>
</ol>
<p>How to send mail with sendmail from the terminal aka cli or command prompt or root</p>
<pre class="brush: php; title: ; notranslate">mail someuser@somedomain.com
Subject: For Testing Only
This email is for testing the mail delivery system only.
* then press ctrl+D</pre>
<p>How to make sendmail start at boot time:</p>
<ol>
<li>edit /etc/rc.conf</li>
<li>add &#8211; sendmail_enable=&#8221;YES&#8221;</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/how-to-use-sendmail-with-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable FTP FreeBSD and Allow Only Localhost</title>
		<link>http://analysisandreview.com/unix/enable-ftp-freebsd-and-allow-only-localhost/</link>
		<comments>http://analysisandreview.com/unix/enable-ftp-freebsd-and-allow-only-localhost/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 03:35:43 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[FTPD]]></category>
		<category><![CDATA[Localhost]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=693</guid>
		<description><![CDATA[Enable FTP on your FreeBSD server and allow only your localhost (local machine) access to the ftpd server. The inetd server should be run at boot time by /etc/rc. It then listens for connections on certain internet sockets. When a connection is found on one of its sockets, it decides what service the socket corresponds ]]></description>
			<content:encoded><![CDATA[<p>Enable FTP on your FreeBSD server and allow only your localhost (local machine) access to the ftpd server.<span id="more-693"></span></p>
<p>The inetd server should be run at boot time by /etc/rc. It then listens for connections on certain internet sockets. When a connection is found on one of its sockets, it decides what service the socket corresponds to, and invokes a program to service the request. The server program is invoked with the service socket as its standard input, output and error descriptors. After the program is finished, inetd continues to listen on the socket.</p>
<p>To enable FTPD Open /etc/inetd.conf file and remove the hash from:</p>
<pre class="brush: php; title: ; notranslate">ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l</pre>
<p>Then restart inetd.conf</p>
<pre class="brush: php; title: ; notranslate">/etc/rc.d/inetd restart
or
/etc/rc.d/inetd onerestart</pre>
<p>Or allow only 127.0.0.1 (localhost) to connect to your ftp server:</p>
<pre class="brush: php; title: ; notranslate">ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l -D -a 127.0.0.1</pre>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/enable-ftp-freebsd-and-allow-only-localhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best freeBSD Firewall for a Web Server, PF Configuration and Testing</title>
		<link>http://analysisandreview.com/unix/best-freebsd-firewall-for-a-web-server-pf-configuration-and-testing/</link>
		<comments>http://analysisandreview.com/unix/best-freebsd-firewall-for-a-web-server-pf-configuration-and-testing/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 04:03:01 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[best freebsd firewall]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[pf]]></category>
		<category><![CDATA[pf configuration]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=687</guid>
		<description><![CDATA[You&#8217;ll see many articles discussing various firewalls for BSD. freeBSD comes with three firewalls but I&#8217;ll lay out what I believe is the best freebsd firewall for a web server, pf. I need firewall that will help negate DDoS attacks, spoofing and fingerprinting. Allows port 80 and 443 as well as ssh and is simple ]]></description>
			<content:encoded><![CDATA[<div id="attachment_688" class="wp-caption alignright" style="width: 266px"><a href="http://analysisandreview.com/wp-content/blogs.dir/5/files/uploads/2010/02/freebsd-firewall.png"><img class="size-full wp-image-688" src="http://analysisandreview.com/wp-content/blogs.dir/5/files/uploads/2010/02/freebsd-firewall.png" alt="freeBSD 8 firewall for web server" width="256" height="256" /></a><p class="wp-caption-text">freeBSD 8 firewall for web server</p></div>
<p>You&#8217;ll see many articles discussing various firewalls for BSD. freeBSD comes with three firewalls but I&#8217;ll lay out what I believe is the best freebsd firewall for a web server, pf.<span id="more-687"></span></p>
<p>I need firewall that will help negate DDoS attacks, spoofing and fingerprinting. Allows port 80 and 443 as well as ssh and is simple to test and configure.</p>
<p>Well PF handles all that and comes built into the freeBSD kernel so it&#8217;s pretty easy and quick to set up and test.</p>
<p>do a ifconfig to figure out what your interface is named</p>
<pre class="brush: bash; title: ; notranslate">#ifconfig
bigkill# ifconfig
 re0:  flags=8843 metric 0 IC&amp;gt;
        ether 00:2c:c1:f9:5s:d3
        inet 224.210.155.13 netmask 0xfffffff8 broadcast 224.210.155.253
        media: Ethernet autoselect (100baseTX )
        status: active
lo0: flags=8049 metric 0
        inet 127.0.0.1 netmask 0xff000000
</pre>
<p>As you can see here the interface name is  re0</p>
<p> so just replace re0 in the below configuration and apply it to /etc/pf.conf</p>
<pre class="brush: bash; title: ; notranslate"> ### macro name for external interface.
ext_if = &quot;re0&quot;

### all incoming traffic on external interface is normalized and fragmented
### packets are reassembled.
scrub in on $ext_if all fragment reassemble

### set a default deny everything policy.
block all

### exercise antispoofing on the external interface, but add the local
### loopback interface as an exception, to prevent services utilizing the
### local loop from being blocked accidentally.
set skip on lo0
antispoof for $ext_if inet

### block anything coming from sources that we have no back routes for.
block in from no-route to any

### block packets that fail a reverse path check. we look up the routing
### table, check to make sure that the outbound is the same as the source
### it came in on. if not, it is probably source address spoofed.
block in from urpf-failed to any

### drop broadcast requests quietly.
block in quick on $ext_if from any to 255.255.255.255

### block packets claiming to come from reserved internal address blocks, as
### they are obviously forged and cannot be contacted from the outside world.
block in log quick on $ext_if from { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 255.255.255.255/32 } to any

### block probes that can possibly determine our operating system by disallowing
### certain combinations that are commonly used by nmap, queso and xprobe2, who
### are attempting to fingerprint the server.
### * F : FIN  - Finish; end of session
### * S : SYN  - Synchronize; indicates request to start session
### * R : RST  - Reset; drop a connection
### * P : PUSH - Push; packet is sent immediately
### * A : ACK  - Acknowledgement
### * U : URG  - Urgent
### * E : ECE  - Explicit Congestion Notification Echo
### * W : CWR  - Congestion Window Reduced
block in quick on $ext_if proto tcp flags FUP/WEUAPRSF
block in quick on $ext_if proto tcp flags WEUAPRSF/WEUAPRSF
block in quick on $ext_if proto tcp flags SRAFU/WEUAPRSF
block in quick on $ext_if proto tcp flags /WEUAPRSF
block in quick on $ext_if proto tcp flags SR/SR
block in quick on $ext_if proto tcp flags SF/SF

### keep state on any outbound tcp, udp or icmp traffic. modulate the isn of
### outgoing packets. (initial sequence number) broken operating systems
### sometimes don't randomize this number, making it guessable.
pass out on $ext_if proto { tcp, udp, icmp } from any to any modulate state

### normally, a client connects to the server and we handshake with them, then
### proceed to exchange data. by telling pf to handshake proxy between the client
### and our server, tcp syn flood attacts from ddos become uneffective because
### a spoofed client cannot complete a handshake.

### set a rule that allows inbound ssh traffic with synproxy handshaking. yes I changed the ssh port
pass in on $ext_if proto tcp from any to any port 1229 flags S/SA synproxy state
### set a rule that allows inbound www traffic with synproxy handshaking.
pass in on $ext_if proto tcp from any to any port 80 flags S/SA synproxy state
pass in on $ext_if proto tcp from any to any port 443 flags S/SA synproxy state
 </pre>
<p> If you want to allow any other port simple copy the last line and replace the port number.</p>
<p> Now issue a reboot command to restart the system in 5 minutes to test your pf configuration.</p>
<pre class="brush: bash; title: ; notranslate"> shutdown -r +5
 </pre>
<p> Okay not start PF and test it</p>
<pre class="brush: bash; title: ; notranslate"> /etc/rc.d/pf onestart
 </pre>
<p> Now &#8220;test&#8221; the current configuration to see what you got</p>
<pre class="brush: bash; title: ; notranslate"> pfctl -s all&quot; ### list all the current rules that are in effect and shows current connections
 </pre>
<p> If you&#8217;re happy with your PF firewall configuration for freebsd 8 you&#8217;ll need to apply it at boot time by adding the following to your /etc/rc.conf</p>
<pre class="brush: bash; title: ; notranslate"> pf_enable=&quot;YES&quot;
pf_rules=&quot;/etc/pf.conf&quot;
 </pre>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/best-freebsd-firewall-for-a-web-server-pf-configuration-and-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to shutdown freebsd 8 and stop shutdown</title>
		<link>http://analysisandreview.com/unix/how-to-shutdown-freebsd-8-and-stop-shutdown/</link>
		<comments>http://analysisandreview.com/unix/how-to-shutdown-freebsd-8-and-stop-shutdown/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 03:45:08 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[shutdown]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=685</guid>
		<description><![CDATA[Shutdown freebsd now Shutdown freeBSD at a scheduled time or within a set time. In the sample below we have shutdown taking place in 5 minutes. This is useful when you want to set a configuration and you&#8217;re worried about the system locking you out. Set the shutdown time for five minutes from now and ]]></description>
			<content:encoded><![CDATA[<p>Shutdown freebsd now</p>
<pre class="brush: php; title: ; notranslate">shutdown -r now
</pre>
<p><span id="more-685"></span><br />
Shutdown freeBSD at a scheduled time or within a set time. In the sample below we have shutdown taking place in 5 minutes. This is useful when you want to set a configuration and you&#8217;re worried about the system locking you out. Set the shutdown time for five minutes from now and if you get locked out you just have to wait for he reboot to take place.</p>
<pre class="brush: php; title: ; notranslate">shutdown -r +5
</pre>
<p>And if you want to stop the shutdown process from taking place simple issue a kill.</p>
<pre class="brush: php; title: ; notranslate">pkill shutdown
</pre>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/how-to-shutdown-freebsd-8-and-stop-shutdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<item>
		<title>How to Keep FreeBSD Up to Date</title>
		<link>http://analysisandreview.com/unix/how-to-keep-freebsd-up-to-date/</link>
		<comments>http://analysisandreview.com/unix/how-to-keep-freebsd-up-to-date/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 05:50:32 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[up to date]]></category>
		<category><![CDATA[uptodate]]></category>

		<guid isPermaLink="false">http://analysisandreview.com/?p=651</guid>
		<description><![CDATA[Keeping the freeBSD installation up-to-date is simple. portsnap &#8211; Approximately every hour, a snapshot of the ports tree is generated, repackaged, and cryptographically signed. portsnap gets this information to see which ports you have out of date so you can easily update them. portsmanager &#8211; updates ports in the correct order based on their dependencies. ]]></description>
			<content:encoded><![CDATA[<p>Keeping the freeBSD installation up-to-date is simple.</p>
<pre class="brush: php; title: ; notranslate"># portsnap fetch
# portsnap update
# portmanager -u -l&lt;span id=&quot;more-651&quot;&gt;&lt;/span&gt;</pre>
<p>portsnap &#8211; Approximately every hour, a snapshot of the ports tree is generated, repackaged, and cryptographically signed. portsnap gets this information to see which ports you have out of date so you can easily update them.</p>
<p>portsmanager &#8211; updates ports in the correct order based on their dependencies.</p>
<p>Now on to the binary security updates:</p>
<pre class="brush: php; title: ; notranslate"># freebsd-update fetch</pre>
<pre class="brush: php; title: ; notranslate"># freebsd-update install</pre>
<pre class="brush: php; title: ; notranslate"># freebsd-update  rollback   (in case you need to rollback)

Now just check the kernal version
1<br />
Source: http://www.cyberciti.biz/tips/howto-keep-freebsd-system-upto-date.html</p>
]]></content:encoded>
			<wfw:commentRss>http://analysisandreview.com/unix/how-to-keep-freebsd-up-to-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

