- httpd 2.4.5 and later
- Enable Apache2 modules:
sudo a2enmod proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html proxy_wstunnel
<VirtualHost *:80 *:443>
ServerName api.mysite.com.br
ServerAlias app.mysite.com.br
DocumentRoot "/webapp/mysite/public"
#SSLEngine On
#SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost on
<Location />
ProxyPass http://0.0.0.0:3000/
ProxyPassReverse http://0.0.0.0:3000/
</Location>
<Location /cable>
ProxyPass ws://mysite.com.br:3000/cable
ProxyPassReverse ws://mysite.com.br:3000/cable
</Location>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Directory "/webapp/mysite/public">
Options FollowSymlinks Multiviews
AllowOverride All
Allow from all
Require all granted
RailsEnv production
</Directory>
#SSLCertificateFile /etc/letsencrypt/live/mysite.com.br/fullchain.pem
#SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com.br/privkey.pem
#Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
sudo services apache2 restart
passenger stop --port 3000
passenger start --daemonize --address 0.0.0.0 --port 3000 -e production
Thanks! you are the first person that documented this setup. Much appreciated the gist...
all the others were using passenger and Nginx, but needed the native apache to use with my puma...