linux - 禁止 : cannot access/on server

标签 linux perl .htaccess mod-rewrite

我目前正在将一个客户站点转移到我们的服务器,包括域,以便它具有相同的 URL 等。但是在转移所有文件并更改 .htaccess 文件以匹配旧服务器上的那个,我收到错误消息 You don't have permission to access/on this server 我不太确定为什么?有几件事需要提及,将第一行从 Options -Indexes 更改为 Options +Indexes 可以纠正这一点,但我看到的不是错误消息,而是 Index of/ 页面。另一种可能性,但是将托管平台从 Linux 切换到 Windows 会解决这些问题吗?

Options -Indexes
ErrorDocument 500 /error

<Files ~ "\.pm$">
   Order allow,deny
   deny from all
</Files>

<Files ~ "\.template$">
   Order allow,deny
   deny from all
</Files>

<Files ~ "\.tmpl$">
   Order allow,deny
   deny from all
</Files>

<Files ~ "\.log$">
   Order allow,deny
   deny from all
</Files>

<Files ~ "\.revid$">
   Order allow,deny
   deny from all
</Files>


RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index.pl
RewriteCond %{QUERY_STRING} ^browse=show_contact$
RewriteRule ^(.*)$ http://THE_DOMAIN_IS_HERE/formmail2.pl? [R=301,L]

我尝试的另一件事是添加 DirectoryIndex index.pl,然后又出现了另一条错误消息,无法执行脚本...等等等等...index.pl。我不太确定该怎么做,因此非常感谢任何有关如何纠正此问题的建议!

最佳答案

答案很简单,因为你在 Linux 上

您只是对/var/www/index.pl 的权限有误 这就是为什么它不能执行但/可以显示的原因! 你需要执行 sudo chown rightuser:rightgroup/var/www 中的文件 甚至让 mod_perl 能够执行 perl

为了给你一个更完整的答案,我需要知道以下内容 - 1. 错误记录我在您的问题下的评论中请求的内容 - 2. 你正在使用的操作系统 - 3. 您正在使用的网络服务器及其确切版本是自行编译的或来自您的 Linux 版本的软件仓库。 - 4. 如果你的 linux 版本是 apache2 就简单地做 须藤 ps 辅助 | grep Apache 别的 须藤 ps 辅助 | grep httpd - 5. 在这里发布所有内容,以便我可以帮助您

关于linux - 禁止 : cannot access/on server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23056480/

相关文章:

linux - 通过 gcloud compute scp 成功上传后无法在主目录中找到文件

c - 如何在setsockopt - C,Linux中删除TCP_MD5SIG设置的授权?

perl - 我的 $fltyp = 系统 ("file -b $LoadDir/$file");没有获取任何值(value)

perl - 如何将 CPAN 模块安装到本地目录中?

apache - mod_rewrite 与文件夹或文件同名的 URI

regex - pgrep 多个进程名称

linux - CentOS mod_fastcgi

Perl 警告退出

php - .htaccess 与 ^(.*)$ index.php/$1 给出 "No input file specified"

regex - htaccess 将带或不带尾部斜杠的 url 重定向到新 url