莱芜网站建设与管理,怎样做自己的网页,北京网站建设案例,网站管理员怎么做之前写过一篇《记录一下我的Ruby On Rails的systemd服务脚本》的记录#xff0c;现在补上一个比较政治正确的Ruby On Rails的生产环境部署记录。使用Puma部署项目。
创建文件 /usr/lib/systemd/system/puma.service
[Unit]
DescriptionPuma HTTP Server
DocumentationRuby O…之前写过一篇《记录一下我的Ruby On Rails的systemd服务脚本》的记录现在补上一个比较政治正确的Ruby On Rails的生产环境部署记录。使用Puma部署项目。
创建文件 /usr/lib/systemd/system/puma.service
[Unit]
DescriptionPuma HTTP Server
DocumentationRuby On Rails
Afternetwork.target[Service]
Typenotify
WorkingDirectory/your_application_path
ExecStart/usr/local/bin/puma -C /your_application_path/config/puma.rb
TimeoutStopSec5
KillModemixed
Restartalways[Install]
WantedBymulti-user.target设置为随系统自动启动
systemctl enable puma.service
systemctl start puma.service当启动浏览器启动时你可能会收到如下的提醒 说明当前的域名不支持被请求。编辑/you_application_path/config/environments/development.rb在倒数第一行end这一行的上面添加域名配置
config.hosts the24.wang
config.hosts www.the24.wang重新启动服务
systemctl restart puma.service到些完成整个项目的配置工作。