GOLF(2gg)
β¨ 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
proxyandproxy_fcgimodules like this:
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
- For Fedora systems (or others like Archlinux) β you enable the
proxyandproxy_fcgimodules by adding (or uncommenting)LoadModuledirectives 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-socketconnect-apache-unix-socketconnect-haproxy-tcp-socketconnect-nginx-tcp-socketconnect-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
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms