GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

✨ NAME ✨

connect-apache-tcp-socket β€” it's the Golf documentation for web-servers, bestie πŸ’–


🌸 DESCRIPTION 🌸

Okay so here's the vibe: this page shows you how to hook your application up to an Apache web server, where your app is listening on TCP port <port number> β€” the one you started with the "-p" option in mgrg. 🫢

πŸŽ€ Step 1

First things first, you gotta set Apache up as a reverse proxy and connect your application to it. That means enabling FastCGI proxy support, which basically means the "proxy" and "proxy_fcgi" modules. And good news: this is a one-time thing, you do it once and you're done, no cap. ✨

  • For Debian (like Ubuntu) and OpenSUSE systems β€” you enable the proxy and proxy_fcgi modules like this:
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
  • For Fedora systems (or others like Archlinux) β€” you enable the proxy and proxy_fcgi modules by adding (or uncommenting) LoadModule directives in the Apache configuration file. Heads up: the default location of this file on Linux depends on the distribution. πŸ’…

For Fedora (such as RedHat), Archlinux:

sudo vi /etc/httpd/conf/httpd.conf

For OpenSUSE:

sudo vi /etc/apache2/httpd.conf

Then add this to the end of the file:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so

πŸ¦‹ Step 2

Now edit the Apache configuration file, and yes the path is different depending on your distro, it's giving ✨choose your own adventure✨:

  • For Debian (such as Ubuntu):
sudo vi /etc/apache2/apache2.conf
  • for Fedora (such as RedHat), Archlinux:
sudo vi /etc/httpd/conf/httpd.conf
  • and for OpenSUSE:
sudo vi /etc/apache2/httpd.conf

Add this to the end of file β€” and fyi "/<app path>" is the application path, see request πŸ‘€:

ProxyPass "/<app path>/" fcgi://127.0.0.1:<port number>/

🌈 Step 3

Finally, restart Apache. Iconic, I know. On Debian systems (like Ubuntu) or OpenSUSE:

sudo systemctl restart apache2

On Fedora systems (like RedHat) and Arch Linux:

sudo systemctl restart httpd
⚠️ Note: you must not have any other URL resource that starts with "/<app path>/" (such as for example "/<app path>/something") because the web server will attempt to pass them as a reverse proxy request, and they will likely not work. Bestie, if you need to, you can change the application path to be different from "/<app path>", see request. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

  • Web servers
  • connect-apache-tcp-socket
  • connect-apache-unix-socket
  • connect-haproxy-tcp-socket
  • connect-nginx-tcp-socket
  • connect-nginx-unix-socket
  • See all documentation

And that's the whole thing, slay πŸ’… β€” this was $VERSION, dated $DATE, and it's living its best life in the GOLF(2gg) era. Go off, go configure, you got this 🫢✨

πŸ“¦ where this page comes from