首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使RewriteMap工作

无法使RewriteMap工作
EN

Server Fault用户
提问于 2017-07-29 06:39:48
回答 1查看 349关注 0票数 0

我试图在我的虚拟主机中使用RewriteMap,但没有得到任何运气。

以下是我的虚拟主机文件的内容,其中有一个以RewriteMap开头的条目(行)。据我所读,应该执行文件/etc/fixit.php。但是我测试了放置一个简单的行file_put_contents('/etc/test.txt','abcd', FILE_APPEND);和test.txt文件没有创建。

代码语言:javascript
复制
    <VirtualHost *:80>
    SuexecUserGroup "#1004" "#1004"
    ServerName test2.domain.com
    ServerAlias www.test2.domain.com
    DocumentRoot /home/test2/public_html
    ErrorLog /var/log/virtualmin/test2.domain.com_error_log
    ErrorDocument 403 "This is the default page for new website."
    CustomLog /var/log/virtualmin/test2.domain.com_access_log combined
    ScriptAlias /cgi-bin/ /home/test2/cgi-bin/
    ScriptAlias /awstats/ /home/test2/cgi-bin/
    DirectoryIndex index.html index.htm index.php index.php4 index.php5
    RewriteMap fixurl prg:/etc/fixit.php
    <Directory /home/test2/public_html>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
    AddType application/x-httpd-php .php
    AddHandler fcgid-script .php
    AddHandler fcgid-script .php7.0
    FCGIWrapper /home/test2/fcgi-bin/php7.0.fcgi .php
    FCGIWrapper /home/test2/fcgi-bin/php7.0.fcgi .php7.0
    </Directory>
    <Directory /home/test2/cgi-bin>
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
    </Directory>
    RemoveHandler .php
    RemoveHandler .php7.0
    php_admin_value engine Off
    FcgidMaxRequestLen 1073741824
    <Files awstats.pl>
    AuthName "test2.domain.com statistics"
    AuthType Basic
    AuthUserFile /home/test2/.awstats-htpasswd
    require valid-user
    </Files>
    php_value memory_limit 32M
    IPCCommTimeout 41
    </VirtualHost>

下面是我的测试/etc/fixit.php文件的内容

代码语言:javascript
复制
<?php
file_put_contents('/etc/test.txt','abcd', FILE_APPEND);
?>

我知道这不是一个完整的RewriteMap示例,因为我没有在文件中添加重写规则。但是至少应该执行fixit.php文件,对吗?

谢谢你的帮助。

EN

回答 1

Server Fault用户

发布于 2017-07-29 07:54:40

尝试将您的fixit.php写到/tmp/test.txt;除非您的UID 1004对/etc具有写访问权限(它可能(但可能不应该)),fixit.php很可能正在运行,但无法创建该文件。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/865784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档