概要
webarenaでubuntu18.04やってみた。
apache2.4 perl5.26 やってみた。
cgiやってみた。
設定
sudo a2enmod cgid
000-default.confの修正
<VirtualHost *:80>
ServerName hoge.com
ServerAdmin hoge@localhost
DocumentRoot /home/hoge/public_html/
<Directory /home/hoge/public_html>
AllowOverride None
Require all granted
</Directory>
ScriptAlias /cgi-bin /home/hoge/cgi-bin
<Directory "/home/hoge/cgi-bin">
Options +ExecCgi
AddHandler cgi-script .cgi
AddHandler text/html .html
AllowOverRide All
Require all granted
</Directory>
</VirtualHost>
サンプルコード
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n";
print "hello\n";
print "</html>\n";
以上。