diff options
| author | Miquel Sabaté <mikisabate@gmail.com> | 2013-11-30 17:28:25 +0100 |
|---|---|---|
| committer | Miquel Sabaté <mikisabate@gmail.com> | 2013-11-30 17:28:25 +0100 |
| commit | 267403fe5d1e1142d54c6d699f8deeac2a3334ec (patch) | |
| tree | 76c3bb69125a9752636c9e63cbf04c7579cda5e5 /nginx_unicorn/README.rdoc | |
| parent | f198c41756a408a0b4b4e9769c778fed8abd944f (diff) | |
| download | dotfiles-267403fe5d1e1142d54c6d699f8deeac2a3334ec.tar.gz dotfiles-267403fe5d1e1142d54c6d699f8deeac2a3334ec.zip | |
Removed the NGinx + Unicorn config files.
These files were outdated. Anyways, I think that this kind of files shouldn't
be placed in a "dotfiles" repo.
Diffstat (limited to 'nginx_unicorn/README.rdoc')
| -rw-r--r-- | nginx_unicorn/README.rdoc | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/nginx_unicorn/README.rdoc b/nginx_unicorn/README.rdoc deleted file mode 100644 index 9c5430f..0000000 --- a/nginx_unicorn/README.rdoc +++ /dev/null @@ -1,68 +0,0 @@ -= Nginx / Unicorn - -== Words of Warning - -I have decided to upload the configuration of my Nginx/Unicorn setup. Please -be aware that: - -- I'm using Archlinux and, therefore, the directory hierarchy may change (even for other Linux distros such as Ubuntu). -- I'll assume that your Rails app is located at /home/mssola/myapp, change it at your own needs. -- I'm not saying that NGinx/Unicorn is the best combo ever. Be sure to understand what is NGinx and Unicorn before going any further. - -== Setting up NGinx - -My Nginx configuration may seem tricky but it's quite clean. My point is that -you just want to have a basic configuration on your /etc/nginx/conf directory -and then enable sites by linking more configuration (specific for each app) -inside the /etc/nginx/sites-enabled directory (not created by default). Here -it goes: - - # Setting up the basic HTTP configuration - - $ sudo cp -f nginx.http.conf /etc/nginx/conf/nginx.conf - $ sudo mkdir /etc/nginx/sites-enabled - - # Copy the nginx.server.conf to your Rails application config directory. - # After doing this, you have to edit this file and change the root with - # the public path of your Rails application (in our case /home/mssola/myapp/public). - # You also want to change the upstream unicorn block by replacing the 'my_app_name' - # with the name of your app. - - $ cp nginx.server.conf /home/mssola/myapp/config/nginx.conf - $ vim /home/mssola/myapp/config/nginx.conf - - # Finally create a soft link pointing to the specific configuration file for - # this new site we want to enable. - - $ sudo ln -s /home/mssola/myapp/config/nginx.conf /etc/nginx/sites-enabled/my_app_name - -After going through the steps shown above, you should be able to start the -nginx daemon successfully. If you try to access to localhost you'll see the -500 page because Unicorn is not configured yet, but at least it proves that -NGinx is properly running. - -== Setting up Unicorn - -My Unicorn configuration assumes that you want as many worker processes as -CPU cores you have (using a linux-specific command). In order to change this and -more, please configure the unicorn.rb file. In this file you also have to -change the working directory (WD constant) with the path of your Rails -application (/home/mssola/myapp in our case). Don't forget to replace all -the 'my_app_name' with the name of your app. After editing this file, you -have to edit the unicorn_init.sh script and change the APP_ROOT variable -with the path of your Rails application (/home/mssola/myapp again :) ). I -usually place both files to the config directory of my Rails -application. However it's a good practice to copy the script file to the -daemons directory in order to start unicorn at startup (assuming that you -also start the nginx daemon at startup). With this script you can start, -stop, upgrade, etc. Unicorn. In fact this script is quite similar to -the example provided by the Unicorn folks. - -== What's next? - -Please be sure to understand what's going on the configurators. In order to -fully understand it, check out the awesome documentation for the NGinx and -Unicorn projects. Furthermore, there're more interesting unicorn configurators -on the Unicorn repository, showing more possible scenarios and use cases. - -I hope this is helpful :) |
