由 zjhejie 在 10-06-2002 12:01 发表:
急,apache上不能执行cgi,请帮解决
我在REDHAT7.3下配置APACHE文件,就是不能执行CGI脚本,不知什么原因,请高手帮忙看一下,不知哪里有错误,我的httpd.conf
ServerType standalone
ServerRoot "/etc/httpd"
LockFile /var/run/httpd.lock
PidFile /var/run/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 20
StartServers 8
MaxClients 150
MaxRequestsPerChild 1000
#Listen 3000
#Listen 12.34.56.78:80
Dynamic Shared Object (DSO) Support
#LoadModule mmap_static_module modules/mod_mmap_static.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
1<ifdefine have_bandwidth="">
2
3LoadModule bandwidth_module modules/mod_bandwidth.so
4
5</ifdefine>
1<ifdefine have_throttle="">
2
3LoadModule throttle_module modules/mod_throttle.so
4
5</ifdefine>
LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule agent_log_module modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule db_auth_module modules/mod_auth_db.so
#LoadModule auth_any_module modules/mod_auth_any.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule auth_ldap_module modules/mod_auth_ldap.so
#LoadModule mysql_auth_module modules/mod_auth_mysql.so
#LoadModule auth_pgsql_module modules/mod_auth_pgsql.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule proxy_module modules/libproxy.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule example_module modules/mod_example.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
1<ifdefine have_perl="">
2
3LoadModule perl_module modules/libperl.so
4
5</ifdefine>
1<ifdefine have_php="">
2
3LoadModule php_module modules/mod_php.so
4
5</ifdefine>
1<ifdefine have_php3="">
2
3LoadModule php3_module modules/libphp3.so
4
5</ifdefine>
1<ifdefine have_php4="">
2
3LoadModule php4_module modules/libphp4.so
4
5</ifdefine>
1<ifdefine have_dav="">
2
3LoadModule dav_module modules/libdav.so
4
5</ifdefine>
1<ifdefine have_roaming="">
2
3LoadModule roaming_module modules/mod_roaming.so
4
5</ifdefine>
1<ifdefine have_ssl="">
2
3LoadModule ssl_module modules/libssl.so
4
5</ifdefine>
1<ifdefine have_put="">
2
3LoadModule put_module modules/mod_put.so
4
5</ifdefine>
1<ifdefine have_python="">
2
3LoadModule python_module modules/mod_python.so
4
5</ifdefine>
ClearModuleList
#AddModule mod_mmap_static.c
AddModule mod_so.c
1<ifdefine have_bandwidth="">
2
3AddModule mod_bandwidth.c
4
5</ifdefine>
1<ifdefine have_throttle="">
2
3AddModule mod_throttle.c
4
5</ifdefine>
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
#AddModule mod_mime_magic.c
AddModule mod_log_referer.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
#AddModule mod_speling.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
#AddModule mod_auth_any.c
#AddModule mod_auth_dbm.c
#AddModule auth_ldap.c
#AddModule mod_auth_mysql.c
#AddModule mod_auth_pgsql.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
AddModule mod_auth_db.c
AddModule mod_expires.c
#AddModule mod_usertrack.c
#AddModule mod_example.c
#AddModule mod_unique_id.c
AddModule mod_headers.c
AddModule mod_setenvif.c
1<ifdefine have_perl="">
2
3AddModule mod_perl.c
4
5</ifdefine>
1<ifdefine have_php="">
2
3AddModule mod_php.c
4
5</ifdefine>
1<ifdefine have_php3="">
2
3AddModule mod_php3.c
4
5</ifdefine>
1<ifdefine have_php4="">
2
3AddModule mod_php4.c
4
5</ifdefine>
1<ifdefine have_dav="">
2
3AddModule mod_dav.c
4
5</ifdefine>
1<ifdefine have_roaming="">
2
3AddModule mod_roaming.c
4
5</ifdefine>
1<ifdefine have_ssl="">
2
3AddModule mod_ssl.c
4
5</ifdefine>
1<ifdefine have_put="">
2
3AddModule mod_put.c
4
5</ifdefine>
1<ifdefine have_python="">
2
3AddModule mod_python.c
4
5</ifdefine>
Port 80
User nobody
Group nobody
1<ifmodule mod_userdir.c="">
2
3UserDir public_html
4
5</ifmodule>
AccessFileName .htaccess
1<files "^\\.ht"="" ~="">
2
3Order allow,deny
4
5Deny from all
6
7Satisfy All
8
9</files>
UseCanonicalName On
1<ifmodule mod_mime.c="">
2
3TypesConfig /etc/mime.types
4
5</ifmodule>
DefaultType text/plain
1<ifmodule mod_mime_magic.c="">
2
3# MIMEMagicFile /usr/share/magic.mime
4
5MIMEMagicFile conf/magic
6
7</ifmodule>
1<ifmodule mod_gzip.c="">
2
3mod_gzip_on Yes
4
5mod_gzip_dechunk Yes
6
7mod_gzip_keep_workfiles No
8
9mod_gzip_temp_dir /tmp
10
11mod_gzip_minimum_file_size 1002
12
13mod_gzip_maximum_file_size 0
14
15mod_gzip_maximum_inmem_size 1000000
16
17
18
19mod_gzip_item_include file "[^.]*$"
20
21mod_gzip_item_include file "\\.php$"
22
23mod_gzip_item_include file "\\.txt$"
24
25mod_gzip_item_include file \\.htm$
26
27mod_gzip_item_include file "\\.html$"
28
29mod_gzip_item_exclude file "\\.css$"
30
31mod_gzip_item_exclude file "\\.js$"
32
33mod_gzip_item_include file "\\.pl$"
34
35mod_gzip_item_include file "\\.cgi$"
36
37mod_gzip_item_include file "\\.jpg$"
38
39mod_gzip_item_include file "\\.gif$"
40
41mod_gzip_item_include mime "text/.*"
42
43mod_gzip_item_exclude reqh "User-agent: .*MSIE"
44
45mod_gzip_item_include mime "jserv-servlet"
46
47mod_gzip_item_include handler "jserv-servlet"
48
49mod_gzip_item_include handler "cgi-script"
50
51mod_gzip_item_include mime "application/x-httpd-php.*"
52
53mod_gzip_item_include mime "application/x-httpd-php"
54
55mod_gzip_item_include mime "application/x-httpd-php-source"
56
57mod_gzip_item_include mime "httpd/unix-directory"
58
59
60
61mod_gzip_item_exclude file "\\.css$"
62
63mod_gzip_item_exclude file "\\.js$"
64
65mod_gzip_item_exclude file "\\.wml$"
66
67LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" mod_gzip: %{mod_gzip_result}n In  {mod_gzip_input_size}n Out  {mod_gzip_output_size}n  {mod_gzip_compression_ratio}npct." mod_gzip
68
69#CustomLog /var/log/httpd/mod_gzip common_with_mod_gzip_info2
70
71</ifmodule>
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
The following directives define some format nicknames for use with
a CustomLog directive (see below).
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
#CustomLog /usr/local/apache/logs/adserver_log mod_gzip
ServerSignature On
1<ifmodule mod_autoindex.c="">
2
3IndexOptions FancyIndexing NameWidth=*
4
5AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
6
7AddIconByType (TXT,/icons/text.gif) text/*
8
9AddIconByType (IMG,/icons/image2.gif) image/*
10
11AddIconByType (SND,/icons/sound2.gif) audio/*
12
13AddIconByType (VID,/icons/movie.gif) video/*
14
15AddIcon /icons/binary.gif .bin .exe
16
17AddIcon /icons/binhex.gif .hqx
18
19AddIcon /icons/tar.gif .tar
20
21AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
22
23AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
24
25AddIcon /icons/a.gif .ps .ai .eps
26
27AddIcon /icons/layout.gif .html .shtml .htm .pdf
28
29AddIcon /icons/text.gif .txt
30
31AddIcon /icons/c.gif .c
32
33AddIcon /icons/p.gif .pl .py
34
35AddIcon /icons/f.gif .for
36
37AddIcon /icons/dvi.gif .dvi
38
39AddIcon /icons/uuencoded.gif .uu
40
41AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
42
43AddIcon /icons/tex.gif .tex
44
45AddIcon /icons/bomb.gif core
46
47
48
49AddIcon /icons/back.gif ..
50
51AddIcon /icons/hand.right.gif README
52
53AddIcon /icons/folder.gif ^^DIRECTORY^^
54
55AddIcon /icons/blank.gif ^^BLANKICON^^
56
57DefaultIcon /icons/unknown.gif
58
59
60
61ReadmeName README
62
63HeaderName HEADER
64
65
66
67IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
68
69
70
71</ifmodule>
1<ifmodule mod_mime.c="">
2
3
4
5AddEncoding x-compress Z
6
7AddEncoding x-gzip gz tgz
8
9AddLanguage da .dk
10
11AddLanguage nl .nl
12
13AddLanguage en .en
14
15AddLanguage et .ee
16
17AddLanguage fr .fr
18
19AddLanguage de .de
20
21AddLanguage el .el
22
23AddLanguage he .he
24
25AddCharset ISO-8859-8 .iso8859-8
26
27AddLanguage it .it
28
29AddLanguage ja .ja
30
31AddCharset ISO-2022-JP .jis
32
33AddLanguage kr .kr
34
35AddCharset ISO-2022-KR .iso-kr
36
37AddLanguage nn .nn
38
39AddLanguage no .no
40
41AddLanguage pl .po
42
43AddCharset ISO-8859-2 .iso-pl
44
45AddLanguage pt .pt
46
47AddLanguage pt-br .pt-br
48
49AddLanguage ltz .lu
50
51AddLanguage ca .ca
52
53AddLanguage es .es
54
55AddLanguage sv .se
56
57AddLanguage cz .cz
58
59AddLanguage ru .ru
60
61AddLanguage zh-tw .tw
62
63AddLanguage tw .tw
64
65AddCharset Big5 .Big5 .big5
66
67AddCharset WINDOWS-1251 .cp-1251
68
69AddCharset CP866 .cp866
70
71AddCharset ISO-8859-5 .iso-ru
72
73AddCharset KOI8-R .koi8-r
74
75AddCharset UCS-2 .ucs2
76
77AddCharset UCS-4 .ucs4
78
79AddCharset UTF-8 .utf8
80
81
82
83
84
85<ifmodule mod_negotiation.c="">
86
87LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
88
89</ifmodule>
90
91
92
93
94
95
96
97AddType application/x-tar .tgz
98
99
100
101
102
103<ifmodule mod_php4.c="">
104
105AddType application/x-httpd-php .php .php4 .php3 .phtml
106
107AddType application/x-httpd-php-source .phps
108
109</ifmodule>
110<ifmodule mod_php3.c="">
111
112AddType application/x-httpd-php3 .php3
113
114AddType application/x-httpd-php3-source .phps
115
116</ifmodule>
117<ifmodule mod_php.c="">
118
119AddType application/x-httpd-php .phtml
120
121</ifmodule>
122
123
124
125
126
127AddHandler cgi-script .cgi
128
129AddType text/html .shtml
130
131AddHandler server-parsed .shtml
132
133AddHandler imap-file map
134
135</ifmodule>
1<ifmodule mod_setenvif.c="">
2
3BrowserMatch "Mozilla/2" nokeepalive
4
5BrowserMatch "MSIE 4\\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
6
7BrowserMatch "RealPlayer 4\\.0" force-response-1.0
8
9BrowserMatch "Java/1\\.0" force-response-1.0
10
11BrowserMatch "JDK/1\\.0" force-response-1.0<br</ifmodule>