<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Alwina's open source efforts » Alwina’s open source efforts</title>
	
	<link>http://www.alwina.org</link>
	<description>Specialized in FreeBSD and CentOS</description>
	<lastBuildDate>Wed, 07 Dec 2011 08:10:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Alwina" /><feedburner:info uri="alwina" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Perfect FreeBSD Security Monitoring Solution</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/TadzG6BVvYA/</link>
		<comments>http://www.alwina.org/?p=652#comments</comments>
		<pubDate>Tue, 06 Dec 2011 12:18:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Management]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=652</guid>
		<description><![CDATA[Introduction There is a perfect FreeBSD Security Monitoring solution available from the portkit: portaudit. Once installed this application polls a database, updated and maintained by the FreeBSD Security Team and ports developers, for known security issues. This poll occurs daily. You&#8217;ll find sections like this in your security mails:  Checking for a current audit database: [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>There is a perfect FreeBSD Security Monitoring solution available from the portkit: portaudit. Once installed this application polls a database, updated and maintained by the FreeBSD Security Team and ports developers, for known security issues. This poll occurs daily. You&#8217;ll find sections like this in your security mails:</p>
<blockquote><p> Checking for a current audit database:</p>
<p>Downloading fresh database.<br />
auditfile.tbz                                           71 kB   60 kBps<br />
New database installed.<br />
Database created: Mon Dec 19 03:05:01 CET 2011</p>
<p>Checking for packages with security vulnerabilities:</p>
<p>Affected package: freetype2-2.4.4<br />
Type of problem: freetype &#8212; Some type 1 fonts handling vulnerabilities.<br />
Reference: <a href="http://portaudit.freebsd.org/54075e39-04ac-11e1-a94e-bcaec565249c.html" target="_blank">http://portaudit.FreeBSD.org/54075e39-04ac-11e1-a94e-bcaec565249c.html</a></p>
<p>Affected package: apache-2.2.19<br />
Type of problem: apache &#8212; Range header DoS vulnerability.<br />
Reference: <a href="http://portaudit.freebsd.org/7f6108d2-cea8-11e0-9d58-0800279895ea.html" target="_blank">http://portaudit.FreeBSD.org/7f6108d2-cea8-11e0-9d58-0800279895ea.html</a></p>
<p>Affected package: php5-5.3.6<br />
Type of problem: php &#8212; multiple vulnerabilities.<br />
Reference: <a href="http://portaudit.freebsd.org/057bf770-cac4-11e0-aea3-00215c6a37bb.html" target="_blank">http://portaudit.FreeBSD.org/057bf770-cac4-11e0-aea3-00215c6a37bb.html</a></p>
<p>Affected package: freetype2-2.4.4<br />
Type of problem: freetype2 &#8212; execute arbitrary code or cause denial of service.<br />
Reference: <a href="http://portaudit.freebsd.org/5d374b01-c3ee-11e0-8aa5-485d60cb5385.html" target="_blank">http://portaudit.FreeBSD.org/5d374b01-c3ee-11e0-8aa5-485d60cb5385.html</a></p>
<p>4 problem(s) in your installed packages found.</p>
<p>You are advised to update or deinstall the affected package(s) immediately.</p>
<p>&#8211; End of security output &#8211;</p></blockquote>
<p>If security is important, you should install this application. It is quite easy.</p>
<h1>Procedure</h1>
<p>1. Update the portkit</p>
<blockquote><p># portsnap update</p></blockquote>
<p>2. Install portaudit</p>
<blockquote><p># cd /usr/ports/ports-mgmt/portaudit<br />
# make install clean</p></blockquote>
<p>3. Initiate portaudit</p>
<blockquote><p>#portaudit -Fda</p></blockquote>
<p>Done!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/RW0KzefFwptlk3rYQr2bjCDxQKo/0/da"><img src="http://feedads.g.doubleclick.net/~a/RW0KzefFwptlk3rYQr2bjCDxQKo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RW0KzefFwptlk3rYQr2bjCDxQKo/1/da"><img src="http://feedads.g.doubleclick.net/~a/RW0KzefFwptlk3rYQr2bjCDxQKo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/TadzG6BVvYA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=652</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=652</feedburner:origLink></item>
		<item>
		<title>Change SCSI to IDE controller FreeBSD 8.x</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/DXnCE_loTEY/</link>
		<comments>http://www.alwina.org/?p=643#comments</comments>
		<pubDate>Sun, 04 Dec 2011 12:35:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[System Management]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[SCSI]]></category>
		<category><![CDATA[Virtual Machine]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=643</guid>
		<description><![CDATA[Introduction There is a bug in FreeBSD 8.x that can cause the system to freeze when it runs on a Virtual Machine. This happens with SCSI controllers  in occasions there is heavy traffic on the host systems. For instance when a snapshot is taken. The solution is quite simple: do not use a SCSI controller, [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>There is a bug in FreeBSD 8.x that can cause the system to freeze when it runs on a Virtual Machine. This happens with SCSI controllers  in occasions there is heavy traffic on the host systems. For instance when a snapshot is taken.</p>
<p>The solution is quite simple: do not use a SCSI controller, but IDE.</p>
<p>In this article I show the steps to keep your FreeBSD 8.x system running and change your virtual controller. Please make sure you make proper backups. It is tricky and shit does happen!</p>
<h1>Procedure</h1>
<p>1. edit /etc/vstab</p>
<blockquote><p>#vi /etc/fstab</p></blockquote>
<p>With a SCSI controller you will find devices like /dev/da0&#8230;<br />
For instance:<br />
/dev/da0s1b<br />
/dev/da0s1c<br />
etc.<br />
You need to change the part da0 to ad0, do not change anything else. So you get:<br />
/dev/ad0s1b<br />
/dev/ad0s1c<br />
etc.</p>
<p>Be careful. If you make an error, the system won&#8217;t reboot again.<br />
Save the file.</p>
<p>2. shutdown</p>
<blockquote><p># shutdown -h now</p></blockquote>
<p>3. change your virtual controller</p>
<p>Go to your virtual system and modify the controller to IDE and keep the disk you have. Don&#8217;t forget to save your settings.</p>
<p>4. start the virtual machine</p>
<p>Start your virtual machine</p>
<p>Now your machine should reboot as never happened. But there is a chance you will get an annoying error messages.</p>
<p>5. Check if you have error message with geometry</p>
<blockquote><p>#grep GEOM /var/log/messages</p></blockquote>
<p>Check for a sentence like this occurring after the last reboot:</p>
<p>GEOM: da0s1: geometry does not match label (255h,63s != 16H,63s)</p>
<p>If there is such a error, there is something wrong with the geometry. You usually can fix it with the following steps.</p>
<p>6.  correct geometry</p>
<blockquote><p># sysinstall</p></blockquote>
<p>Go to &#8220;Configure&#8221;</p>
<p>Go to &#8220;Fdisk&#8221;</p>
<p>Do &#8220;W&#8221; (=write) and ignore the Warning</p>
<p>Do not install  the bootmanger (choose &#8220;Cancel&#8221;)</p>
<p>Exit the install</p>
<p>7. reboot</p>
<blockquote><p># reboot</p></blockquote>
<p>8. check again for a message like GEOM: da0s1: geometry does not match&#8230;</p>
<blockquote><p># grep GEOM /var/log/messages</p></blockquote>
<p>You will see the message not occurring after this reboot</p>
<p>If so, you can be happy again.</p>
<p>Now your Virtual System uses an IDE virtual controller.  Now your FreeBSD 8.x system is less prone to freeze errors!</p>
<p>&nbsp;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/qgU7lh07XO43CiyZkVfJGd2_FlM/0/da"><img src="http://feedads.g.doubleclick.net/~a/qgU7lh07XO43CiyZkVfJGd2_FlM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qgU7lh07XO43CiyZkVfJGd2_FlM/1/da"><img src="http://feedads.g.doubleclick.net/~a/qgU7lh07XO43CiyZkVfJGd2_FlM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/DXnCE_loTEY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=643</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=643</feedburner:origLink></item>
		<item>
		<title>Howto move WordPress site to different VPS</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/0Clvhvm3hn8/</link>
		<comments>http://www.alwina.org/?p=607#comments</comments>
		<pubDate>Fri, 28 Oct 2011 11:36:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Management]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FAMP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=607</guid>
		<description><![CDATA[In this article I will explain howto move a WordPress site from one VPS to another VPS. This article is based on a standard FAMP server (FreeBSD, Apache, MySQL and PHP) and a standard configuration of WordPress. The VPS is a so called bare-bone VPS on which total root control is available. I &#8211; Copy [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I will explain howto move a WordPress site from one VPS to another VPS. This article is based on a standard FAMP server (FreeBSD, Apache, MySQL and PHP) and a standard configuration of WordPress. The VPS is a so called bare-bone VPS on which total root control is available.</p>
<h1><strong>I &#8211; Copy the database</strong></h1>
<p>1.  check the database, user and the host the WP site is using</p>
<p>a. goto the wordpress root</p>
<blockquote><p># cd /home/www</p></blockquote>
<p>The actual location depends on your installation, replace /home/www appropriate</p>
<p>b. check wp-config.php</p>
<blockquote><p># vi wp-config.php</p></blockquote>
<p><a rel="attachment wp-att-609" href="http://www.alwina.org/?attachment_id=609"><img class="alignnone size-medium wp-image-609" title="WPMove1" src="http://www.alwina.org/wp-content/uploads/2011/10/WPMove1-300x214.jpg" alt="" width="300" height="214" /></a></p>
<p>Look for the phrases DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. These define the database name, the database user, the database password and the database host.</p>
<p>In this case we have:</p>
<p>database name: cacomdb<br />
database user: cacom<br />
database password: Muursdfs<br />
database host: 10.1.1.4</p>
<p>c. check the databases on your database server</p>
<blockquote><p># mysql -u root -p</p></blockquote>
<p>Type the root password of the database</p>
<p>Stay within MySQL and give the command</p>
<blockquote><p>show databases;</p></blockquote>
<p>Now you should see the database of your WP site within the list.</p>
<p>2. dump your WP database</p>
<blockquote><p># cd<br />
# mysqldump -h 10.1.1.4 -u cacom -p cacomdb &gt; cacomdb.sql</p></blockquote>
<p>Now you should type the database password. The database is dumped to the file cacomdb.sql</p>
<p>3. copy your database dump to your target VPS</p>
<blockquote><p># sftp root@46.4.213.254</p></blockquote>
<p>Replace 46.4.213.254 with the IP of your target VPS.<br />
Type the root password of your VPS and stay within sftp.<br />
Type the following command:</p>
<blockquote><p>put cacomdb.sql</p></blockquote>
<p>Now the file is written to the VPS in the home directory of root (/root).</p>
<p>4. create database on your target database</p>
<p>a. login to your target VPS as root</p>
<blockquote><p># ssh root@46.4.213.254</p></blockquote>
<p>b. create database</p>
<blockquote><p># mysql -u root -p</p></blockquote>
<p>Type the root password of MySQL and stay within the MySQL client</p>
<blockquote><p>create database cacomdb</p></blockquote>
<blockquote><p>create user &#8216;cacom&#8217;@'localhost&#8217; identified by &#8216;secretpasswdx&#8217;;</p></blockquote>
<p>Replace &#8216;secretpasswdx&#8217; with your password.</p>
<blockquote><p>grant all on cacomdb.* to cacom;</p></blockquote>
<blockquote><p>exit</p></blockquote>
<p>Exit the MySQL client</p>
<p>c. populate database</p>
<blockquote><p># mysql -u cacom -p</p></blockquote>
<p>Type the password of the created user. In this case: &#8216;secrestpasswdx&#8217;.<br />
Don&#8217;t leave the MySQL client.</p>
<blockquote><p>connect cacomdb;</p>
<p>source cacomdb.sql;</p>
<p>quit;</p></blockquote>
<p>Now the database is copied.</p>
<h1><strong>II &#8211; Copy the files</strong></h1>
<p>1. Start a shell on the source VPS</p>
<blockquote><p># ssh root@45.1.1.2</p></blockquote>
<p>Replace 45.1.1.2 with the IP of the source VPS</p>
<p>2. Create a tar file</p>
<blockquote><p># cd /home</p>
<p># tar zcvf www.targ.gz www</p></blockquote>
<p>3. Copy the tar file to the target VPS</p>
<blockquote><p># sftp root@46.4.213.254</p></blockquote>
<p>Do not leave sftp</p>
<blockquote><p>sftp&gt; put www.tar.gz</p>
<p>sftp &gt; quit</p></blockquote>
<p>4. Start a shell on the target VPS</p>
<p># ssh root@46.4.213.254</p>
<p>5. Extract the files</p>
<blockquote><p># mv ~/www.tar.gz /home</p>
<p># cd /home</p>
<p># tar xzxvf www.tar.gz</p></blockquote>
<p>Now the files are copied to the target VPS</p>
<h1>III &#8211; Check Apache configuration</h1>
<p>1. Start a shell on the source VPS</p>
<blockquote><p># ssh root@45.1.1.2</p></blockquote>
<p>2. Check the apache configuration</p>
<p>The are several standard apache configurations available. This depends on version, system and the background and taste of the system adminstration. In this article I assume a vhost configuations. This is a popular configuration as this type allows to run several website on one VPS. The configuration file is located in the following directory: /usr/local/etc/apache22/extra</p>
<blockquote><p># vi /usr/local/etc/apache22/extra/httpd-vhosts.conf</p></blockquote>
<p><a rel="attachment wp-att-629" href="http://www.alwina.org/?attachment_id=629"><img class="alignnone size-full wp-image-629" title="vhostconfig" src="http://www.alwina.org/wp-content/uploads/2011/10/vhostconfig.png" alt="" width="505" height="316" /></a></p>
<p>In this picture above the root directory of the WP site is located in /home/serverxl.org/www</p>
<p>3. Start a shell on the target VPS</p>
<blockquote><p># ssh root@46.4.213.254</p></blockquote>
<p>4. Check and adapt the apache configuration as needed</p>
<blockquote><p># vi /usr/local/etc/apache22/extra/httpd-vhosts.conf</p></blockquote>
<p>5. Check and adapt the configuration of WP as needed</p>
<blockquote><p># vi /home/serverxl.org/www/wp-config.php</p></blockquote>
<h1>IV &#8211; Modify DNS settings and test</h1>
<p>1. Modify the DNS settings so your website&#8217;s hostname point to your new VPS</p>
<p>The actual commands differs depending on your domain service provider</p>
<p>Choose a TTL (time to live) of 5 minutes or even less. It can take up to 24 hours before your settings are available wordwide (due to caching mechanisms).</p>
<p>2. Test if it works</p>
<blockquote><p># ping www.serverxl.org</p></blockquote>
<p>Now you should see the new IP</p>
<p>3. Exit your browser</p>
<p>4. Access your website</p>
<p>Now it should work!</p>
<p>Congratulations, job finished. Your websites are now on your new VPS.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/QQon00eCUk-zPn7cJ1aDHT4dTRM/0/da"><img src="http://feedads.g.doubleclick.net/~a/QQon00eCUk-zPn7cJ1aDHT4dTRM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QQon00eCUk-zPn7cJ1aDHT4dTRM/1/da"><img src="http://feedads.g.doubleclick.net/~a/QQon00eCUk-zPn7cJ1aDHT4dTRM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/0Clvhvm3hn8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=607</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=607</feedburner:origLink></item>
		<item>
		<title>How to reset root password MySQL on FreeBSD</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/MuJksuZFD8E/</link>
		<comments>http://www.alwina.org/?p=598#comments</comments>
		<pubDate>Sat, 21 May 2011 08:09:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=598</guid>
		<description><![CDATA[Did you forget your root password for your MySQL database? Are you worried? Don&#8217;t be! If you have root access to your server and you are working with MySQL version 5.1.x and FreeBSD just follow these steps and you get a new password for your database. 1. Stop the database # /usr/local/etc/rc.d/mysql-server stop 2. Edit [...]]]></description>
			<content:encoded><![CDATA[<p>Did you forget your root password for your MySQL database? Are you worried? Don&#8217;t be! If you have root access to your server and you are working with MySQL version 5.1.x and FreeBSD just follow these steps and you get a new password for your database.</p>
<p>1. Stop the database</p>
<blockquote><p># /usr/local/etc/rc.d/mysql-server stop</p></blockquote>
<p>2. Edit /etc/rc.conf</p>
<blockquote><p># vi /etc/rc.conf</p></blockquote>
<p>Add the following line:</p>
<blockquote><p>mysql_args=&#8221;&#8211;skip-grant-tables&#8221;</p></blockquote>
<p>Be careful, it is &#8220;(minus)(minus)skip-grant-tables&#8221; !</p>
<p>3. Start the database</p>
<blockquote><p># /usr/local/etc/rc.d/mysql-server start</p></blockquote>
<p>4. Reset the root password for MySQL</p>
<blockquote><p># mysql -uroot</p></blockquote>
<p>Enter the following commands in the MySQL client:</p>
<blockquote><p>use mysql;</p>
<p>update user set password=password(&#8220;newpassword&#8221;) where user=&#8221;root&#8221;;</p>
<p>exit;</p></blockquote>
<p>5. Restore orginal /etc/rc.conf</p>
<blockquote><p># vi /etc/rc.conf</p></blockquote>
<p>Remove the line you added in step 2.</p>
<p>6. Restart the database</p>
<blockquote><p># /usr/local/etc/rc.d/mysql-server restart</p></blockquote>
<p>7. Check and be happy again</p>
<blockquote><p># mysql -uroot</p></blockquote>
<p>This should fail.</p>
<blockquote><p># mysql -uroot -p</p></blockquote>
<p>This should work.</p>
<p>Does it work again? Just be happy!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/DabTGRg4Jdp7dWkz0x-9FX5kWqM/0/da"><img src="http://feedads.g.doubleclick.net/~a/DabTGRg4Jdp7dWkz0x-9FX5kWqM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DabTGRg4Jdp7dWkz0x-9FX5kWqM/1/da"><img src="http://feedads.g.doubleclick.net/~a/DabTGRg4Jdp7dWkz0x-9FX5kWqM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/MuJksuZFD8E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=598</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=598</feedburner:origLink></item>
		<item>
		<title>Perfect WordPress server</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/czZyOl37pKs/</link>
		<comments>http://www.alwina.org/?p=563#comments</comments>
		<pubDate>Mon, 24 Jan 2011 20:57:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LAMP and FAMP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FAMP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=563</guid>
		<description><![CDATA[Introduction In this article I describe how to install WordPress (WP) on a general purpose webserver. Before you begin The assumption is that a well configured AMP software suite (Apache HTTP-server, the MySQL database server and PHP) is installed on your general purpose webserver. You can read here how to do this on a FreeBSD [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
In this article I describe how to install WordPress (WP) on a general purpose webserver.</p>
<p><strong>Before you begin</strong><br />
The assumption is that a well configured AMP software suite (Apache HTTP-server, the  MySQL database server and PHP) is installed on your general purpose  webserver. You can read <a href="/?p=559" target="_self">here</a> how to do this on a FreeBSD VPS.</p>
<p><strong>Procedure</strong><br />
1. Update the ports</p>
<blockquote><p># portsnap fetch<br />
# portsnap update</p></blockquote>
<p>2. Start mysql session</p>
<blockquote><p># mysql -uroot -p</p></blockquote>
<p>Type the password and a MySQL session is started.<br />
Do not end this session, continue with the following commands.</p>
<p>2a. Create WP database</p>
<blockquote><p>create database mysite;</p></blockquote>
<p>The name of the database is now mysite, you can change this if you prefer another name.</p>
<p>2b. Create WP database user</p>
<blockquote><p>create user mysiteusr@localhost identified by &#8216;secretxyz&#8217;;</p></blockquote>
<p>The name of the user is mysiteusr, you can change this if you would prefer.<br />
You should change the password &#8216;secretxyz&#8217; in a secret one.</p>
<p>2c. Grant permissions to WP database user</p>
<blockquote><p>grant all on wpuser.* to mysiteusr@localhost;</p></blockquote>
<p>2d. Finish the MySQL session</p>
<blockquote><p>exit;</p></blockquote>
<p>3. Install WP tarball</p>
<blockquote><p># mkdir -p /home/www<br />
# cd /home/www<br />
# fetch http://wordpress.org/latest.tar.gz<br />
# tar zxvf latest.tar.gz<br />
# mv wordpress mysite.com</p></blockquote>
<p>You should change &#8220;mysite.com&#8221; with the name you prefer.</p>
<p>4. Fix permissions</p>
<blockquote><p># cd /home<br />
# chmod -R www:www  www</p></blockquote>
<p>5. Edit httpd.conf &#8211; enable configuration virtual hosts</p>
<blockquote><p># vi /usr/local/etc/apache22/httpd.conf</p></blockquote>
<p>Search the line with</p>
<blockquote><p>#Include etc/apache22/extra/httpd-vhosts.conf</p></blockquote>
<p>and remove the #, so it reads</p>
<blockquote><p>Include etc/apache22/extra/httpd-vhosts.conf</p></blockquote>
<p>6. Edit http-vhosts.conf</p>
<blockquote><p># cd /usr/local/etc/apache22/extra<br />
# vi httpd-vhosts.conf</p></blockquote>
<p>Remove the VirtualHost examples (from the first &lt;VirtualHost &#8230;&gt; to the last &lt;/VirtualHost&gt;.</p>
<p>Type the following lines:</p>
<blockquote><p>&lt;VirtualHost *:80&gt;<br />
ServerName www.mysite.com<br />
ServerAlias mysite.com<br />
DocumentRoot /home/www/mysite.com<br />
&lt;Directory /home/www/mysite.com&gt;<br />
Optios Indexes FollowSymLinks +ExecCGI<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
AddHandler cgi-script .pl .cgi<br />
AddHandler application/x-httpd-php .php .phtml<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>6. Restart apache</p>
<blockquote><p># /usr/local/etc/rc.d/apache22 restart</p></blockquote>
<p>7. Make sure www.mymysite.com points to IP of your webserver</p>
<p>There are to ways to finish the installation: the proper way, that makes the website visable to the world. And a non-proper way, to finish the installation quick and dirty.</p>
<p>7a. Proper way: create a DNS A record</p>
<p>Create a A-record for the hostname &#8220;www&#8221; of your domain &#8220;mysite.com&#8221; with the value of the IP of your webserver, for instance 46.4.213.133. Please contact the documentation of your DNS-provider for further information. Please note there is a TTL (time to live &#8211; delay) and upto an additional 24 hours to take worldwide effect.</p>
<p>7b. Non-proper way: trick with hostfile on your client system</p>
<p>A trick to be able to complete the WP installation and configuration is to add the following line to your hostfile (/etc/hosts for Linux or BSD-like systems):</p>
<blockquote><p>46.4.213.133            www.mysite.com      mysite.com</p></blockquote>
<p>You shoud replace 46.4.213.133 with the IP of your webserver and mysite.com with your domainname.</p>
<p>Now you have mapped your domainname to the IP of your webserver, either a proper DNS record or the host-file trick, you are able to finisch the configuration.</p>
<p>Please note that your website is only visible from your client now.</p>
<p>7. Complete your WP installation</p>
<p>Start your favorite browser on your client and visit your domain</p>
<blockquote><p>http://www.mysite.com</p></blockquote>
<p>8. Follow the instructions of WP and you&#8217;re ready</p>
<p>9. Check if WP works</p>
<p>Visit your website again from your client</p>
<blockquote><p>http://www.mysite.com</p></blockquote>
<p>Now you should see a beautiful wordpress home page.</p>
<p>Congratulations!!!</p>
<p>If you didn&#8217;t create A DNS A-record your website won&#8217;t be visible to the world. Don&#8217;t forget to finish this last step as soon as possible. If you did the trick with the hostfile, please delete the line once the DNS record is created. It can cause a lot of confusion later.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/FDoDp52Jy7EJRsFD5EPL2AB4AL8/0/da"><img src="http://feedads.g.doubleclick.net/~a/FDoDp52Jy7EJRsFD5EPL2AB4AL8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FDoDp52Jy7EJRsFD5EPL2AB4AL8/1/da"><img src="http://feedads.g.doubleclick.net/~a/FDoDp52Jy7EJRsFD5EPL2AB4AL8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/czZyOl37pKs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=563</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=563</feedburner:origLink></item>
		<item>
		<title>General purpose webserver on FreeBSD VPS</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/f2LG22Rxndc/</link>
		<comments>http://www.alwina.org/?p=559#comments</comments>
		<pubDate>Sun, 23 Jan 2011 21:13:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LAMP and FAMP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FAMP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=559</guid>
		<description><![CDATA[Introduction This article describes how to turn a FreeBSD Virtual Private Server (VPS) into a perfect general webserver. We will instal a software suite consisting of the Apache HTTP-server, the MySQL database server and PHP (AMP). These are essential software components for a general purpose webserver. This webserver will run lots of popular software like [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction<br />
</strong>This article describes how to turn a FreeBSD Virtual Private Server (VPS) into a perfect general webserver. We will instal a software suite consisting of the Apache HTTP-server, the MySQL database server and PHP (AMP). These are essential software components for a general purpose webserver. This webserver will run lots of popular software like WordPress, Joomla and Drupal. In combination with Linux this software suite is called LAMP. In this case we have FreeBSD as the operating system and use the term FAMP. This article is based on FreeBSD 7.3. This version is very well tested and stable. It is likely to work on newer version without too much difficulty.</p>
<p><strong>VPS provider and FreeBSD VPS hosting plan</strong><br />
First you need to select a proper FreeBSD VPS hosting plan from a hosting service provider. The  hosting plan needs to offer stability, full root access, good support, connectivity, a well configured ports collection and, of course, value for your money. This article is based on a <a href="http://www.fastup.org/?page_id=615" target="_self">lightweight FreeBSD VPS hosting plan</a> offered by Fastup. This plan offers a standard FreeBSD &#8220;best practices&#8221; configuration. I expect that the steps described in this article will also work for other VPS providers offering similar FreeBSD VPS hosting plans. This articles assumes you have a working install of FreeBSD 7.3 for i386    logged in as root with the ports collection installed.</p>
<p><strong>Before you begin</strong></p>
<p>1. Order a proper FreeBSD hosting plan<br />
2. Learn how to access your server with SSH and access your server (with SSH or PuTTY)<br />
3. Update /usr/ports</p>
<blockquote><p># portsnap fetch<br />
# portsnap update</p></blockquote>
<p><strong>Procedure</strong></p>
<p><strong>1. Installing MySQL</strong></p>
<p>a. Build MySQL from the ports</p>
<blockquote><p># cd /usr/ports/databases/mysql51-server<br />
# make install clean -DBATCH</p></blockquote>
<p>This may take a while. Please relax and enjoy life!</p>
<p>b. Edit /etc/rc.conf</p>
<blockquote><p># vi /etc/rc.conf</p></blockquote>
<p>Add the following line to /etc/rc.conf:</p>
<blockquote><p>mysql_enable=&#8221;YES&#8221;</p></blockquote>
<p>This line will enable mysql and start mysql on boot.</p>
<p>c. Start MySQL manually</p>
<p>Now we will start mysql manually with the following command:</p>
<blockquote><p># /usr/local/etc/rc.d/mysql-server start</p></blockquote>
<p>d. Set password for MySQL</p>
<p>Set the passwor for MySQL with the followingcommand (substitute your own password for &#8216;your-password&#8217;):</p>
<blockquote><p># rehash<br />
# mysqladmin -uroot password &#8216;your-password&#8217;</p></blockquote>
<p>Step 1 completed with success: MySQL is installed!</p>
<p><strong>2. Installing Apache</strong></p>
<p>a. Build Apache from the ports</p>
<blockquote><p># cd /usr/ports/www/apache22<br />
# make install clean -DBATCH</p></blockquote>
<p>b. Edit /etc/rc.conf</p>
<p>Add the following line:</p>
<blockquote><p>apache22_enable=&#8221;YES&#8221;</p></blockquote>
<p><strong>3. Installing PHP</strong></p>
<p>a. Build PHP from the ports</p>
<blockquote><p># cd /usr/ports/lang/php5<br />
# make install clean</p></blockquote>
<p>Make  sure the APACHE option (Build apache module) option is ticked  when  configuring the build. All other options should not be changed.  This  take a lot of time, another coffee.</p>
<p>b. Install the php5-extensions</p>
<blockquote><p># cd /usr/ports/lang/php5-extensions<br />
# make config</p></blockquote>
<p>Make sure you enable (1) MySQL database support, (2) MySQLi database  support, (3) GD library support and (4) ZLIB support. Leave the other  default options untouched!</p>
<blockquote><p># make install clean -DBATCH</p></blockquote>
<p>c. Install the php.ini file</p>
<blockquote><p># cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini</p></blockquote>
<p>You could also take the development version php.ini-development if you prefer.</p>
<p>d. Edit your Apache configuration file httpd.conf</p>
<blockquote><p># vi /usr/local/etc/apache22/httpd.conf</p></blockquote>
<p>Add the following lines to the end of the file, just before the include statement:</p>
<blockquote><p>AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</p></blockquote>
<p>Search for the line that reads:</p>
<blockquote><p>DirectoryIndex index.html</p></blockquote>
<p>and add index.php so it reads</p>
<blockquote><p>DirectoryIndex index.php index.html</p></blockquote>
<p>Enable language settings by searching for the line</p>
<blockquote><p>#Include etc/apache22/extra/httpd-languages.conf</p></blockquote>
<p>and removing the # comment mark so it reads:</p>
<blockquote><p>Include etc/apache22/extra/httpd-languages.conf</p></blockquote>
<p>e. Edit your Apache configuration file httpd-languages.conf</p>
<blockquote><p># vi /usr/local/etc/apache22/extra/httpd-languages.conf</p></blockquote>
<p>Add the following line to the end of the file:</p>
<blockquote><p>AddDefaultCharset On</p></blockquote>
<p>f. Add you hostname to /etc/hosts</p>
<blockquote><p># vi /etc/hosts</p></blockquote>
<p>Add your &#8216;hostname&#8217; and your &#8216;hostname&#8217;.localdomain this file, so it maps to the IP of your machine.</p>
<p>This leads, for instance, to the addition of the following line:</p>
<blockquote><p>46.4.213.254    freebsdx_vm14     freebsdx_vm14.localdomain</p></blockquote>
<p>In the example above the hostname is &#8220;freebsdx_vm14&#8243; and the IP is 46.4.213.254.</p>
<p>g. Restart sendmail</p>
<p>Restart sendmail for the changes of the hostfile to take effect</p>
<blockquote><p># /etc/rc.d/sendmail restart</p></blockquote>
<p>h. Start Apache</p>
<blockquote><p># /usr/local/etc/rc.d/apache22 start</p></blockquote>
<p>i. Check your connectivity</p>
<p>Start your favorite browser from a computer connected to the internet and visit the URL:</p>
<blockquote><p>http://&lt;yourip&gt;</p></blockquote>
<p>Now you should see: &#8220;It works!&#8221;.</p>
<p>If there are no errors: you&#8217;re done. Apache with PHP is installed!</p>
<p>Congratulations. Your perfect FAMP server is up and running!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/3UeEeE2YW-D16aP0nDUPPMfKSP8/0/da"><img src="http://feedads.g.doubleclick.net/~a/3UeEeE2YW-D16aP0nDUPPMfKSP8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3UeEeE2YW-D16aP0nDUPPMfKSP8/1/da"><img src="http://feedads.g.doubleclick.net/~a/3UeEeE2YW-D16aP0nDUPPMfKSP8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/f2LG22Rxndc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=559</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=559</feedburner:origLink></item>
		<item>
		<title>Preventing SSH attacks with DenyHosts</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/zH6Tzg5sHtw/</link>
		<comments>http://www.alwina.org/?p=548#comments</comments>
		<pubDate>Tue, 21 Dec 2010 12:37:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network Services]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[DenyHosts]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[worms]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=548</guid>
		<description><![CDATA[Introduction SSH server running on the common port 22 are subject to many worm-attacks, usually brute force. You can find these attacks in your /var/log/auth.log (or similar logfile like secure.log, depending on your specific operating system). An example how these attacks show up in your logfile: Dec 20 13:02:47 freebsdx_vm14 sshd[70497]: Invalid user admin from [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>SSH server running on the common port 22 are subject to many worm-attacks, usually brute force. You can find these attacks in your /var/log/auth.log (or similar logfile like secure.log, depending on your specific operating system).  An example how these attacks show up in your logfile:</p>
<blockquote><p>Dec 20 13:02:47 freebsdx_vm14 sshd[70497]: Invalid user admin from 75.147.8.209<br />
Dec 20 13:02:50 freebsdx_vm14 sshd[70537]: Invalid user stud from 75.147.8.209<br />
Dec 20 13:02:51 freebsdx_vm14 sshd[70563]: Invalid user trash from 75.147.8.209<br />
Dec 20 13:02:52 freebsdx_vm14 sshd[70585]: Invalid user aaron from 75.147.8.209<br />
Dec 20 13:02:53 freebsdx_vm14 sshd[70601]: Invalid user gt05 from 75.147.8.209<br />
Dec 20 13:02:55 freebsdx_vm14 sshd[70621]: Invalid user william from 75.147.8.209<br />
Dec 20 13:02:56 freebsdx_vm14 sshd[70643]: Invalid user stephanie from 75.147.8.209</p></blockquote>
<p>You can use DenyHosts to help to prevent these annoying attacks.</p>
<p>In this posting I explain how to install and configure this software on FreeBSD.</p>
<p><strong>Procedure</strong></p>
<p>1. install denyhosts from the ports</p>
<blockquote><p># cd /usr/ports/security/denyhosts<br />
# make install clean<br />
# vi /etc/rc.conf</p></blockquote>
<p>2. edit /etc/rc.conf</p>
<p>Add the following lines:</p>
<blockquote><p>denyhosts_enable=&#8221;YES&#8221;<br />
syslogd_flags=&#8221;-s -c&#8221;</p></blockquote>
<p>3. edit rules in /etc/hosts.allow</p>
<blockquote><p># vi /etc/hosts.allow</p></blockquote>
<p>Add # to the line</p>
<blockquote><p>ALL : ALL : allow</p></blockquote>
<p>at the beginning of the file, so it reads</p>
<blockquote><p>#ALL : ALL : allow</p></blockquote>
<p>Add these lines or uncomment the right ones, so we have:</p>
<blockquote><p>sshd : /etc/hosts.deniedssh : deny<br />
sshd : ALL : allow</p></blockquote>
<p>4. create empty /etc/hosts.deniedssh file</p>
<blockquote><p># touch /etc/hosts.deniedssh</p></blockquote>
<p>5. edit /usr/local/etc/denyhosts.conf</p>
<blockquote><p># vi /usr/local/etc/denyhosts.conf</p></blockquote>
<p>Uncomment the line</p>
<blockquote><p>#BLOCK_SERVICE=sshd</p></blockquote>
<p>so it reads</p>
<blockquote><p>BLOCK_SERVICE=sshd</p></blockquote>
<p>6. restart syslogd</p>
<blockquote><p># /etc/rc.d/syslogd restart</p></blockquote>
<p>7. start denhosts</p>
<blockquote><p># /usr/local/etc/rc.d/denyhosts start</p></blockquote>
<p>Now everything should work properly.<br />
You can review and change the configuration of this program by editing denyhosts.conf.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/7xpac-as-wPUYQh0wm_dIx6Vcv4/0/da"><img src="http://feedads.g.doubleclick.net/~a/7xpac-as-wPUYQh0wm_dIx6Vcv4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7xpac-as-wPUYQh0wm_dIx6Vcv4/1/da"><img src="http://feedads.g.doubleclick.net/~a/7xpac-as-wPUYQh0wm_dIx6Vcv4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/zH6Tzg5sHtw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=548</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=548</feedburner:origLink></item>
		<item>
		<title>Howto fix watchdog timeout in FreeBSD 7.x</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/RRvd7UMU5lI/</link>
		<comments>http://www.alwina.org/?p=542#comments</comments>
		<pubDate>Fri, 12 Nov 2010 15:41:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[watchdog]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=542</guid>
		<description><![CDATA[During the shutdown of a Virtual Machine with FreeBSD 7.3 installed on I ran into the error &#8220;30 second watchdog timeout expired&#8221;. At this machine there are several jails installed and due to this error they didn&#8217;t shutdown properly. The cause is a default timeout of 30 seconds as defined in /etc/defaults/rc.conf. It seems to [...]]]></description>
			<content:encoded><![CDATA[<p>During the shutdown of a Virtual Machine with FreeBSD 7.3 installed on I ran into the error &#8220;30 second watchdog timeout expired&#8221;. At this machine there are several jails installed and due to this error they didn&#8217;t shutdown properly.<br />
<a rel="attachment wp-att-543" href="http://www.alwina.org/?attachment_id=543"><img class="alignnone size-full wp-image-543" title="watchdogexpired" src="http://www.alwina.org/wp-content/uploads/2010/11/watchdogexpired.png" alt="30 seconds watchdog timeout expired" /></a></p>
<p>The cause is a default timeout of 30 seconds as defined in /etc/defaults/rc.conf. It seems to me a very short time.</p>
<p><strong>How to set the watchdog timeout</strong></p>
<p>You can set the time-out by adding the following line to your /etc/rc.conf:</p>
<blockquote><p>rcshutdown_timeout=&#8221;300&#8243;</p></blockquote>
<p>In this case the time-out is set to 300 seconds. That worked fine for my application.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ZGxZzKckqYulxiEOWo_0DM3Okzs/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZGxZzKckqYulxiEOWo_0DM3Okzs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZGxZzKckqYulxiEOWo_0DM3Okzs/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZGxZzKckqYulxiEOWo_0DM3Okzs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/RRvd7UMU5lI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=542</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=542</feedburner:origLink></item>
		<item>
		<title>Installing NTOP on CentOS 5.x</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/WoEzpZlxrnY/</link>
		<comments>http://www.alwina.org/?p=509#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:04:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network Services]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[network analyzer]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[network statistics]]></category>
		<category><![CDATA[ntop]]></category>
		<category><![CDATA[round robin database]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[rrdtool]]></category>
		<category><![CDATA[traffic analyzer]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=509</guid>
		<description><![CDATA[NTOP is a network and traffic analyzer that provides lots of information on networking hosts and protocols. It is accessable from a built-in webinterface. In this posting I share how I installed this tool. NTOP makes use of the RRDTool package. This package is used to store and display time-series data. In this case the [...]]]></description>
			<content:encoded><![CDATA[<p>NTOP is a network and traffic analyzer that provides lots of information on networking hosts and protocols. It is accessable from a built-in webinterface. In this posting I share how I installed this tool.</p>
<p>NTOP makes use of the RRDTool package. This package is used to store and display time-series data. In this case the package is used to display all kind of network traffic data with graphs. The procedure is that we first install the RRDTool and then the NTOP package.</p>
<p><strong>I. Installing RRDTool</strong></p>
<p>1. Prepare installation of RRDTool</p>
<p>Login as root and type the folowing commands:</p>
<blockquote><p>yum install cairo-devel libxml2-devel pango-devel pango libpng-devel<br />
yum install freetype freetype-devel libart_lgpl-devel</p></blockquote>
<p>Please pay attention to the _ and the &#8211; in libart_lgpl-devel!</p>
<p>2. Download latest rrdtool</p>
<blockquote><p>cd /opt<br />
wget http://oss.oetiker.ch/rrdtool/pug/rrdtool-1.4.4.tar.gz</p></blockquote>
<p>3. Untar the tar ball</p>
<blockquote><p>tar -zxvf rrdtool-1.4.4.tar.gz</p></blockquote>
<p>4. Configure</p>
<blockquote><p>cd /opt/rrdtool-1.4.4<br />
./configure &#8211;prefix=/usr/local/rrdtool</p></blockquote>
<p>5. Compile and install</p>
<blockquote><p>make<br />
make install</p></blockquote>
<p>Congratulations, first part completed&#8230;</p>
<p><strong>II. Install NTOP</strong></p>
<p>1. Prepare installation of NTOP</p>
<blockquote><p>yum install libpcap libpcap-devel gdbm gdm-devel<br />
yum install GeoIP libevent libevent-devel</p></blockquote>
<p>2. Download the ntop tarball</p>
<blockquote><p>cd /opt<br />
wget http://downloads.sourceforge.net/project/ntop/ntop/ntop-3.3.10/ntop-3.3.10.tar.gz</p></blockquote>
<p>I do not recommend to download newer versions for CentOS 5.x. These versions need Python26 and the installation could interfere with the proper functioning of your CentOS system.</p>
<p>3. Configuration of ntop</p>
<blockquote><p>cd ntop-3.3.10<br />
./autogen.sh &#8211;prefix=/usr/local/ntop</p></blockquote>
<p>4. Compile and install</p>
<blockquote><p>make<br />
make install</p></blockquote>
<p>5. Create ntop user</p>
<blockquote><p>useradd -M -s /sbin/nologin -r ntop</p></blockquote>
<p>6. Setup directory permissions</p>
<blockquote><p>chown ntop:root /usr/local/var/ntop<br />
chown ntop:ntop /usr/local/share/ntop</p></blockquote>
<p>7. Set ntop admin password</p>
<blockquote><p>ntop -A</p></blockquote>
<p>8. Start ntop</p>
<blockquote><p>ntop -d -L -u ntop -P /usr/local/var/ntop &#8211;skip-version-check &#8211;use-syslog=daemon</p></blockquote>
<p>9. Viewing ntop stats</p>
<p>You can view the ntop stats with</p>
<blockquote><p>http://localhost:3000</p></blockquote>
<p>See how good it looks:</p>
<p><a rel="attachment wp-att-511" href="http://www.alwina.org/?attachment_id=511"><img class="alignnone size-full wp-image-511" title="ntop1" src="http://www.alwina.org/wp-content/uploads/2010/10/ntop1.png" alt="" width="616" height="480" /></a></p>
<p><a rel="attachment wp-att-512" href="http://www.alwina.org/?attachment_id=512"><img class="alignnone size-full wp-image-512" title="ntop2" src="http://www.alwina.org/wp-content/uploads/2010/10/ntop2.png" alt="" width="616" height="480" /></a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/kV3FE0Rj9X3ht54_pR3rHOPolcY/0/da"><img src="http://feedads.g.doubleclick.net/~a/kV3FE0Rj9X3ht54_pR3rHOPolcY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kV3FE0Rj9X3ht54_pR3rHOPolcY/1/da"><img src="http://feedads.g.doubleclick.net/~a/kV3FE0Rj9X3ht54_pR3rHOPolcY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/WoEzpZlxrnY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=509</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=509</feedburner:origLink></item>
		<item>
		<title>Closing ports in CentOS</title>
		<link>http://feedproxy.google.com/~r/Alwina/~3/m1Y6SQy5n6I/</link>
		<comments>http://www.alwina.org/?p=479#comments</comments>
		<pubDate>Tue, 19 Oct 2010 03:49:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[open ports]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.alwina.org/?p=479</guid>
		<description><![CDATA[Recently I found too many open ports on my remote CentOS server. You can use the excellent program nmap to do a portscan. The following command gave me insight to my open ports from a client. nmap -sS 1.1.1.1 You should replace 1.1.1.1 with the remote IP of your server. The result: Starting Nmap 5.00 [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Recently I found too many open ports on my remote CentOS server. You can use the excellent program nmap to do a portscan. The following command gave me insight to my open ports from a client.</p>
<blockquote><p>
nmap -sS 1.1.1.1</p></blockquote>
<p>You should replace 1.1.1.1 with the remote IP of your server.<br />
The result:</p>
<blockquote><p>Starting Nmap 5.00 ( http://nmap.org ) at 2010-10-18 22:59 CEST<br />
Interesting ports on static.129.213.4.46.clients.your-server.de (46.4.213.129):<br />
Not shown: 991 closed ports<br />
PORT     STATE    SERVICE<br />
22/tcp   open     ssh<br />
25/tcp   filtered smtp<br />
111/tcp  open     rpcbind<br />
135/tcp  filtered msrpc<br />
5900/tcp open     vnc<br />
5901/tcp open     vnc-1<br />
5902/tcp open     vnc-2<br />
5903/tcp open     vnc-3<br />
5904/tcp open     unknown
</p></blockquote>
<p>For maximum security all unnecessary ports should be closed down. You can do this with the following steps.</p>
<p><strong>1. login to your server</strong></p>
<blockquote><p>ssh root@1.1.1.1</p></blockquote>
<p>Replace 1.1.1.1 with the remote IP of your server</p>
<p><strong>2. start tool for CentOS firewall settings<br />
</strong></p>
<blockquote><p>system-config-securitylevel-tui</p></blockquote>
<p><strong>3. adjust firewall settings</strong></p>
<p><a rel="attachment wp-att-482" href="http://www.alwina.org/?attachment_id=482"><img class="size-full wp-image-482 alignnone" title="sec1" src="http://www.alwina.org/wp-content/uploads/2010/10/sec1.png" alt="" width="660" height="469" /></a><br />
I usually enable the firewall but disable SELLinux. This fine-grained security mechanism adds to security but is difficult to use and error-prone. The next step is to customize the settings.</p>
<p><a rel="attachment wp-att-483" href="http://www.alwina.org/?attachment_id=483"><img class="alignnone size-full wp-image-483" title="sec2" src="http://www.alwina.org/wp-content/uploads/2010/10/sec2.png" alt="" /></a><br />
I enabled SSH, HTTP, HTTPS and cleared the setting under &#8220;Other ports&#8221;.</p>
<p>Juist press the button OK 2x and your are ready.</p>
<p><strong>4. recheck open ports on your clients</strong></p>
<blockquote><p>nmap -sS 1.1.1.1</p></blockquote>
<p>The result:</p>
<blockquote><p>Starting Nmap 5.00 ( http://nmap.org ) at 2010-10-19 06:04 CEST<br />
Interesting ports on static.88-198-27-6.clients.your-server.de (88.198.27.6):<br />
Not shown: 997 filtered ports<br />
PORT    STATE  SERVICE<br />
22/tcp  open   ssh<br />
80/tcp  closed http<br />
443/tcp closed https
</p></blockquote>
<p>Job done, ready.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/C812OuYfZ5n6Cx82AimwOXO9Z1s/0/da"><img src="http://feedads.g.doubleclick.net/~a/C812OuYfZ5n6Cx82AimwOXO9Z1s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/C812OuYfZ5n6Cx82AimwOXO9Z1s/1/da"><img src="http://feedads.g.doubleclick.net/~a/C812OuYfZ5n6Cx82AimwOXO9Z1s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Alwina/~4/m1Y6SQy5n6I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwina.org/?feed=rss2&amp;p=479</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.alwina.org/?p=479</feedburner:origLink></item>
	</channel>
</rss>

