通过 HTTPS 访问网站正在断开数据库连接
Accessing web site by HTTPS is breaking database connection
我在 Apache 网络服务器上有一个 codeigniter 站点 运行
我从 letsencrypt
安装了一个 SSL
如果我通过 http://example.com
访问我的网站,我的网站工作正常
但是,
如果我通过 https://example.com 访问它,该站点显示但数据库已损坏
这是我的 htaccess 文件
Include /etc/phpmyadmin/apache.conf
<VirtualHost *:80>
ServerName example.org
ServerAlias www.example.org
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
RewriteEngine on
RewriteRule "^/resources/(.+)" "https://example.org/_resources/"$
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ProxyPass /api https://localhost:8010/api
ProxyPassReverse /api https://localhost:8010/api
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.org
ServerAlias www.example.org
DocumentRoot /var/www/html/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.org-0001/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.org-0001/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.org-0001/chain.pem
</VirtualHost>
通过在 <VirtualHost *:443>
标签内添加解决了这个问题
<Directory /var/www/html>
AllowOverride All
</Directory>
我在 Apache 网络服务器上有一个 codeigniter 站点 运行 我从 letsencrypt
安装了一个 SSL如果我通过 http://example.com
访问我的网站,我的网站工作正常但是,
如果我通过 https://example.com 访问它,该站点显示但数据库已损坏
这是我的 htaccess 文件
Include /etc/phpmyadmin/apache.conf
<VirtualHost *:80>
ServerName example.org
ServerAlias www.example.org
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
RewriteEngine on
RewriteRule "^/resources/(.+)" "https://example.org/_resources/"$
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ProxyPass /api https://localhost:8010/api
ProxyPassReverse /api https://localhost:8010/api
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.org
ServerAlias www.example.org
DocumentRoot /var/www/html/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.org-0001/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.org-0001/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.org-0001/chain.pem
</VirtualHost>
通过在 <VirtualHost *:443>
标签内添加解决了这个问题
<Directory /var/www/html>
AllowOverride All
</Directory>