2012-11-16 38 views
1

執行腳本這是我的虛擬主機配置文件如何禁用與.htacces

<VirtualHost *:80> 
    ServerAdmin [email protected] 

    ServerName my-domain.tld 
    ServerAlias www.my-domain.tld 

    DocumentRoot /home/my-domain/public_html 
    <Directory /> 
     Options FollowSymLinks 
     AllowOverride None 
    </Directory> 
    <Directory /home/my-domain/public_html> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Order allow,deny 
     allow from all 
    </Directory> 

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
     AllowOverride None 
     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
     Order allow,deny 
     Allow from all 
    </Directory> 

    ErrorLog ${APACHE_LOG_DIR}/error.log 

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. 
    LogLevel warn 

    CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

,我想在/ home禁用腳本執行/使用的.htaccess我的域/的public_html /上傳文件夾;已經嘗試過用

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi 
Options -ExecCGI 

然後

AddType text/plain .html .htm .shtml .php .php3 .phtml .phtm .pl .py .cgi .js 

然後

<Files ^(*.jpeg|*.jpg|*.png|*.gif)> 
order deny,allow 
deny from all 
</Files> 

和所有其他指令,我發現周圍,但沒有人可以阻止腳本的執行。

apachectl -t -D DUMP_MODULES說mime_module啓用並加載

php_flag engine off是從停止執行,但對其他類型的什麼一個PHP文件的唯一指令;以及爲什麼其他apache指令不起作用。任何想法... ?

+1

的AllowOverride無可能是錯在這裏,但我會問反正:會改變你的目錄無法勝任執行權限? –

+0

它已具有執行權限。不管怎麼說,還是要謝謝你。 – hex494D49

+0

我以爲你想禁用腳本執行,不會關閉腳本執行,而只是在你的.htaccess中做什麼?對不起,如果我失去了一些東西:-) –

回答

2

集:在所有目錄

+0

完成,但沒有到目前爲止。現在,即使php_flag引擎關閉也不起作用,但它是預期的。不管怎麼說,還是要謝謝你。 – hex494D49