Closed woodRock closed 4 years ago
Here is a tutorial example that shows how to configure Apache2
and the cgi-bin
to work properly.
First we must enable the cgi.load
mod in the Apache2
configuration files.
This can be done with the following command.
$ cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/cgi.load
Then we must restart the Apache2
service before this will work.
$ sudo service apache2 reload
We can verify that this works by visiting the following url for the acoustic mapfile.
Previously the Apache2
server would display this page as a text file of the contents of the script. It did not recognize that the script was execrable for the cgi-bin
.
Now we see that the cgi-bin
is working and is able to execute the bash scripts within the mapserv
directory.
In order for all the URLs for the Apache2
server to work we needed to make the header scripts for each Mapfile executable. Our cgi-bin
required permission to run these executable.
We created a script which found all of the files that contained a bash she-bang and changed the permissions for each. This was done with the following commnad:
chmod a+x
Now the cgi-bin
can execute these scripts. And the URL for each Mapfile works on the Server.
We have the
cgi-bin
installed. However theApache2
server must be configured to load it properly.Apache2
needs to know which files are executable and are allowed to be executed. These are the bash scripts in the/usr/lib/cgi-bin
directory. These scripts hide the internal file structure of the server from the outside world for added security.