Apache server error: The requested URL /ena/home/home.php was not found on this server

Apache server error: The requested URL /ena/home/home.php was not found on this server

我是 运行 通过 AWS 的 Apache 服务器:httpd-2.2.34-1.16.amzn1.x86_64

在位置方面,我的网站根位于这里:/var/www/html/ena

站点从以下虚拟目录加载:/etc/httpd/conf/httpd.conf

<VirtualHost *:80>
 DocumentRoot /var/www/html/ena
 ServerName enetapplications.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =enetapplications.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]
</VirtualHost>

在我通过 letsencrypt 添加 SSL 之前,网站一直在运行。在文件中:/etc/httpd/conf.d/ssl.conf

NameVirtualHost *:443

<VirtualHost *:443>
    DocumentRoot /var/www/html/ena
    ServerName enetapplications.com
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/enetapplications.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/enetapplications.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/enetapplications.com/chain.pem
</VirtualHost>

Let's Encrypt 似乎加载正常,因为我可以在 url 中看到 https,并且它是一个安全连接,但是在设置时不知何故我弄乱了网站的路径(enetapplications.com ) - 注意它总是在一个虚拟目录中

请告知我可以添加的任何其他信息以使这一点更清楚,并在此先感谢您的帮助。

查看错误日志时,注意到以下日志:

[Sun Jan 10 04:57:09 2021] [error] [client 185.104.184.116] File does not exist:
 /var/www/html/ena/ena, referer: https://enetapplications.com/ena/home/home.php 

这很有趣,因为该网站位于 /var/www/html/ena 而不是 /var/www/html/ena/ena

为了纠正这个问题,我调整了目录以将根移动到 /var/www/html-ena,将所有文件复制到新根并相应地更改了配置文件,例如 /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
 DocumentRoot /var/www/html-ena
 ServerName enetapplications.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =enetapplications.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]
</VirtualHost>

这似乎有效,虽然在加载 Letsencrypt 时不知何故我搞砸了 php 但这是一个不同的问题,仍然需要解决,但目前 SSL 正在调整目录结构.