After adding these two config changes, write a perl script, place it in the cgi-bin directory, and then give it sufficient privileges (sudo chmod 755 )
Finally, restart apache2: sudo apache2ctl restart
Screenshots:
回答2:
In your web configuration (httpd.conf or your virtual host configuration file) you should have the following fragment:
restart the server, don't forget to chmod +x /usr/local/apache2/cgi-bin/first.pl and then load http://localhost/cgi-bin/first.pl
This assumes that either there are no virtual hosts in your config, or that the virtual host you configured is the default one. See the apache docs if needed.
回答3:
Yes, the above process works but the easy way is:
Enable the CGI- sudo a2enmod cgi
Restart the Apache and it works -service apache2 restart