是否可以在同一个DigitalOcean droplet上运行多个Rails应用程序?
发布于 2014-06-27 05:00:33
我建议考虑将Dokku与Docker一起使用,它允许您同时托管应用程序。Digital Ocean提供一键式安装。我刚开始使用它并以这种方式部署,到目前为止我真的很喜欢它。
这里有一些链接:
发布于 2014-06-27 03:31:28
是的,你可以做到这一点,你只需要配置你的应用服务器,我已经用nginx完成了,非常安静。从使用Nginx服务器应用程序的服务器安装程序和rails应用程序开始,本教程非常酷:
完成后,打开nginx的配置文件:
sudo nano /opt/nginx/conf/nginx.conf现在只需添加另一个块,以便在另一个端口上配置新的应用程序,默认端口始终为80。在此块中输入注意端口8080。
server {
listen 8080;
server_name example.com;
passenger_enabled on;
root /var/www/my_new_rails_app/public;
}希望这能有所帮助!
发布于 2014-06-27 03:40:31
是的
我目前正在做这件事。如果您使用的是Apache,那么只需在您的httpd.conf文件中创建两个条目,指向两个不同应用程序的公共文件夹。记住为每个地址标识不同的地址。
我使用phusion-passenger让rails在apache上运行,我的设置如下所示;
<VirtualHost ####################.com:80>
ServerName ####################.com
DocumentRoot /var/www/html/first_app/current/public/
<Directory /var/www/html/first_app/current/public>
Allow from all
Options -MultiViews
</Directory>
PassengerEnabled on
#RewriteEngine On
#RewriteCond %{HTTPS} on
#RewriteRule (.*) http://www.####################.com%{REQUEST_URI}
SetEnv GEM_HOME /usr/lib/ruby/gems/1.8
</VirtualHost>
<VirtualHost second_app.####################.com:80>
ServerName second_app.####################.com
DocumentRoot /var/www/html/second_app/current/public/
<Directory /var/www/html/second_app/current/public>
Allow from all
Options -MultiViews
</Directory>
PassengerEnabled on
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://www.####################.com%{REQUEST_URI}
SetEnv GEM_HOME /usr/lib/ruby/gems/1.8
</VirtualHost>https://stackoverflow.com/questions/24438531
复制相似问题