GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) πŸ’–

okay bestie, welcome to the Development section of the Golf docs, and no bc we are NOT gatekeeping β€” this is connect-apache-unix-socket, filed under web-servers. let's get into it 🫢


✨ NAME ✨

connect-apache-unix-socket β€” Golf documentation (web-servers) πŸ’…


🌸 DESCRIPTION 🌸

so basically this page shows you how to connect your application β€” the one that's listening on a Unix socket (you started it with mgrg, iykyk) β€” to an Apache web server. it's giving matchmaker, it's giving "now kiss" 😭


πŸŽ€ Step 1

To setup Apache as a reverse proxy and connect your application to it, you need to enable FastCGI proxy support, which generally means the proxy and proxy_fcgi modules β€” and good news, this is done only once, so it's a one-time slay ✨

  • For Debian (like Ubuntu) and OpenSUSE systems you need to enable proxy and proxy_fcgi modules:
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
  • For Fedora systems (or others like Archlinux) enable proxy and proxy_fcgi modules by adding (or uncommenting) LoadModule directives in the Apache configuration file β€” 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

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

Edit the Apache configuration file πŸ‘‡

  • 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 (/<app path> is the application path (see request) and <app name> is your application name):

ProxyPass "/<app path>/" unix:///var/lib/gg/<app name>/sock/sock|fcgi://localhost/<app path>

🧚 Step 3

Finally, restart Apache. 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) as the web server will attempt to pass them as a reverse proxy request, and they will likely not work. 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 vibe check bestie β€” this page lives in GOLF(2gg), from version $VERSION, dated $DATE. go forth and proxy, you absolute icon πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from