Mac OS X での httpd 設定メモ

1. 各ソフトウェア確認
$ perl -v
This is perl, v5.10.0 built for darwin-thread-multi-2level

$ php -v
PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:29)

$ python -V
Python 2.6.1

2. confファイル修正
$ sudo vi /private/etc/apache2/httpd.conf

LoadModule php5_module libexec/apache2/

#コメントを外す(perl, python CGI用)
AddHandler cgi-script .cgi

$ sudo vi /private/etc/apache2/users/{username}.conf
# ExecCGI追加

<Directory "/Users/{username}/Sites/">
    #Options Indexes MultiViews
    Options Indexes MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all

3. 確認


print "Content-type: text/html\n\n";
foreach(sort keys %ENV){
    print "$_: $ENV{$_}
\n"; }


import os
print "Content-type: text/html\n\n";
for param in os.environ.keys():
  print "%20s %s<br/>" % (param,os.environ[param])



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s