<?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>lejnieks &#187; Hudson</title>
	<atom:link href="http://www.lejnieks.com/tag/hudson/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lejnieks.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 Jan 2010 19:22:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing LAMP on a clean Ubuntu server</title>
		<link>http://www.lejnieks.com/2009/02/17/installing-lamp-on-a-clean-ubuntu-server/</link>
		<comments>http://www.lejnieks.com/2009/02/17/installing-lamp-on-a-clean-ubuntu-server/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 04:53:45 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=55</guid>
		<description><![CDATA[I recently just setup a clean Ubuntu server, I&#8217;m going to use this box for my dedicated CI machine and repository. To prepare this box for being a Continuous Integration machine I need to do a few things first including getting it to be accessible to the web. This post walks through getting a clean [...]]]></description>
			<content:encoded><![CDATA[<p>I recently just setup a clean <a title="Ubuntu" href="http://ubuntu.com" target="_blank">Ubuntu</a> server, I&#8217;m going to use this box for my dedicated CI machine and repository. To prepare this box for being a Continuous Integration machine I need to do a few things first including getting it to be accessible to the web. This post walks through getting a clean Ubuntu server setup with LAMP.</p>
<p><span id="more-55"></span>First thing your going to want to do on a fresh install is update your repository sources list otherwise your box is pretty much useless.</p>
<p><strong>Update Sources List</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></div></div>

<p>Now your repository is updated and ready for installs</p>
<p><strong>Install LAMP</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-php5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server</pre></div></div>

<p>If / when prompted set your mysql root password. Next edit bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf</pre></div></div>

<p><strong>Install phpMyAdmin</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-auth-mysql php5-mysql phpmyadmin</pre></div></div>

<p>Now edit the apache2 configuration file to include phpMyAdmin</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></div></div>

<p>At the end of the file add the following two lines</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Include phpmyadmin configuration</span>
Include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin<span style="color: #000000; font-weight: bold;">/</span>apache.conf</pre></div></div>

<p>For good measure restart apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Now lets get phpMyAdmin to work with php5</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-mysql mysql-client</pre></div></div>

<p>You&#8217;r going to need to add the following line to the php.ini file &#8220;extensions=mysql.so&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Now that your done, make sure you chmod your web directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> 0777 <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www <span style="color: #660033;">-R</span></pre></div></div>

<p><strong>original sources</strong><br />
<a href="http://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/">http://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/</a><br />
<a href="http://joeabiraad.com/linuxunix/installing-lamp-on-ubuntu-710-linuxapachemysqlphp/100">http://joeabiraad.com/linuxunix/installing-lamp-on-ubuntu-710-linuxapachemysqlphp/100</a><br />
<a href="https://help.ubuntu.com/community/ApacheMySQLPHP">https://help.ubuntu.com/community/ApacheMySQLPHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2009/02/17/installing-lamp-on-a-clean-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Tomcat on CentOS</title>
		<link>http://www.lejnieks.com/2008/11/17/installing-tomcat-on-centos/</link>
		<comments>http://www.lejnieks.com/2008/11/17/installing-tomcat-on-centos/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 05:27:26 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=52</guid>
		<description><![CDATA[Continuing in setting up my CentOS server, the next thing I need is to get Hudson setup. Before I can get Hudson up and running I&#8217;ll need to get Tomcat installed. I could of course use Winstone which will get me up and running, but I know I will need Tomcat soon for some other [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing in setting up my CentOS server, the next thing I need is to get Hudson setup. Before I can get Hudson up and running I&#8217;ll need to get Tomcat installed. I could of course use <a href="http://winstone.sourceforge.net/">Winstone</a> which will get me up and running, but I know I will need Tomcat soon for some other things as well so might as well get it setup now.</p>
<p><span id="more-52"></span></p>
<p><strong>The Setup</strong></p>
<p>Install some base packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install rpm-build gcc-java</span></pre></div></div>

<p>Add jpackage repository to your yum repos</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /etc/yum.repos.d/</span>
<span style="color: #666666; font-style: italic;"># wget https://jpackage.org/jpackage.repo</span>
<span style="color: #666666; font-style: italic;"># vi /etc/yum.repos.d/jpackage.repo</span></pre></div></div>

<p>set enabled = 1 on all repo files and save the .repo file. Next update yum.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum update</span></pre></div></div>

<p>Download and install some SRPMs.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /usr/local/src</span>
<span style="color: #666666; font-style: italic;"># wget ftp://jpackage.hmdc.harvard.edu/mirrors/JPackage/1.7/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.11-1jpp.nosrc.rpm</span>
<span style="color: #666666; font-style: italic;"># wget ftp://jpackage.hmdc.harvard.edu/mirrors/JPackage/1.6/generic/non-free/SRPMS/jta-1.0.1-0.b.4jpp.nosrc.rpm</span></pre></div></div>

<p>Download some required files to /usr/src/redhat/SOURCES:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /usr/src/redhat/SOURCES</span></pre></div></div>

<p>Download jta-1_0_1B-classes.zip here after agreeing to the license.<br />
Download jdk-1_5_0_11-linux-i586.bin, again after agreeing to a license.<br />
Build and install the rpms.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># rpmbuild --rebuild /usr/local/src/java-1.5.0-sun-1.5.0.11-1jpp.nosrc.rpm</span>
<span style="color: #666666; font-style: italic;"># rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-1.5.0-11-1jpp.i586.rpm</span>
<span style="color: #666666; font-style: italic;"># rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.11-1jpp.i586.rpm</span>
<span style="color: #666666; font-style: italic;"># rpmbuild --rebuild --without javadoc /usr/local/src/jta-1.0.1-0.b.4jpp.nosrc.rpm</span>
<span style="color: #666666; font-style: italic;"># rpm -ivh /usr/src/redhat/RPMS/noarch/jta-1.0.1-0.b.4jpp.noarch.rpm</span></pre></div></div>

<p>Now install tomcat</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps</span></pre></div></div>

<p>note: if you get a dependency error at this point, like I did at first, try this solution for updating your jpackage-utils <a href="http://blog.sixsigns.com/2008/07/11/java-142-gcj-compati386-update-problem-on-centos/">http://blog.sixsigns.com/2008/07/11/java-142-gcj-compati386-update-problem-on-centos/</a> which basically is to install the <a href="http://dev.centos.org/centos/5/testing/i386/RPMS/jpackage-utils-1.7.5-1jpp.1.el5.centos.noarch.rpm">http://dev.centos.org/centos/5/testing/i386/RPMS/jpackage-utils-1.7.5-1jpp.1.el5.centos.noarch.rpm</a> package and update yum</p>
<p>At this point you should be able to navigate to your ip on port 8080 and see the default tomcat page</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2008/11/17/installing-tomcat-on-centos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up a CentOS server</title>
		<link>http://www.lejnieks.com/2008/11/17/setting-up-a-centos-server/</link>
		<comments>http://www.lejnieks.com/2008/11/17/setting-up-a-centos-server/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 05:14:49 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Webmin]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=51</guid>
		<description><![CDATA[More recently I have been having some issues with Plesk, I&#8217;ve felt like I&#8217;ve been fighting with Plesk&#8217;s default generic templates and cookie cutter processes. What should be simple such as adding custom wars to Tomcat end up proving more times then not to be a royal pain. This passed month I ended up playing [...]]]></description>
			<content:encoded><![CDATA[<p>More recently I have been having some issues with Plesk, I&#8217;ve felt like I&#8217;ve been fighting with Plesk&#8217;s default generic templates and cookie cutter processes. What should be simple such as adding custom wars to Tomcat end up proving more times then not to be a royal pain. This passed month I ended up playing around with <a href="https://hudson.dev.java.net/">Hudson</a>, a Continous Integration server, and I found myself struggling through what should have been a seamless installation. Basically it took me 10 minutes to setup, install, and configure my first build in Hudson on my Mac but to be honest I ended up giving up after 3 days of struggling to get Hudson installed on my dedicated CentOS server that ran Plesk. Dont get me wrong, there are plenty of other things that bug me about Plesk but this latest thing was what ended up pushing me to get a basic server setup from scratch and configured exactly as I wanted it.</p>
<p><span id="more-51"></span></p>
<p>With that said, I would be remiss if I didn&#8217;t also mention that fact that, while I have some issue with plesk and its somewhat cookie cutter approach to web administration, it still is a great web administration tool for the most part.</p>
<p>My goal is basically to get a bare server up and running and administer-able without using Plesk or CPanel. The more I play around with this setup the more I will update the server section of this site with new configurations and additions as I learn them.</p>
<p><strong>Setting up a fresh CentOS server</strong></p>
<ol>
<li>Get a dedicated server from someone, I used <a href="http://aplus.net">aplus.net</a></li>
<li>Choose a basic installation, this means no plesk, cpanel etc&#8230; (keep in mind, eventually we will setup Webmin)</li>
<li>Start setting up your new box</li>
</ol>
<p><strong>The setup</strong><br />
shell into you server</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ssh root@111.111.11.111</span></pre></div></div>

<p>Install LAMP (Linux Apache MySQL PHP) installed.<br />
You will do this using <a href="http://en.wikipedia.org/wiki/Yellow_dog_Updater,_Modified">yum</a>. Yum is an rpm wrapper that will allow you to install various services and applications with a lot more ease.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum -y install httpd</span>
<span style="color: #666666; font-style: italic;"># yum -y install php</span>
<span style="color: #666666; font-style: italic;"># yum -y install mysql</span>
<span style="color: #666666; font-style: italic;"># yum -y install mysql-server</span>
<span style="color: #666666; font-style: italic;"># yum -y install php-mysql</span></pre></div></div>

<p><em>note: the -y switch forces &#8220;yes&#8221; when prompted, so you don&#8217;t have to</em></p>
<p>Next configure the services you just installed to start automatically when the server restarts</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /sbin/chkconfig httpd on</span>
<span style="color: #666666; font-style: italic;"># /sbin/chkconfig --add mysqld</span>
<span style="color: #666666; font-style: italic;"># /sbin/chkconfig mysqld on</span>
<span style="color: #666666; font-style: italic;"># /sbin/service httpd start</span>
<span style="color: #666666; font-style: italic;"># /sbin/service mysqld start</span></pre></div></div>

<p>At this point, you now have mysql installed, but you will want to set up the mysql database root password. Without a password, any user on the box can login to mysql as database root. The mysql root account is a separate password from the machine root account.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mysqladmin -u root password 'new-password'</span></pre></div></div>

<p>At this point, some of you may be able to navigate to your public ip address and see the default CentOS page, I was not able to see this. Basically at this point, what I had was LAMP installed on my shiny new server but no one would ever know because port 80 was blocked.</p>
<p><strong>Enter iptables.</strong>..<br />
Iptables is your firewall, its baked into CentOS, and its extremely powerful. I don&#8217;t know the complete depth of iptables but for this tutorial you&#8217;ll need to just get a few ports opened up and that&#8217;s it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># iptables -F</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p udp -m udp --dport domain -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 22 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 10000 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 25 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 8080 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 80 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp -m tcp --dport domain -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A FORWARD -o eth0 -j LOG  --log-level 7 --log-prefix BANDWIDTH_OUT:</span>
<span style="color: #666666; font-style: italic;"># iptables -A FORWARD -i eth0 -j LOG  --log-level 7 --log-prefix BANDWIDTH_IN:</span>
<span style="color: #666666; font-style: italic;"># iptables -A OUTPUT -o eth0 -j LOG  --log-level 7 --log-prefix BANDWIDTH_OUT:</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -i eth0 -j LOG  --log-level 7 --log-prefix BANDWIDTH_IN:</span></pre></div></div>

<p>make sure you save your iptables configuration so you don&#8217;t have to re-edit it when you reboot your server</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /sbin/service iptables save</span></pre></div></div>

<p>now just restart your firewall</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/iptables restart</span></pre></div></div>

<p>now you can check your configuration</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># iptables -L -v</span></pre></div></div>

<p>at this point, for good measure you might want to reboot your server</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># reboot</span></pre></div></div>

<p>once your server reboots you should now be able to browse to your public IP address and get the default CentOS page.</p>
<p>you can learn more about iptables here: <a href="http://wiki.centos.org/HowTos/Network/IPTables">http://wiki.centos.org/HowTos/Network/IPTables</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2008/11/17/setting-up-a-centos-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
