下载apache以在网页中显示python脚本时出现错误
1.配置好apache后,我将需要显示的文件放在Apache24/cgi-bin文件夹下,结果显示
Forbidden
You don't have permission to access this resource.
2.在尝试各种方法无果后,我尝试在根目录下增加“.htaccess”文件,文件源码如下:
RewriteEngine On
# The RewriteBase / instruction is commented. Remove the "#" to uncomment
# RewriteBase /
# Memory Limit
# php_value memory_limit 256M
# php_value max_execution_time 18000
# Disable Hotlinking
# Replace "domain.tld" with your domain name
# Don't forget to add a picture "thepic.gif" on your server
# RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.tld/ [NC]
# RewriteCond %{HTTP_REFERER} !^$
# Solution 1 : Displays another picture from an URL
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://www.domain.tld/thepic.gif [L]
# Solution 2 : Displays a 403 forbidden
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
# Forces the "www"
# RewriteCond %{HTTP_HOST} !^www\.yourdomain\.tld$ [NC]
# RewriteRule ^(.*)$ http://www.yourdomain.tld/$1 [QSA,L,R=301]
# Uncomment these lines to display the off.html page to other IP than the one bellow
# RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*) off.html
# DO NOT MODIFY ANY FOLLOWING LINE
# Iemis Rules
# Keep these lines even in maintenance mode, to have an access to the website
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1
#RewriteCond %{HTTP_HOST} !^(www)\. [NC]
#RewriteRule ^(.*)$ index.php/$1 [L,QSA]
#RewriteRule ^(.*)$ index.php/$1 [L,P]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php?/$1 [L]
结果出现错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
多番尝试仍无法解决
如何正确运行Apache?难道是有软件版本的要求?
问题1、主要查看下路径和权限问题
需注意几个点:把 "${INSTALL_DIR}/www" 换成 "C:/wamp64/www" 成实际的目录位置。
关键配置:Require all granted
httpd-vhosts.conf
问题2、
思路1:
看看这个,好像绕过了apache
【python CGI编程(浏览器端运行配置)】https://mbd.baidu.com/ma/s/loNIXs8U
网络有关?