From c3de4cd35d5105cd5d738dce1be4a8a065385644 Mon Sep 17 00:00:00 2001
From: bsides <rafaelbsides@gmail.com>
Date: Wed, 22 May 2013 13:09:51 -0300
Subject: [PATCH] Adding Apache2 + Passenger instead NGINX

---
 docs/INSTALL-ubuntu.md | 53 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/docs/INSTALL-ubuntu.md b/docs/INSTALL-ubuntu.md
index 7d3d2a2c4..16c462fb1 100644
--- a/docs/INSTALL-ubuntu.md
+++ b/docs/INSTALL-ubuntu.md
@@ -36,6 +36,59 @@ At Discourse, we recommend the latest version of nginx. To install on Ubuntu:
 
     # install nginx
     sudo apt-get update && sudo apt-get -y install nginx
+    
+## You could use Apache2
+In the case you want Apache2 INSTEAD nginx to serve your static pages:
+    
+    # Run these commands as your normal login (e.g. "michael")
+    # If you don't have apache2 yet
+    sudo apt-get install apache2
+    
+    # Edit your site details in a new apache2 config file
+    sudo vim /etc/apache2/sites-available/your-domain.com
+    
+    # Put these info inside and change accordingly
+    
+    <VirtualHost *:80>
+      ServerName your-domain.com
+      ServerAlias www.your-domain.com
+    
+      DocumentRoot /srv/www/apps/discourse/public
+    
+      <Directory /srv/www/apps/discourse/public>
+        AllowOverride all
+        Options -MultiViews
+      </Directory>
+    
+      # Custom log file locations
+      ErrorLog  /srv/www/apps/discourse/log/error.log
+      CustomLog /srv/www/apps/discourse/access.log combined
+    </VirtualHost>
+    
+    # Install the Passenger Phusion gem and run the install
+    gem install passenger
+    passenger-install-apache2-module
+    
+    # Next, we "create" a new apache2 module, passenger
+    sudo vim /etc/apache2/mods-available/passenger.load
+    
+    # Inside paste (change the user accodingly)
+    LoadModule passenger_module /home/YOUR-USER/.rvm/gems/ruby-2.0.0-p0/gems/passenger-4.0.2/libout/apache2/mod_passenger.so
+
+    # Now the passenger module configuration
+    sudo vim /etc/apache2/mods-available/passenger.conf
+    
+    # Inside, paste (change the user accodingly)
+    PassengerRoot /home/rafael/.rvm/gems/ruby-2.0.0-p0/gems/passenger-4.0.2
+    PassengerDefaultRuby /home/YOUR-USER/.rvm/wrappers/ruby-2.0.0-p0/ruby
+    
+    # Now activate them all
+    
+    sudo a2nsite your-domain.com
+    sudo a2enmod passenger
+    sudo service apache2 reload
+    sudo service apache2 restart
+
 
 ## Install rvm and ruby environment