diff --git a/Installing-Tracks-2.2.2-on-CentOS-6.5-Minimal-x86_64.md b/Installing-Tracks-2.2.2-on-CentOS-6.5-Minimal-x86_64.md index b7d3e50..3c46d77 100644 --- a/Installing-Tracks-2.2.2-on-CentOS-6.5-Minimal-x86_64.md +++ b/Installing-Tracks-2.2.2-on-CentOS-6.5-Minimal-x86_64.md @@ -701,67 +701,4 @@ $ sudo semodule -i passenger.pp Set SELinux to enforcing mode. Update `/etc/selinux/config` or execute setenforce as appropriate. ``` $ sudo setenforce 1 -``` - -##Phusion Passenger, Rails, & Sub-URIs -In the course of using ruby, rails, and passenger, you may need to create multiple sites or apps not just one. Using Passenger sub-uris will accomplish this task. In addition, when using Nginx (see below), using a sub-uri simplifies configuration and reduces hours of banging your head on your desk. - -With Tracks, update the site.yml to use a subdir, then update Apache's configuration to reflect the virtual host shown below. So for www.somedomain.com we will use subdir tracks which result with http://www.somedomain.com/tracks. - -Remove the comment '#' and update to read subdir: "/tracks" -``` -$ vi /home/tracks/tracks/config/site.yml -``` - -Update the apache2's httpd.conf, existing virtual host stanza, to read as follows: -``` -$ sudo vi /etc/httpd/conf/httpd.conf - - - ServerName trk.harmonson.net - DocumentRoot /home/tracks/tracks/public - -Alias /tracks /home/tracks/tracks/public - - - PassengerBaseURI /tracks - PassengerAppRoot /home/tracks/tracks - - - - Allow from all - # This relaxes Apache security settings. - AllowOverride all - # MultiViews must be turned off. - Options -MultiViews - # Uncomment this if you're on Apache >= 2.4: - #Require all granted - - - -``` - - -Restart Apache for changes to take effect. -``` -$ sudo service httpd restart -``` - -##Nginx reverse proxy -Nginx is a very efficient web service which I use as a reverse proxy. Below is an example of a working Nginx 1.4 location config using the Tracks build above and sub-uri /tracks. This is only the Nginx /location stanza not a complete nginx.conf configuration file. -``` -### Tracks -location /tracks/ { - auth_basic "off"; - -## Set Headers - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - -## Tracks Backend - proxy_pass http://192.168.1.111/tracks/; - proxy_redirect off; -} ``` \ No newline at end of file