Can you explain more detailed what you try to achieve? Where should the scripts run, at the client?
What the clients are, Linux, Windows, Mac? Which Browser do you use?
iirc CGI is Common Gateway Interface, the scripts run serverside and output html that’s returned the the client. It’s a bit old schooI I guess. The scripts can be anything, perl,python, whatever, so long as they output something the client can understand.
So the client isn’t relevant for this one really, the server takes a POST and sends it as an email then returns a nice HTML to the client saying thanks for your message.
If you just drop the script in the root directory of the web server, the server returns it to the client as text and it’s ungood.
in Apache, typically one adds an entry in the conf like “Location /cgi-bin” with “Directory /var/www/cgi-bin/” and "option ExecCGI’, or something like this, then the web server doesn’t return the file upon a GET request, instead it executes the file and returns the output.
I can probably just mess with the configs and make it work, but what’s the proper nethserver way to run CGI scripts?
nethserver_packages = read_package_list()
File “/usr/lib/yum-plugins/nethserver_events.py”, line 88, in read_package_list
packages.remove(’$root’)
ValueError: list.remove(x): x not in list
It works now, I added a new config file in /etc/httpd/conf.d/ with:
<Directory “/var/lib/nethserver/vhost/3ee2d58d699827e/cgi-bin”>
AllowOverride None
Options None
Order allow,deny
Allow from all
and added
ScriptAlias /cgi-bin/ “/var/lib/nethserver/vhost/3ee2d58d699827e/cgi-bin/”
to conf.d/virtualhosts.conf.
Now I’ll need to either add this back in myself every time I make a vhosts change, or learn how to make a template and DB change that lets me enable CGI for a specific vhost. I chose option one.