LoginSignup
0

More than 3 years have passed since last update.

webarenaでubuntu その44

Last updated at Posted at 2019-09-04

概要

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";

以上。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0