Tag Archives: Ubuntu

Setup Redmine on Ubuntu with nginx webserver.

If You have already configured Nginx server on Ubuntu  with php back-end, but You need to setup Redmine bug-tracker, you need Setup another environment and one of the is “Phusion Passenger” which better to setup in current situation in Stand-Alone mode.

Config for Virtual Hosts in /etc/nginx/sites-available: 
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

server {
listen 80;
server_name www.foo.com;

# Tells Nginx to serve static assets from this directory.
root /webapps/foo/public;

location / {
# Tells Nginx to forward all requests for www.foo.com
# to the Passenger Standalone instance listening on port 4000.
proxy_pass http://127.0.0.1:4000;

# These are "magic" Nginx configuration options that
# should be present in order to make the reverse proxying
# work properly. Also contains some options that make WebSockets
# work properly with Passenger Standalone. Please learn more at
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
}
}

I recommend create own file for example (passenger) and put it in directory
/etc/nginx/sites-available with symbolic-link
to /etc/nginx/sites-enabled by this command:

ln -s /etc/nginx/sites-available/passenger /etc/nginx/sites-enabled/passenger


How to lunch Phusion Passenger web server?

First of all You should go to Your application folder
where placed root files of Your application in current situation
 it's Redmine root directory,
after start process in background by this command:

# Start foo on port 4000
$ cd /webapps/foo
$ passenger start –daemonize –address 127.0.0.1 –port 4000

# Start bar on port 4010
$ cd /webapps/bar
$ passenger start –daemonize –address 127.0.0.1 –port 4010

Link: Original article