我们的系统管理员家伙刚刚离开了一个我正在开发的项目,并且我一直在努力配置我们的生产服务器以匹配TEST(其中一切正常)。在服务器配置方面,我并不是非常了解,而且我已经陷入了很多死路,所以我非常感谢可以提供的帮助。Apache2配置404错误
通过将TEST/var/www复制到PROD,我将代码从测试推广到了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 [email protected]
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>
ports.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>
在同一台机器上测试和生产?从你的问题看来,产品是在测试的子目录?这听起来不对。另外,你可以将你的虚拟主机放在pastebin上吗?你可能不会得到很多人愿意从第三方网站下载文件,而不知道它们包含什么...... – bradym
感谢@bradym,我编辑了问题以包含虚拟主机。 TEST和PROD是云中的独立虚拟机; prod不在测试的子目录中。 – idubs11