zoukankan      html  css  js  c++  java
  • apache+passenger部署rails项目

    1.安装Apache

    sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev

    2.安装passenger 

    gem install passenger

    3.安装桥接器模块

    passenger-install-apache2-module 

     

    或者,如果你用的是Nginx,则:

        passenger-install-nginx-module

     

    4.在运行 passenger-install-apache2-module 命令的时候,会出现类似一下的代码,让你放到apaceh2.conf文件的最后 

    LoadModule passenger_module /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13/ext/apache2/mode_passenger.so
    PassengerRoot /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13
    PassengerRuby /home/justqyx/.rvm/wrappers/ruby-1.9.2-p290/ruby

    顺便检查有没有以下的这两行配置,没有的话顺便加上

    Include sites-available/
    ServerName 127.0.0.1

     

     注意:此步可能会出现错误,要按照终端的提示来安装额外的东西 


     

    5.配置文件apache2

    在etc/apach2/sites-available目录下增加cl文件,然后把


    listen 4100
    <VirtualHost *:4100>
          ServerName localhost
          DocumentRoot /home/aaron/code/cl/public  
          RailsEnv production
          <Directory /home/aaron/code/cl/public>
             AllowOverride all             
             Options -MultiViews  
          </Directory>
     </VirtualHost>

    强制重新加载服务器配置文件
     

    sudo /etc/init.d/apache2 force-reload 

    或者sudo /etc/init.d/apache2 reload

     

    重启服务器

    sudo /etc/init.d/apache2 restart 

     

    注意:终止服务器: sudo /etc/init.d/apache2/ stop 

    启动服务器: sudo /etc/init.d/apache2/start

  • 相关阅读:
    jquery_DOM笔记3
    jquery_DOM笔记2
    mac之jdk环境变量配置
    360导致的mysql问题解决
    windows服务器apache配置https教程
    生成自己openssl的证书
    wkhtmltopdf中文乱码
    安装ruby、rails
    extjs中返回数据时id不能重复,否则数据会被合并
    gzip压缩ext-all.js
  • 原文地址:https://www.cnblogs.com/bendanchenzhicheng/p/2722830.html
Copyright © 2011-2022 走看看