• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question Use SetEnv for Apache additional directives

MichielZev

New Pleskian
Server operating system version
Debian 12
Plesk version and microupdate number
Plesk Obsidian 18.0.71, actualización 2 Web Pro Edition
In a domain hosted with Plesk I want to use Mapserver software to generate maps. This is a CGI program. For this Apache needs to have an environment variable called MAPSERVER_CONFIG_FILE
In Plesk in the domain I have use the Apache and ngix configuration and put the following in additional directives (both for HTTP and HTTPS
SetEnv MAPSERVER_CONFIG_FILE /usr/local/etc/mapserver.conf

It seems that this environment variable is not set because I get an error message when running the Mapserver script from the browser saying : msLoadConfig(): Unable to access file (this indicates that the configuration file can not be accessed.

Question:
Is this the correct way to set an evironment variable in a virtual host in Plesk?
 
@MichielZev , my mistake. Thank you for the confirmation. Please run the following command to confirm if the directive is set:

Bash:
grep -ri MAPSERVER_CONFIG_FILE /etc/apache2/
 
@MichielZev , my mistake. Thank you for the confirmation. Please run the following command to confirm if the directive is set:

Bash:
grep -ri MAPSERVER_CONFIG_FILE /etc/apache2/
The reply is:
/etc/apache2/conf-available/mapserver.conf:SetEnv MAPSERVER_CONFIG_FILE /usr/local/etc/mapserver.conf

I have indeed created a mapserv.conf file in conf-available. After that I have run:
a2enconf mapserver
systemctl reload apache2

After that I have also run:
plesk sbin httpdmng --reconfigure-domain gisonline.es

The MapServer configuration file itself is located in /usr/local/etc/mapserver.conf
However, when in my browser I put: MapServer Message
It still responds: msLoadConfig(): Unable to access file.
 
Thank you for the confirmation. It sounds like the environmental variable is properly configured. Fur further troubleshooting, it will be best to consult with the developers of the application.
 
Back
Top