This example shows Apache as the front-end (or "reverse proxy") for cache server - it's assumed you've completed it first. Three steps to setting up Apache quickly:
- Enable FastCGI proxy used to communicate with Gliimly services - this is one time only:
- If you use Ubuntu and similar:
sudo a2enmod proxy sudo a2enmod proxy_fcgi
Copied!
- If you use Fedora and similar:
sudo vi /etc/httpd/conf/httpd.conf
Copied!
and if you use OpenSUSE:
sudo vi /etc/httpd/conf/httpd.conf
Copied!
Add the following at the end of httpd.conf:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
Copied!
- If you use Ubuntu and similar:
- Edit Apache configuration file:
- If you use Debian (such as Ubuntu):
sudo vi /etc/apache2/apache2.conf
Copied!
- If you use Fedora (such as RedHat), Archlinux:
sudo vi /etc/httpd/conf/httpd.conf
Copied!
- If you use OpenSUSE:
sudo vi /etc/apache2/httpd.conf
Copied!
ProxyPass "/index/" unix:///var/lib/gg/index/sock/sock|fcgi://localhost/index
Copied!
- If you use Debian (such as Ubuntu):
- Restart Apache.
- On Debian systems (like Ubuntu) or OpenSUSE:
sudo systemctl restart apache2
Copied!
- On Fedora systems (like RedHat) and Arch Linux:
sudo systemctl restart httpd
Copied!
- On Debian systems (like Ubuntu) or OpenSUSE:
Now you can call your web service, from the web. In this case it's probably a local server (127.0.0.1) if you're doing this on your own computer. The URLs would be, for example to add, query and delete a key/value pair:
http://127.0.0.1/index/srv/op=add/key=1/data=d_1Copied!
http://127.0.0.1/index/srv/op=query/key=1Copied!
http://127.0.0.1/index/srv/op=delete/key=1Copied!
Note the URL request structure: first comes the application path ("/index") followed by request path ("/srv") followed by URL parameters (such as "/op=add/key=1/data=d_1"). The result in web browser are messages informing you that the key was added, queried or deleted.