<?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>Sean&#039;s Blog &#187; apache</title>
	<atom:link href="http://seanbehan.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +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>Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation</title>
		<link>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/</link>
		<comments>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 00:53:02 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[phusion]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=892</guid>
		<description><![CDATA[If you follow the instructions on how to install the Rails Redmine PM Software (available here) and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you&#8217;ll see a 404 page not found error. Took me a while to hunt this down. I stopped [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby-on-rails%2Finstalling-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation" data-url="http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>If you follow the instructions on how to install the Rails Redmine PM Software <a href="http://www.redmine.org/wiki/1/RedmineInstall">(available here)</a> and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you&#8217;ll see a 404 page not found error. Took me a while to hunt this down. I stopped thinking about .htaccess in Rails apps but I guess REE+Passenger isn&#8217;t the default deployment yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition</title>
		<link>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/</link>
		<comments>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 21:40:02 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[feedzirra]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mod rails]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[passenger app root]]></category>
		<category><![CDATA[path prefix]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phussion]]></category>
		<category><![CDATA[ree]]></category>
		<category><![CDATA[relative url rails]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[subdirectory]]></category>
		<category><![CDATA[VirtualHost]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=795</guid>
		<description><![CDATA[Here is how to install a Rails application out of a subdirectory (rather than as a subdomain) with the Apache web server(Apache2). In this example I&#8217;m going to use my own blog which is a WordPress installation and serve a Rails application from the subdirectory &#8220;reader&#8221;. Note, I&#8217;m not going to keep my Rails application [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby-on-rails%2Finstall-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition" data-url="http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Here is how to install a Rails application out of a subdirectory (rather than as a subdomain) with the Apache web server(Apache2). In this example I&#8217;m going to use my own blog which is a WordPress installation and serve a Rails application from the subdirectory &#8220;reader&#8221;. Note, I&#8217;m not going to keep my Rails application in the document root of my WordPress Blog, which is a PHP application and therefore anyone could browse the ruby source code :(. I&#8217;ll keep it elsewhere on the filesystem and tell Apache about the location in the VirtualHost file.</p>
<p>You can visit the application by going to  <a href="http://seanbehan.com/reader">http://seanbehan.com/reader</a>. The application just parses a bunch of RSS feeds and displays them.<br />
It uses the Feedzirra library, which I&#8217;ve also written about <a href="http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/">http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/</a>.</p>
<p>I&#8217;m using Phussion Passenger and Ruby Enterprise Edition from the folks at <a href="http://www.modrails.com/">Mod Rails</a>. Installing both Phussion Passenger and Ruby Enterprise Edition is simple and a very well documented process. However, you&#8217;ll need to download and compile them from source. If you install Ruby Enterprise Edition (REE) it comes w/ Passenger so you won&#8217;t need to download it separately. I recommend going with REE. <a href="http://www.rubyenterpriseedition.com/download.html">http://www.rubyenterpriseedition.com/download.html</a></p>
<h3>Installing Ruby Enterprise Edition</h3>
<p>Here are the commands to download and install (change the X.X.X to the package you&#8217;ve actually downloaded).</p>
<pre class="wp-code-highlight prettyprint">
wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz
tar xzvf ruby-enterprise-X.X.X.tar.gz
./ruby-enterprise-X.X.X/installer
</pre>
<p>When you run the installer you&#8217;ll be prompted for an installation location. Just hit enter to install in the default location. Follow the instructions from there and remember to copy/paste any code that they give you.</p>
<p>Official Instructions on installation for Passenger on its own are available here <a href="http://www.modrails.com/install.html">http://www.modrails.com/install.html</a> I&#8217;ve written about setting up an entire box w/ Passenger here <a href="http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/">http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/</a> If you already have Passenger installed and want to use REE just download and install REE and it&#8217;ll recompile Passenger with REE support if you follow the instructions.</p>
<p>*** If you install REE you&#8217;ll need to either link or reinstall all your gems. I linked the REE gem with the one in /usr/bin so that I can run  gem install <gem name> and REE will be aware of it.</p>
<pre class="wp-code-highlight prettyprint">
ln -s /opt/ruby-enterprise-X.X.X/bin/gem /usr/bin/gem
</pre>
<h3>The VirtualHost</h3>
<p>If you have Passenger and REE successfully installed you&#8217;ll need to modify your VirtualHost file and add Rails application information to it.</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;VirtualHost *&amp;gt;
  # Normal virtual host info
  ServerName seanbehan.com
  ServerAlias *.seanbehan.com
  DocumentRoot /var/www/seanbehan.com/wordpress

  # Rails info goes here
  Alias /reader /var/www/seanbehan.com/reader/public
  &amp;lt;Location /reader&amp;gt;
    PassengerAppRoot /var/www/seanbehan.com/reader
    RailsEnv production
  &amp;lt;/Location&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
</pre>
<p>The &#8220;Location&#8221; directive tells apache to forward requests starting with /reader to the directory<br />
/var/www/seanbehan.com/reader/public which is the location of our Rails app. However, we need to add the PassengerAppRoot assignment so that it knows where the actual application lives.</p>
<h3>Routing in Rails with Relative Path</h3>
<p>And finally, your Rails application will need to be aware of the relative url prefix assigned to each route. Normally, you could do this w/ the :path_prefix at the individual route level like so</p>
<pre class="wp-code-highlight prettyprint">
map.resources :feeds, :path_prefix =&gt; &quot;reader&quot;
</pre>
<p>This will work but you can add a line to your RAILS_ROOT/config/environments/production.rb file which will handle all your routes for you. This way you don&#8217;t need to setup a relative path on your development environment work.</p>
<pre class="wp-code-highlight prettyprint">
# in RAILS_ROOT/config/environments/production.rb
config.action_controller.relative_url_root = '/reader'
</pre>
<h3>Final Thoughts</h3>
<p>Remember Ruby Enterprise Edition is the new Ruby Interpreter that your Rails web applications are using. If you<br />
have any gem or rake issues make sure that you&#8217;re using the same interpreter that REE is using. Look in the location<br />
installation of REE &#8220;/opt/ruby-ent&#8230;&#8221; bin/gem or bin/rake and see if that helps. I just linked those to the standard /usr/bin/gem and /usr/bin/rake and everything worked fine.</p>
<p>Also I&#8217;ve read some people have trouble using the alias with passenger. This may be an older issue but works for me without a problem on Ubuntu (latest).</p>
<p>Here are some useful resources I found along the way&#8230;</p>
<p>http://robots.thoughtbot.com/post/159806388/phusion-passenger-with-a-prefix</p>
<p>http://www.modrails.com/documentation/Users%20guide.html#deploying_rails_to_sub_uri</p>
<p>http://www.modrails.com/documentation/Users%20guide.html#RailsBaseURI</p>
<p>http://stackoverflow.com/questions/848258/server-prefix-and-rails-routes</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mod_Python and Web.py on Ubuntu</title>
		<link>http://seanbehan.com/python/mod_python-and-web-py-on-ubuntu/</link>
		<comments>http://seanbehan.com/python/mod_python-and-web-py-on-ubuntu/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 16:17:16 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[.htacess]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[modpython_gateway]]></category>
		<category><![CDATA[mod_python]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[web.py]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=664</guid>
		<description><![CDATA[Download First install mod_python for Apache and then restart/reload the server. apt-get install libapache2-mod-python /etc/init.d/apache2 force-reload apache2ctl restart Next grab the web.py framework from webpy.org. You can grab the tar or use easy_install depending on your setup. wget http://webpy.org/static/web.py-0.33.tar.gz tar xzvf web.py.tar.gz cd web sudo python setup.py install # or if you use easy_install easy_install [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fpython%2Fmod_python-and-web-py-on-ubuntu%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Mod_Python and Web.py on Ubuntu" data-url="http://seanbehan.com/python/mod_python-and-web-py-on-ubuntu/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><h3>Download</h3>
<p>First install mod_python for Apache and then restart/reload the server.</p>
<pre class="wp-code-highlight prettyprint">
apt-get install libapache2-mod-python
/etc/init.d/apache2 force-reload
apache2ctl restart
</pre>
<p>Next grab the web.py framework from webpy.org. You can grab the tar or use easy_install depending on your setup.</p>
<pre class="wp-code-highlight prettyprint">
wget http://webpy.org/static/web.py-0.33.tar.gz
tar xzvf web.py.tar.gz
cd web
sudo python setup.py install
# or if you use easy_install
easy_install web.py
</pre>
<p>Download this file <a href="http://www.aminus.net/browser/modpython_gateway.py?rev=106&#038;format=raw">http://www.aminus.net/browser/modpython_gateway.py?rev=106&#038;format=raw</a> This python package can (with this version) go anywhere in your python path &#8220;sys.path&#8221;. However, I placed it in the wsgiref directory. I&#8217;m running python2.6 so I did the following</p>
<pre class="wp-code-highlight prettyprint">
# after downloading
mv modpython_gateway.py /usr/lib/python2.6/wsgiref/modpython_gateway.py
</pre>
<p>It&#8217;s important to remember that in the VirtualHost file you create the PythonHandler directive will need to reference this module. If you place it outside of the wsgiref directory remember to change the directive as well.</p>
<h3>The VirtualHost</h3>
<p>Now we need to create a VirtualHost for our application. You can run web.py apps without apache and this is good for development mode. To do this the command is</p>
<pre class="wp-code-highlight prettyprint">
python pcode.py 4567
</pre>
<p>where the pcode.py is your web.py application filename and the 4567 is the port number you want to start the server on. I think it defaults to 8080. If you&#8217;re running apache or another web server port 80 will be in use. This is where mod_python (or cgi or fastcgi) come into play.</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;VirtualHost *&amp;gt;
  ServerName py.seanbehan.com
  DocumentRoot /var/www/python/myapp

   #Aliases can trip you up! Pay attention here
   Alias /myapp /var/www/python/myapp
   &amp;lt;Directory /var/www/python/myapp&amp;gt;
      &amp;lt;IfModule python_module&amp;gt;
        PythonPath &quot;sys.path +['/var/www/python/myapp']&quot;
        AddHandler python-program .py
        # modpython_gateway is a file you'll need to download and place in wsgiref
        PythonHandler wsgiref.modpython_gateway::handler
        # This is your python program
        PythonOption wsgi.application pcode::main
        PythonOption SCRIPT_NAME /myapp
        PythonDebug on
      &amp;lt;/IfModule&amp;gt;
    &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
</pre>
<h3>Web.py Application</h3>
<p>Web.py applications can be very simple. Everything can be placed in one file. In this example I created a file &#8220;pcode.py&#8221; and saved it to &#8220;/var/www/python/myapp/pcode.py&#8221;. The contents look like this</p>
<pre class="wp-code-highlight prettyprint">
import web #this is the web.py frameword
web.webapi.internalerror = web.debugerror #lets capture errors for debugging

# map paths to classes
urls = (
    &quot;/&quot;, &quot;hello&quot;
)

# this is the main from the PythonOption wsgi.application pcode::main from our VirtualHost
main = web.application(urls, globals()).wsgifunc()

class hello:
    def GET(self):
        #  web.header... otherwise you'll be prompted to save the file rather than view it in the browser
        web.header('Content-type','text/html')
        yield &quot;Finally got web.py to work!&quot;

if __name__ == &quot;__main__&quot;:
    main.run()
</pre>
<p>Save the file, reload apache and visit the location on the web (In my case py.seanbehan.com/pcode.py/). Remember to include that last &#8220;/&#8221; after the pcode.py. You might get a  &#8220;not found&#8221; message from web.py otherwise.</p>
<h3>Pretty URLs</h3>
<p>You can get pretty urls like &#8220;py.seanbehan.com/hello/world&#8221; if you use the mod_rewrite apache module.</p>
<pre class="wp-code-highlight prettyprint">
a2enmod rewrite
</pre>
<p>You can either set up the rewrite rules in your VirtualHost or in a .htaccess file. I&#8217;ll do the .htaccess so I don&#8217;t have to reload the server for the changes to take effect.</p>
<p>In the same directory as your pcode.py file create a file &#8220;.htaccess&#8221; and in it place this code</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;IfModule mod_rewrite.c&amp;gt;
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^/icons
  RewriteCond %{REQUEST_URI} !^/favicon.ico$
  RewriteCond %{REQUEST_URI} !^(/.*)+code.py/
  RewriteRule ^(.*)$ pcode.py/$1 [PT]
&amp;lt;/IfModule&amp;gt;
</pre>
<h3>Troubleshooting</h3>
<p>I ran into some trouble with the Alias in the VirtualHost file. It looks like this</p>
<pre class="wp-code-highlight prettyprint">
Alias /myapp /var/www/python/myapp
</pre>
<p>This will map incoming urls to the full path on the filesystem so that your python program will run properly. I kept getting the not found error message from web.py without it. There might be a better way to set this up but this is how I got it to work.</p>
<p>Here are some additional resources I found helpful<br />
<a href="http://wiki.slicehost.com/doku.php?id=install_mod_wsgi_on_ubuntu_gutsy">http://wiki.slicehost.com/doku.php?id=install_mod_wsgi_on_ubuntu_gutsy<br />
</a><br />
<a href="http://webpy.org/install">http://webpy.org/install</a><br />
<a href="http://dready.org/blog/2009/01/29/webpy-with-mod_python-on-apache/">http://dready.org/blog/2009/01/29/webpy-with-mod_python-on-apache/</a><br />
<a href="http://www.devisland.net/help/webpy.shtml">http://www.devisland.net/help/webpy.shtml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/python/mod_python-and-web-py-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fun with Apache2 &#8211; httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down</title>
		<link>http://seanbehan.com/apache/fun-with-apache2-httpd-not-running-trying-to-start-98address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-080-no-listening-sockets-available-shutting-down/</link>
		<comments>http://seanbehan.com/apache/fun-with-apache2-httpd-not-running-trying-to-start-98address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-080-no-listening-sockets-available-shutting-down/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:11:35 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2ctl]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[out of memory]]></category>
		<category><![CDATA[passphrase]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=586</guid>
		<description><![CDATA[Have you ever gotten this error message when trying to (re)start Apache httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down If you are running with an SSL certificate on your box, Apache cannot start up without the correct passphrase. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fapache%2Ffun-with-apache2-httpd-not-running-trying-to-start-98address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-080-no-listening-sockets-available-shutting-down%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Fun with Apache2 &#8211; httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down" data-url="http://seanbehan.com/apache/fun-with-apache2-httpd-not-running-trying-to-start-98address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-080-no-listening-sockets-available-shutting-down/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Have you ever gotten this error message when trying to (re)start Apache</p>
<pre class="wp-code-highlight prettyprint">
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
</pre>
<p>If you are running with an SSL certificate on your box, Apache cannot start up without the correct passphrase. I&#8217;ve run into this problem a couple times. Once when I rebuilt my virtual server from Mosso and the reboot process (obviously) required Apache to be started up when the machine came back up. Not being there when the start up phase required the correct passphrase Apache was up but not handling requests. The other time my server crashed when it ran out of memory. It was a 256 meg O&#8217;RAM box running a Rails app. Go figure!</p>
<p>Fortunately, there is an easy solution. Kill Apache and start it up again. If you&#8217;re in the console you&#8217;ll be prompted for the passphrase. Enter it correctly and everything will be fine. Here&#8217;s how I did it.</p>
<pre class="wp-code-highlight prettyprint">
ps aux | grep apache
root      3948  0.0  0.2   4028   668 ?        S    17:48   0:00 /bin/sh -e /etc/rc2.d/S91apache2 start
root      3959  0.0  0.2   4028   616 ?        S    17:48   0:00 /bin/sh /usr/sbin/apache2ctl start
root      3964  0.0  2.4 133564  6472 ?        S    17:48   0:00 /usr/sbin/apache2 -k start
root      4069  0.0  0.2   6268   660 pts/0    R+   17:49   0:00 grep apache
</pre>
<p>I took at a look at the running processes and grep for apache. The one I wanted was the 2nd to last.<br />
Look for the process id and kill it with the -9 option. The process id will be in the second column to the left</p>
<pre class="wp-code-highlight prettyprint">
kill -9 3964
</pre>
<p>After it&#8217;s dead you can restart Apache like so</p>
<pre class="wp-code-highlight prettyprint">
apache2ctl start
</pre>
<p>You&#8217;ll get the prompt for the passphrase. Enter it and everything should be fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/apache/fun-with-apache2-httpd-not-running-trying-to-start-98address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-080-no-listening-sockets-available-shutting-down/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using sendmail to send mail on ubuntu box</title>
		<link>http://seanbehan.com/linux/using-sendmail-to-send-mail-on-ubuntu-box/</link>
		<comments>http://seanbehan.com/linux/using-sendmail-to-send-mail-on-ubuntu-box/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 23:37:00 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=497</guid>
		<description><![CDATA[I normally install postfix for my MTA. However, I&#8217;ve never really used sendmail so I&#8217;d decide to give it a whirl for a new application I&#8217;m working on. I don&#8217;t use it for anything but handling the mail that the application needs to send out, like new user welcome emails, password resets, etc. apt-get install [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fusing-sendmail-to-send-mail-on-ubuntu-box%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Using sendmail to send mail on ubuntu box" data-url="http://seanbehan.com/linux/using-sendmail-to-send-mail-on-ubuntu-box/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I normally install postfix for my MTA. However, I&#8217;ve never really used sendmail so I&#8217;d decide to give it a whirl for a new application I&#8217;m working on. I don&#8217;t use it for anything but handling the mail that the application needs to send out, like new user welcome emails, password resets, etc.</p>
<pre class="wp-code-highlight prettyprint">
apt-get install sendmail
</pre>
<p>Sendmail, unlike postfix, won&#8217;t work out of the box. Postfix will prompt you for the necessary config setup when running the install. Sendmail won&#8217;t, and therefore it&#8217;s not &#8216;out of the box&#8217;. You&#8217;ll have to make some modifications on your own. Nothing major but this is what I&#8217;ve found in order to get it to work, reliably and quickly. The first thing I did was add the fully qualified domain name to my /etc/hosts file</p>
<pre class="wp-code-highlight prettyprint">
#vim /etc/hosts
127.0.0.1 www.mydomain.com
</pre>
<p>After this I added the fully qualified domain name to my apache default configuration file</p>
<pre class="wp-code-highlight prettyprint">
#/etc/apache2/sites-available/default
ServerName www.mydomain.com
#vhost info etc...
</pre>
<p>Reload and restart&#8230;</p>
<pre class="wp-code-highlight prettyprint">
/etc/init.d/apache2 force-reload
/etc/init.d/sendmail restart
</pre>
<p>You can test sendmail like so</p>
<pre class="wp-code-highlight prettyprint">
sendmail email@example.com
hello
from
me
.
</pre>
<p>This should deliver a message to you (the &#8220;.&#8221; on a new line, followed by a new line, closes the message).</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/using-sendmail-to-send-mail-on-ubuntu-box/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dot htaccess file for wordpress installation (.htaccess)</title>
		<link>http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/</link>
		<comments>http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 17:35:01 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=235</guid>
		<description><![CDATA[Login to your wordpress installation and scroll to and click the second to last link set &#8220;Settings&#8221;. You&#8217;ll need to configure wordpress to handle your new links as &#8220;permalinks&#8221;. Make a selection and copy the code into your .htaccess file. WordPress will attempt to do this for you, but only if your webserver can read/write [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fprogramming%2Fdot-htaccess-file-for-wordpress-installation-htaccess%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Dot htaccess file for wordpress installation (.htaccess)" data-url="http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Login to your wordpress installation and scroll to and click the second to last link set &#8220;Settings&#8221;. You&#8217;ll need to configure wordpress to handle your new links as &#8220;permalinks&#8221;. Make a selection and copy the code into your .htaccess file. WordPress will attempt to do this for you, but only if your webserver can read/write to the directory.</p>
<div class="wp-caption alignnone" style="width: 510px"><img title="Permalink Settings" src="http://farm3.static.flickr.com/2476/3553721795_a53f659c57.jpg?v=0" alt="Permalink Settings" width="500" height="192" /><p class="wp-caption-text">Permalink Settings</p></div>
<div class="wp-caption alignnone" style="width: 510px"><img title="Permalink Settings" src="http://farm4.static.flickr.com/3319/3553724141_b847a49170.jpg?v=0" alt="Permalink Settings" width="500" height="94" /><p class="wp-caption-text">Permalink Settings</p></div>
<p>Add the .htaccess file to the root directory of your wordpress installation if wordpress informs you that it can&#8217;t get it to work. The file should be named &#8220;.htaccess&#8221; (w/out quotes).  This is a &#8216;hidden&#8217; file so if you don&#8217;t see it, run the ls -lha command which will list all the files in the directory including hidden files.</p>
<p>Next you&#8217;ll want to edit your VirtualHost file. I used the default VirtualHost under /etc/apache2/sites-available/default You&#8217;ll need to make one modification to this file. You need to tell it to allow overrides, since we&#8217;ll be giving the .htaccess file the right to change configuration options. We need to change the line that says AllowOverrides None to AllowOverrides All</p>
<div class="wp-caption alignnone" style="width: 372px"><img title="AllowOverrides All" src="http://farm3.static.flickr.com/2464/3554563910_0ec5380453.jpg?v=0" alt="AllowOverrides All" width="362" height="239" /><p class="wp-caption-text">AllowOverrides All</p></div>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

