How to Enable Perl Scripts to Work in an Nginx+Apache Environment

Asked 2 months ago, Updated 2 months ago, 2 views

Thank you for your help.
Attempting to operate Apache with Nginx as the reverse proxy.
For the time being, most of the configuration tasks have been completed, and HTML and PHP can now be displayed normally.
And I'm currently trying to run Perl script, but I don't know how to do it.
First of all, I wrote the following in Apache's virtual host configuration file:

<IfModule mod_mime.c>
Options + ExecCGI
AddHandler cgi-script.cgi
</IfModule>

However, perhaps this is not enough, Perl's source will appear directly on the browser.
Do you need any configuration on the Nginx side?
Also, what should I do if I need to?
The environment is Ubuntu 18.04.3, Nginx Ver.1.16.1, and Apache Ver.2.4.29.
Thank you for your cooperation.

apache nginx perl

2022-09-30 13:55

1 Answers

Thank you for your help.
Due to my simple mistake, the Perl script didn't work because the module running cgi wasn't loaded.

 a2enmod cgi

After enabling the module in and restarting Apache, it now works fine.
Thank you very much。
Thank you for your continued support.


2022-09-30 13:55

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.