douduo2407 2018-04-30 23:23
浏览 38

为什么Apache2将www.myurl.com/php映射到此目录?

I've recently inherited the job of maintaining a LAMP server. I have basically zero experience with web development, so sorry if I'm missing something obvious or not giving the right information.

If I go to www.myurl.com/foo/someFile.php, I get someFile.php located in /directory/number/one/foo. This is what I would expect since /etc/apache2/httpd.conf contains:

<Directory /directory/number/one/foo>
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/apache2/passwords
Require valid-user
</Directory>

However, if I go to www.myurl.com/php/someFile.php, then I get someFile.php located in /directory/number/two/ (In real life /directory/number/two/ is /home/sean/sean_test/, so it's not some default path). I haven't been able to find any references to /directory/number/two/ in any of the following places:

  • Any httpd.conf on the system
  • Any apache2.conf
  • Any file in /etc/apache2/conf.d/
  • Any .htaccess on the system
  • Any php.ini on the system
  • Any .user.ini on the system (none exist, but they are referenced by php.ini)

I also haven't been able to find any symlinks from php to /directory/number/two/ anywhere on the system. Why is Apache loading files from /directory/number/two/?

Output of /usr/sbin/apache2 -V:

Server version: Apache/2.2.16 (Debian)
Server built:   Mar  3 2013 12:09:44
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

Output of php --version:

PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar  4 2013 13:11:17) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
    • ¥15 Python报错怎么解决
    • ¥15 simulink如何调用DLL文件
    • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
    • ¥30 线性代数的问题,我真的忘了线代的知识了
    • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
    • ¥188 需要修改一个工具,懂得汇编的人来。
    • ¥15 livecharts wpf piechart 属性
    • ¥20 数学建模,尽量用matlab回答,论文格式
    • ¥15 昨天挂载了一下u盘,然后拔了