How to specify a web address to a rails application?

前端 未结 3 1986
执笔经年
执笔经年 2021-01-29 04:02

I am using Ubuntu 12.04 and I have a rails application, that I would like to start on boot. Also if I start the server from console like

cd 

        
3条回答
  •  面向向阳花
    2021-01-29 05:07

    Edit /etc/hosts to add

    127.0.0.1 myapp

    Also, start with rails s -p 80 if you don't want to specify the 3000 port in the browser. This can interfere with an Apache process already listening to the 80 port.

    EDIT : To make it work with Apache :

    Let the Rails app on the 3000 port and enable mod proxy for Apache, in order to ProxyPass requests incoming to the myapp host.

    There is several examples here : httpd.apache.org/docs/2.0/mod/mod_proxy.html

提交回复
热议问题