美文网首页
ROR + Apache + Passenger + mysql

ROR + Apache + Passenger + mysql

作者: DeanWang | 来源:发表于2016-07-01 00:28 被阅读20次

    英文文档: How to: Ruby on Rails + Ubuntu + Apache with Passenger

    安装ruby可以使用rvm进行管理:
    curl -sSL https://get.rvm.io | bash -s stable
    rvm install 1.9.3

    apt-get 安装apache mysql

    apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev mysql-server mysql-client libmysql-ruby libmysqlclient15-dev
    

    gem 安装rails mysql passenger
    gem install passenger mysql2 rails
    配置
    passenger-install-apache2-module
    将下面的配置写到/etc/apache2/apache2.conf

    LoadModule passenger_module  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2
    PassengerRuby /usr/bin/ruby1.8
    

    执行a2enmod rewrite

    创建rails工程
    rails new [project name] -d mysql

    创建VirtualHost文件
    a2ensite [VirtualHost].conf
    最后:
    service apache2 restart

    相关文章

      网友评论

          本文标题:ROR + Apache + Passenger + mysql

          本文链接:https://www.haomeiwen.com/subject/amefjttx.html