我们的系统管理员刚刚离开了一个我正在处理的项目,我一直在争先恐后地尝试配置我们的生产服务器以匹配 TEST(一切正常)。在服务器配置方面我不是很了解,而且我已经陷入了很多死胡同,所以我非常感谢可以提供的任何帮助。
我通过将 TEST/var/www 复制到 PROD 将代码从 TEST 提升到 PROD。因此,PROD 中的应用程序现在驻留在 PROD/var/www/www 中。我现在可以在 Production (my.production.com/www) 上访问应用程序的登录页面,但无法访问 var/www/www/ 子目录中的任何文件。我不断收到 404 Not Found 错误。
我已将站点的配置(名为“realto”的文件)从 TEST 复制到 PROD,并运行 a2ensite 以创建指向启用站点的文件夹的符号链接,但在生产中仍然出现 404 错误。
谁能告诉我可能是什么问题,或者指出我正确的方向?
编辑:我在下面包含了 httpd.conf、ports.conf 和站点配置文件的文本。
httpd.conf:
ServerName my.server.com
ServerSignature Off
ServerTokens Prod
<Directory />
Order Deny,Allow
Deny from all
Options None
AllowOverride None
</Directory>
<DirectoryMatch /var/www/*>
Order Allow,Deny
Allow from all
AllowOverride All
Options None
</DirectoryMatch>
<DirectoryMatch phpmyadmin>
Order Allow,Deny
Allow from all
Options None
</DirectoryMatch>
站点配置文件:
<VirtualHost *:80>
ServerAdmin xxx@xxxxxxxx.xxx
DocumentRoot /var/www/www
<Directory />
#Options FollowSymLinks
#AllowOverride None
Order Deny,Allow
Deny from All
</Directory>
<Directory /var/www/>
#RewriteEngine On
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} -s [OR]
#RewriteCond %{REQUEST_FILENAME} -l [OR]
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteRule ^.*$ - [NC,L]
#RewriteRule ^.*$ index.php [NC,L]
Order Allow,Deny
Allow from all
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
<Directory /var/www/www/application/configs/>
<Files ~ "\.ini$">
Deny from All
</Files>
</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
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
端口.conf:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>