温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Apache2+Passenger在Ubuntu上部署

发布时间:2020-08-19 13:40:50 来源:网络 阅读:1551 作者:刘丫丫 栏目:编程语言

先 安装RVM Ruby Rails

1. Install Apache2

sudo apt-get install apache2


2. Install Passenger 
gem install passenger


3. 将passenger集成进Apache 
passenger-install-apache2-module


4. 将步骤3安装成功后的提示信息加入Apach3 配置文件/etc/apache2/httpd.conf,如果没有,创建一个 
LoadModule passenger_module /home/abbuggy/.rvm/gems/ruby-1.9.2-p320/gems/passenger-3.0.18/ext/apache2/mod_passenger.so PassengerRoot /home/abbuggy/.rvm/gems/ruby-1.9.2-p320/gems/passenger-3.0.18 PassengerRuby /home/abbuggy/.rvm/wrappers/ruby-1.9.2-p320/ruby


5. 配置根目录和端口号,/etc/appach3/httpd.conf 例如 
ServerName localhost
<VirtualHost *:80>
ServerName localhost:80 # !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/<appname>/public
<Directory /var/www/<appname>/public> # This relaxes Apache security settings.
AllowOverride all # MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>


6. 在apache2.conf 文件中,添加 # Include all the user configurations:
Include httpd.conf
重启Apache 服务
service apache2 restart


7. 查看日志 
tail -f /var/log/apache2/access.log
tail -f /var/log/apache2/error.log


8. 修改端口
/etc/apache2/httpd.conf
/etc/apache2/ports.conf




向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI