dov6891 2013-12-29 18:13
浏览 15

重新指向全局DocumentRoot,仍然运行PHP

I have a server which is serving up a web page for a project.

The project is stored in a user directory on the server. (/home/user/theproject/webstuff).

Originally, I was using the userdir module to make this accessible via http://theserver/user and a symbolic link from /home/user/public_html to /home/user/theproject/webstuff to indicate the location of the files.

But, ultimately, it would be better to serve the files from http://theserver without having to indicate the user (since there really is only one user).

And then I had a truly brilliant idea.

Instead, I would rewrite my /etc/apache2/sites-enabled/000-default.conf file to read:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  DocumentRoot /home/user/theproject/webstuff

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

Now everything is lovely and good... except that PHP doesn't run any more.

Instead, the following error is raised:

AH01630: client denied by server configuration: /home/user/theproject/webstuff/script.php

To the client, this appears as a 403 Forbidden error.

So this is something of a dual question:

  1. Is there a better way to achieve my goal?
  2. How can I enable PHP in this situation?
  • 写回答

2条回答 默认 最新

  • dql123000 2013-12-29 19:00
    关注

    You can find a well written description of this error with several possible solutions here: http://wiki.apache.org/httpd/ClientDeniedByServerConfiguration

    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭