<?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>Connecting the dots... &#187; apache 2</title>
	<atom:link href="http://blog.rajatpandit.com/tag/apache-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajatpandit.com</link>
	<description>Thoughts on Web Development, Scalability and Application Architecture</description>
	<lastBuildDate>Mon, 19 Jul 2010 12:46:50 +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>Mass Virtual Host using VirtualDocumentRoot</title>
		<link>http://blog.rajatpandit.com/2009/10/17/mass-virtual-host-using-virtualdocumentroot/</link>
		<comments>http://blog.rajatpandit.com/2009/10/17/mass-virtual-host-using-virtualdocumentroot/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 12:26:31 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[VirtualDocumentRoot]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=360</guid>
		<description><![CDATA[Recently I required to update my development environment such that I can quickly setup virtual hosts, without needing to update the httpd.conf file everytime. It turns out that Apache supports a directive called VirtualDocumentRoot which allows you the map your host directories based on the domain name. I wanted to setup domains like project-name.user-name.devserver.name, hence [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I required to update my development environment such that I can quickly setup virtual hosts, without needing to update the httpd.conf file everytime. It turns out that <a href="http://httpd.apache.org">Apache</a> supports a directive called <code>VirtualDocumentRoot</code> which allows you the map your host directories based on the domain name.<br />
I wanted to setup domains like <code>project-name.user-name.devserver.name</code>, hence following is the settings I used to get that setup. So using the following configuration domain name I can use is <code>secret.rp.mydevserver.com</code> and the code for it is located at /websites/rp/secret/web assuming I am using <a href="http://symfony-project.org">symfony</a> (hence the web directory)</p>
<pre class="brush: bash;">
ServerAdmin rajat_pandit@ipcmedia.com
CustomLog /var/log/apache2/dynamic.log cookie
ErrorLog /var/log/apache2/dynamic.error.log
RewriteLogLevel 0
RewriteLog /var/log/apache2/dynamic.rewrite.log

DocumentRoot /websites
UseCanonicalName off

VirtualDocumentRoot /websites/%2/%1/web
AllowOverride All

RewriteEngine On
</pre>
<p>More details can be found at <a href="http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html#examples">http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html#examples</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/10/17/mass-virtual-host-using-virtualdocumentroot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using macport to setup php5 / apache2 on Leopard</title>
		<link>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/</link>
		<comments>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 23:49:11 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[darwin]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[deps]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac ports]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[port search]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[variants]]></category>
		<category><![CDATA[web server support]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=237</guid>
		<description><![CDATA[As you can tell I got myself a new macbook and its pretty much ritualistic to install apache/php5 on it for me. I agree it comes with both of them pre-installed but really I just like to do it for the easy of configuration. I have written earlier how I compiled everything on Leopard in [...]]]></description>
			<content:encoded><![CDATA[<p> As you can tell  I got myself a new macbook and its pretty much ritualistic to install apache/php5 on it for me. I agree it comes with both of them pre-installed but really I just like to do it for the easy of configuration. I have written earlier <a href="http://blog.rajatpandit.com/2008/01/31/compiling-apache-php-for-mac/">how I compiled everything</a> on Leopard in the past. This time I plan on trying something different.<br />
I am using mac ports (possibly coz I am getting lazier). Here are a couple of quick start guides of port.</p>
<pre class="brush: bash;">
# Selfupdate
$sudo port selfupdate

# selfupdate, if you want to see what's going on.
$sudo port -d selfupdate

#search for a particular package
$sudo port search apache2

#search for variants like for instance, mysql and its server
$sudo port install mysql 

#search information about package
$sudo port info php5

#get info about dependencies for a package
$sudo port deps php5

#install package
$sudo port install apache2

#install package with variant like mysql and its server
$sudo port install mysql +server

#clean all the guff
$sudo port clean --all

#get the contents of a package
$sudo port contents apache2

#get installed packages
$sudo port installed

#upgrade package
$sudo port upgrade apache2

#update all outdated packages
$sudo port upgrade outdated
</pre>
<p>So back to setting up apache2 and php5</p>
<pre class="brush: bash;">
$sudo port install apache2
</pre>
<p>It does its standard business and then confirms the installation, similarly for installing php5, it has the following variants available that might interest you.</p>
<pre class="brush: bash;">
rp@busybox:~ rp$ sudo port variants php5
Password:
php5 has the variants:
	darwin_6: Platform variant, do not select manually
	darwin_7: Platform variant, do not select manually
	macosx: Platform variant, do not select manually
	no_web: Don't include any web server support
	apache: Add Apache 1 web server module
	apache2: Add Apache 2.2 web server module (default)
	fastcgi: Add FastCGI web server binary
	gmp: Add GNU MP functions
	dbase: Add dBase file format support
	imap: enable operation with IMAP protocol
	pspell: Add pspell spell-checking functions
	tidy: add Tidy support
	mssql: add support for MS-SQL server
	snmp: use Apple snmp
	macports_snmp: use MacPorts snmp
	mysql3: build MySQL 3 support
	mysql4: build MySQL 4 support
	mysql5: build MySQL 5 support
	oracle: Add Oracle oci8 database functions with the Oracle Instant Client
	postgresql82: provide postgresql82 support
	postgresql83: provide postgresql83 support
	sqlite: build sqlite support
	ipc: build IPC support
	pcntl: provide process control
	pear: add pear stuff
	readline: Add GNU readline functions
	sockets: Add socket communication functions
	t1lib: Add PostScript Type 1 font support with t1lib
	universal: Build for multiple architectures
</pre>
<p>I would go with just the basics. </p>
<pre class="brush: bash;">
$sudo port install php5 +apache2 +mysql5 +pear
</pre>
<p>With that done, now you can create your own copy of apaches httpd.conf</p>
<pre class="brush: bash;">
sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf
</pre>
<p>Activate the php5 module.</p>
<pre class="brush: bash;">
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n &quot;php5&quot; libphp5.so
[activating module 'php5' in /opt/local/apache2/conf/httpd.conf]
</pre>
<p>and then you can play around with the config files as much as you like to set it up the way you prefer and then fire up the server using the following command:</p>
<pre class="brush: bash;">
apache2ctl start
</pre>
<p>and it should all work fine in your browsers. try out the config with the standard php testing function.</p>
<pre class="brush: bash;">
phpinfo();
</pre>
<p>Have fun, port is easy and simple, lets you get to the point where you can do something productive and creative. </p>
<p>Photo credit to my esteemed collegue: <a href="http://www.flickr.com/photos/thevoicewithin">Neil Crosby</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to enable apache mod_rewrite on ubuntu</title>
		<link>http://blog.rajatpandit.com/2009/02/12/how-to-enable-mod_rewrite-on-ubuntu/</link>
		<comments>http://blog.rajatpandit.com/2009/02/12/how-to-enable-mod_rewrite-on-ubuntu/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 23:40:03 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[configuration files]]></category>
		<category><![CDATA[directory permissions]]></category>
		<category><![CDATA[followsymlinks multiviews]]></category>
		<category><![CDATA[htaccess file]]></category>
		<category><![CDATA[hth]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[struggle]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=208</guid>
		<description><![CDATA[I have been moving my development to Linux lately and had the first real struggle getting the rewrite stuff working on Apache. Problem wasn&#8217;t that I didn&#8217;t know how to do it, (BTW usually i would prefer to have a self compiled version of Apache as I would know what&#8217;s in it) but that the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been moving my development to Linux lately and had the first real struggle getting the rewrite stuff working on Apache. Problem wasn&#8217;t that I didn&#8217;t know how to do it, (BTW usually i would prefer to have a self compiled version of Apache as I would know what&#8217;s in it) but that the configuration files were all so different from what I am used on Leopard and BSD etc.. Anyway so here&#8217;s what I did.</p>
<pre class="brush: php;">
# sudo a2enmod rewrite
# sudo /etc/init.d/apache2 restart
</pre>
<p>To disable an Apache 2 module, you can run:</p>
<pre class="brush: php;">
# sudo a2dismod rewrite
# sudo /etc/init.d/apache2 restart
</pre>
<p>That does the reverse.</p>
<p>With mod_rewrite enabled, you can use the .htaccess file.By the way in your directory permissions, you must set AllowOverride to “all” like this:</p>
<p>[config]<br />
<Directory /home/projects/whatever><br />
  Options Indexes FollowSymLinks MultiViews<br />
  AllowOverride all<br />
  Order allow,deny<br />
  allow from all<br />
</Directory><br />
[/config]</p>
<p>HTH</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/02/12/how-to-enable-mod_rewrite-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
