Laravel 10 Centos 7 htaccess 文件已删除但仍在加载

问题描述 投票:0回答:0

我设法让我的网站完全部署在运行 apache 的 digital ocean 上,除了在我添加 ssl 证书之后,它无法启动。查看错误日志后,这就是我收到的信息。

[Tue Mar 14 05:33:19.296072 2023] [core:alert] [pid 19204] [client 183.129.153.157:51241] /home/centos/www/mysite/public/.htaccess: /home/centos/www/mysite/public/.htaccess:1: <<<<<<<> was not closed.

那个 htaccess 文件被删除了,我在它自己的服务器上发布了那个项目。与之关联的虚拟主机文件也被删除了。

更新:原来我忘了运行“setenforce 0” 但我有一个新错误 httpd:/etc/httpd/conf/httpd.conf 的第 356 行出现语法错误:无法打开配置目录 /home/centos/vhosts:权限被拒绝

目录及所有子文件夹有755权限

我的虚拟主机配置

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName www.mysite.com
        ServerAlias www.mysite.com
        DocumentRoot "/home/centos/www/mysite/public"
        ErrorLog /home/centos/logs/error_log
        CustomLog /home/centos/logs/access_log combined
        <Directory "/home/centos/www/casacoding/public">
                        Options Indexes FollowSymLinks
                        AllowOverride All
                        Require all granted
        </Directory>
</VirtualHost>

<VirtualHost *:443>
        ServerAdmin [email protected]
        ServerName www.mysite.com
        ServerAlias www.mysite.com
        DocumentRoot "/home/centos/www/mysite/public"
        ErrorLog /home/centos/logs/error_log
        CustomLog /home/centos/logs/access_log combined
        <Directory "/home/centos/www/mysite/public">
                        Options Indexes FollowSymLinks
                        AllowOverride All
                        Require all granted
        </Directory>
        SSLCertificateFile "/home/centos/vhosts/mysite-com.csr"
        SSLCertificateKeyFile "/home/centos/vhosts/mysite-com.key"
        SSLCertificateChainFile "/home/centos/vhosts/sslcert/CER - CRT Files/STAR_casacoding_com.pem"
</VirtualHost>

非常感谢任何帮助或指导。

laravel apache .htaccess php-8.1 laravel-10
© www.soinside.com 2019 - 2024. All rights reserved.