Merge pull request #880 from bsides/patch-1

Adding Apache2 + Passenger instead NGINX
This commit is contained in:
Robin Ward 2013-05-22 13:35:43 -07:00
commit 7f7a770f3b
1 changed files with 53 additions and 0 deletions

View File

@ -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