Open dotnofoolin opened 7 years ago
You can also change the http port to 81
puma-dev install -http-port 81
so you can access your site on nameofapp.dev:81
That way you don't have to reconfigure apache at all
Thanks for this, it was a huge help in getting apache and puma-dev to work together.
Getting SSL to work with this setup is pretty easy, here's what I did:
Make sure these modules are uncommented in your httpd.conf:
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
Edit the puma-dev virtual host config to listen on port 443, start the SSLProxyEngine, and update the proxy definitions to include https
and port 9283
.
<VirtualHost *:443>
ServerName puma-dev
ServerAlias *.test
ServerAlias *.xip.io
SSLProxyEngine on
ProxyPass / https://localhost:9283/
ProxyPassReverse / https://localhost:9283/
ProxyPreserveHost On
</VirtualHost>
Thanks @danderozier. In your example above, what did you do about the certs? Did you create some self-signed certs for your *.test
and *.xip.io
domains to install in Apache?
Did anyone else get this to work in Apache, and, if so, what did you use for the certificate for puma-dev
name and aliases : *.test
Hey @bradical, sorry for the delay in getting back to you. Yep, I just created some self-signed wildcard certificates, which is a little more involved than a normal cert, but not too bad.
I think I did it just for the .test and .xip.io domains, and didn't worry about puma-dev.
sorry for the delay in getting back to you.
No worries @danderozier! Thanks for responding.
Yep, I just created some self-signed wildcard certificates, which is a little more involved than a normal cert, but not too bad.
Got it. I'll try that. I tried using the certs that puma itself generates but it seems be causing some problems when I use those in Apache. Apache starts ok but the SSL connections through puma-dev virtual hosts seem to grind to a halt after awhile.
Btw, I found this tool: https://github.com/FiloSottile/mkcert be a bit easier and more reliable for generating self-signed certs for anyone on MacOS and using MacPorts or Homebrew: https://donatstudios.com/Local-Certificate-On-macOS-Apache
Not as much as an issue, but more of a "how I fixed it".
I wanted to switch from pow to puma-dev, and followed the README closely. After not getting it to work, and trying a lot of things from issue #66, and seeing similar log entries as #40, I realized that Apache was my problem. I'm on macOS Sierra.
I can't just stop Apache. I need it (for now) for other dev work, namely PHP stuff.
So, I decided to mimic the same setup that pow suggested here: https://github.com/basecamp/pow/wiki/running-pow-with-apache
After doing the standard OS X/macOS puma-dev install, all I did was...
/etc/apache/other/zzz_puma-dev.conf
. Assumes you haveInclude /private/etc/apache2/other/*.conf
at the bottom of your httpd.conf file. If you have a similar file for pow, you probably should remove it.~/Library/LaunchAgents/io.puma.dev.plist
file and change the Socket and SocketTLS values from 80/443 to 9280 and 9283.That's all it took for me to get puma-dev and Apache to play nice. I didn't attempt to get HTTPS/SSL working since I don't need it right now.