Apache2+Passenger在Ubuntu上部署

先 安裝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安裝成功後的提示信息加入Apach2 配置文件/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/appach2/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




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章