How to setup Rails on WAMP server using HTTP Proxy module?

To setup Rails on windows after Ruby and Rails setup,

i) Edit hosts file in windows environment and set the server name in the hosts file to

127.0.0.1 myrails

In this example, i have used “myrails” as the server name for the project.

ii) Edit httpd configuration setting on WAMP to make sure proxy and proxy_http module is turned on (check if it those lines are not commented out)

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

iii) Edit virtual host settings in Apache and add the following lines

<VirtualHost *:80>

ServerName myrails
ServerAlias myrails
DocumentRoot “C:\RubyRails\hello\public”
<Directory “C:\RubyRails\hello\public”>
Allow from all
Options -MultiViews
</Directory>
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000
ProxyPreserveHost On

</VirtualHost>

iv) Restart apache and then type http://myrails in the browser.

Share

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *