It was designed to be the go-to server for Rubinius, but also works well with JRuby and MRI. Puma ( Github Page) is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications, and is considered the replacement for Webrick and Mongrel. Puma (with Nginx as reverse proxy server) Rails_env development # Rails environment. Root path_to_app/public # Be sure to point to 'public' folder! To serve an application with Nginx, configure it as follows: The installer will provide you with any additional information regarding the installation (such as installing additional libraries). In case a rails application is deployed with a sub-URI, like, some additional configuration is required, see the Passenger documentationįor Nginx, install the nginx-mod-passenger package (if passenger is not installed from gem), and run: If you are aiming to use Apache HTTP Server, install the mod_passenger package (if passenger is not installed from gem), and run: Installing the 'passenger' gem from any version of ruby (user setting):.Two differents choices (one or the other, not both in same time): As for Apache, let Passenger set up the module for you. Nginx does not support modules as Apache and has to be compiled with mod_rails in order to support Passenger let Passenger compile it for you. Phusion Passenger is a module available for Nginx and Apache HTTP Server, that greatly simplifies setting up a Rails server environment. Proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for It probably does not work without additional configuration): You can now easily start and stop unicorn using systemctlĪfter setting up Nginx, configure unicorn as an upstream server using something like this (Warning: this is a stripped example. etc/systemd/system/rvice ĮxecStart=/usr/bin/unicorn -D -E production -c /etc/unicorn/ Put the following contents in /etc/systemd/system/rvice: # /usr/bin/unicorn -D -E production -c /etc/unicorn/ GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true etc/unicorn/ working_directory "/srv/http/redmine" For example here is a configuration example based on this tutorial for Redmine: Then create a configuration file for your application in /etc/unicorn/. Explanation of differences between Unicorn and Mongrel. It is used by Github, and it uses an architecture that tries hard to find the best child for handling a request. Instead, a web server must sit between clients and Unicorn, proxying requests as needed. Unicorn is an application server that cannot talk directly to clients. Thin is a fast and very simple Ruby web server. Instead, you should use an application server such as #Thin, #Unicorn or Phusion Passenger. The built-in Ruby On Rails HTTP server (called Puma) is convenient for basic development, but it is not recommended for production use. Note: If Ruby complains about not being able to find a JavaScript runtime, install nodejs.Ī test-page should be shown greeting you "Welcome aboard".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |