Setting up Unicorn with Nginx
gem install unicorn or gem 'unciron' |
1 install Nginx
yum install ...
2 Configuration
vi /etc/nginx/nginx.conf |
It's adviced to run as a seperae user.
Here is a example:
sudo user add -s /sbin/nologin -r nginx sudo usermod -a -G web nginx ; add nginx user into web group <br>sudo mkdir / var /www ; this should be the static path in nginx.conf<br>sudo chgrp -R web / var /www ; set this path to group "web" <br>sudo chmod -R 775 / var /www ; set group write permission<br>sudo usermod -a -G web yourusername; Add your current use to be able to modify the contents of this part |
3 Install unicorn
gem install unicorn or gem 'unicron' |
install unicorn file
curl -o config/unicorn.rb https: //raw.github.com/defunkt/unicorn/master/examples/unicorn.conf.rb |
4. The very basic of the unicorn
APP_PATH = "/var/www/unicorn" working_directory APP_PATH stderr_path APP_PATH + "/log/unicorn.stderr.log" stdout_path APP_PATH + "/log/unicorn.stderr.log" pid APP_PATH + "/tmp/pid/unicorn.pid" |
5 Startup unicorn
unicorn_rails -c / var /www/unicorn/config/unicorn.rb -D |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步