Once installed Ubuntu on your system, following steps needs to be done to set up the rails application without any issues.
Packages needs to be installed:
- $ sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2
- $ sudo apt-get install libapr1-dev
- $ sudo apt-get install apache2-prefork-dev
- $ sudo apt-get install libssl-dev
- $ sudo apt-get install libcurl4-openssl-dev
- $ sudo apt-get install apache2
- $ sudo apt-get install mysql-server-5.5
- $ sudo apt-get install mysql-client libmysqlclient-dev
- $ sudo apt-get install ruby
- $ sudo apt-get install rubygems1.8
- $ sudo gem install bundler
Apache + Passenger configuration :
- $ sudo gem install passenger
- $ sudo passenger-install-apache2-module
Following file has to be modified, after completed the above installation, - $ sudo vi /etc/apache2/sites-enabled/000-default<VirtualHost *:8080>Save the above file.
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.2/libout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-4.0.2
PassengerDefaultRuby /usr/bin/ruby1.8
RailsEnv development
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /home/ubuntu/project/testapp/public
<Directory /home/ubuntu/project/testapp/public>
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost> - To configure your port no, $ sudo vi /etc/apache2/ports.conf
NameVirtualHost *:8080
Listen 8080 - Restart your apache service, $ sudo /etc/init.d/apache2 restart
- Restart your mysql service if needed, $ sudo service mysql restart