1. install Apache
Sudo apt-Get install apache2 apache2-mpm-prefork apache2-prefork-dev
2. Install passenger
Gem install passenger
3. Install the bridge module
Passenger-install-apache2-module
Or, if you are using nginx, then:
Passenger-install-nginx-Module
4. RunningPassenger-install-apache2-moduleCode similar to the following will appear during the command, so that you can put it at the end of the apaceh2.conf file.
LoadModule passenger_module /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13/ext/apache2/mode_passenger.soPassengerRoot /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13PassengerRuby /home/justqyx/.rvm/wrappers/ruby-1.9.2-p290/ruby
Check whether there are any of the following configurations. If not, add
Include sites-available/ServerName 127.0.0.1
Note: errors may occur in this step. Install additional things as prompted by the terminal.
5. configuration file apache2
Add the CL file in the ETC/apach2/sites-available Directory and
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>
Force reload the server configuration file
Sudo/etc/init. d/apache2 force-Reload
Or sudo/etc/init. d/apache2 reload
Restart the server
Sudo/etc/init. d/apache2 restart
Note: Terminate the server: sudo/etc/init. d/apache2/stop
Start server: sudo/etc/init. d/apache2/start