How to set Rails project on local Apache server

1. cd /etc/apache2
2. cd sites-available/
3. sudo gedit my.hydrocell.com

<VirtualHost *:80>
    # Change these 3 lines to suit your project
    RailsEnv development
    ServerName my.example.com
    DocumentRoot /home/ubuntu/rails_root/example/public
</VirtualHost>


4. sudo gedit /etc/hosts

127.0.0.1    localhost
127.0.1.1    ubuntu-vm

127.0.0.1    my.example.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


5. sudo a2ensite my.example.com
6. sudo /etc/init.d/apache2 restart

Comments