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

  • 相关阅读:
    关于编程
    Python的内建sort方法

    Elgg设置SMTP验证发送邮件教程
    ThinkPHP 和 UCenter接口的冲突
    mac下终端iTerm2配置
    自动化 Amazon EBS 快照生命周期
    AWS Certified Solutions Architect Associate 学习笔记1
    实例存储生命周期 Instance store
    可触发 Lambda 函数的 CloudFront 事件
  • 原文地址:https://www.cnblogs.com/bendanchenzhicheng/p/2722830.html
Copyright © 2011-2022 走看看