• 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

  • 相关阅读:
    bzoj 1588: [HNOI2002]营业额统计 treap
    Codeforces Round #135 (Div. 2) E. Parking Lot 线段数区间合并
    cdoj 851 方老师与素数 bfs
    hdu 5150 Sum Sum Sum 水
    Codeforces Round #376 (Div. 2) F. Video Cards 数学,前缀和
    POJ 1984 Navigation Nightmare 带全并查集
    POJ 1655 Balancing Act 树的重心
    POJ 3140 Contestants Division 树形DP
    HDU 3586 Information Disturbing 树形DP+二分
    HDU 1561 The more, The Better 树形DP
  • 原文地址:https://www.cnblogs.com/bendanchenzhicheng/p/2722830.html
Copyright © 2020-2023  润新知