<?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>Mad Python &#187; apache</title>
	<atom:link href="http://blog.madpython.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.madpython.com</link>
	<description>Watch out.. he's angry</description>
	<lastBuildDate>Thu, 04 Nov 2010 14:19:16 +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>Apache2 shortcuts</title>
		<link>http://blog.madpython.com/2009/03/02/apache2-shortcuts/</link>
		<comments>http://blog.madpython.com/2009/03/02/apache2-shortcuts/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 15:59:50 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.madpython.com/?p=29</guid>
		<description><![CDATA[I&#8217;ve been maintaining and managing Apache servers for over 10 years now, but for some reason, I never bothered to RTFM when it came to enabling/disabling modules and site configs in apache2.. As it turns out, you don&#8217;t have to &#8230; <a href="http://blog.madpython.com/2009/03/02/apache2-shortcuts/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/' rel='bookmark' title='Extending PostgreSQL with Python'>Extending PostgreSQL with Python</a></li>
<li><a href='http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/' rel='bookmark' title='Fixing custom sequences in PostgreSQL'>Fixing custom sequences in PostgreSQL</a></li>
<li><a href='http://blog.madpython.com/2009/03/01/ahh-those-cool-little-cli-tools/' rel='bookmark' title='Ahh those cool little CLI tools&#8230;'>Ahh those cool little CLI tools&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been maintaining and managing Apache servers for over 10 years now, but for some reason, I never bothered to RTFM when it came to enabling/disabling modules and site configs in apache2.. As it turns out, you don&#8217;t have to manually create symlinks from mods_available to mods_enabled and sites_available to sites_enabled, as Apache2 includes a handful of shortcut scripts to do this work for you&#8230; Doh!</p>
<p>To enable a module in your apache2 config, instead of doing the old</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>mods_available<span style="color: #000000; font-weight: bold;">/</span>mod_rewrite.conf <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>mods_enabled<span style="color: #000000; font-weight: bold;">/</span>mod_rewrite.conf
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>mods_available<span style="color: #000000; font-weight: bold;">/</span>mod_rewrite.load <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>mods_enabled<span style="color: #000000; font-weight: bold;">/</span>mod_rewrite.load</pre></div></div>

<p>Next time, just do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod rewrite <span style="color: #000000; font-weight: bold;">&amp;&amp;</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>To disable this module, try</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2dismod rewrite <span style="color: #000000; font-weight: bold;">&amp;&amp;</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>Similarly, to enable a site config, try</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2ensite myVhost.com <span style="color: #000000; font-weight: bold;">&amp;&amp;</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> and to disable it, obviously, try</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2dissite myVhost.com <span style="color: #000000; font-weight: bold;">&amp;&amp;</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>Finally, if you&#8217;d like to lint through your Apache2 config files before issuing a restart which might be responsible for some downtime if it doesn&#8217;t work, try</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">apache2ctl configtest</pre></div></div>

<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="Reddit" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;linkname=Apache2%20shortcuts" title="Twitter" rel="nofollow" target="_blank"><img src="http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;title=Apache2%20shortcuts" id="wpa2a_2">Share</a></p><p>Related posts:<ol>
<li><a href='http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/' rel='bookmark' title='Extending PostgreSQL with Python'>Extending PostgreSQL with Python</a></li>
<li><a href='http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/' rel='bookmark' title='Fixing custom sequences in PostgreSQL'>Fixing custom sequences in PostgreSQL</a></li>
<li><a href='http://blog.madpython.com/2009/03/01/ahh-those-cool-little-cli-tools/' rel='bookmark' title='Ahh those cool little CLI tools&#8230;'>Ahh those cool little CLI tools&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.madpython.com/2009/03/02/apache2-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

