9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

シェルスクリプトでCGI

Posted at
<Directory "/var/www/html/shell/">
    AddHandler cgi-script .sh
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Directoryは、適宜良い感じに指定する

#!/bin/sh

echo -ne "Content-Type: text/html; charset=UTF-8\r\n\r\n"

cat <<EOT
<html>
	<body>
`echo hello`
	</body>
</html>
EOT

#END

confファイルで指定したディレクトリに配置する。
スクリプトに実行権限付けるのを忘れずに。

9
10
0

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
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?