im将wordpress迁移到我的服务器。 我的服务器上有一个站点,并为第二个站点创建了一个apache2 .conf 我上传了默认的index.html apache2文件,并使用letencrypt安装了SSL,此后,我尝试打开网站,一切正常,网站可以正常工作。 因此,我导入了mysql数据库,并且我上载了wordpress文件站点,并给出了HTTP错误500。 将所有wordpress文件移动到某个地方并再次上传默认的index.html之后,该站点再次开始工作,因此我认为wordpress某个地方肯定有问题。
第1网站的效果也很好。
这是我的第二个站点conf:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName 2na10.pl
ServerAlias www.2na10.pl
ServerAdmin kontakt@2na10.pl
DocumentRoot /var/www/html/2na10/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =2na10.pl [OR]
RewriteCond %{SERVER_NAME} =www.2na10.pl
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我的site-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port
that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin kontakt@2na10.pl
DocumentRoot /var/www/html/2na10
ServerName 2na10.pl
ServerAlias www.2na10.pl
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/2na10.pl/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/2na10.pl/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin kontakt@2na10.pl
DocumentRoot /var/www/html/2na10
ServerName 2na10.pl
ServerAlias www.2na10.pl
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
</IfModule>
和我的.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
编辑: 包括apache2日志
==> /var/log/apache2/error.log <==
[Wed Jan 16 00:52:21.498446 2019] [ssl:debug] [pid 2466] ssl_engine_io.c(1017): [client 162.158.92.172:55480] AH02001: Connection closed to child 2 with standard shutdown (server 2na10.pl:443)
[Wed Jan 16 00:53:08.346304 2019] [ssl:info] [pid 2472] [client 162.158.89.31:39150] AH01964: Connection to child 5 established (server 2na10.pl:443)
[Wed Jan 16 00:53:08.347697 2019] [socache_shmcb:debug] [pid 2472] mod_socache_shmcb.c(528): AH00835: socache_shmcb_retrieve (0x83 -> subcache 3)
[Wed Jan 16 00:53:08.347810 2019] [socache_shmcb:debug] [pid 2472] mod_socache_shmcb.c(913): AH00851: shmcb_subcache_retrieve found no match
[Wed Jan 16 00:53:08.347919 2019] [socache_shmcb:debug] [pid 2472] mod_socache_shmcb.c(538): AH00836: leaving socache_shmcb_retrieve successfully
[Wed Jan 16 00:53:08.348082 2019] [ssl:debug] [pid 2472] ssl_engine_kernel.c(2096): [client 162.158.89.31:39150] AH02043: SSL virtual host for servername 2na10.pl found
[Wed Jan 16 00:53:08.380164 2019] [ssl:debug] [pid 2472] ssl_engine_kernel.c(2023): [client 162.158.89.31:39150] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
[Wed Jan 16 00:53:08.408046 2019] [ssl:debug] [pid 2472] ssl_engine_kernel.c(354): [client 162.158.89.31:39150] AH02034: Initial (No.1) HTTPS request received for child 5 (server 2na10.pl:443), referer: https://2na10.pl/wp-admin/admin.php?page=smush
[Wed Jan 16 00:53:08.408388 2019] [authz_core:debug] [pid 2472] mod_authz_core.c(809): [client 162.158.89.31:39150] AH01626: authorization result of Require all granted: granted, referer: https://2na10.pl/wp-admin/admin.php?page=smush
[Wed Jan 16 00:53:08.408482 2019] [authz_core:debug] [pid 2472] mod_authz_core.c(809): [client 162.158.89.31:39150] AH01626: authorization result of <RequireAny>: granted, referer: https://2na10.pl/wp-admin/admin.php?page=smush
[Wed Jan 16 00:53:08.436787 2019] [:error] [pid 2472] [client 162.158.89.31:39150] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/2na10/wp-content/plugins/woocommerce-dotpay/woocommerce-dotpay.php:64\nStack trace:\n#0 /var/www/html/2na10/wp-content/plugins/woocommerce-dotpay/woocommerce-dotpay.php(95): getLatestVersionDotpayModule()\n#1 /var/www/html/2na10/wp-settings.php(322): include_once('/var/www/html/2...')\n#2 /var/www/html/2na10/wp-config.php(92): require_once('/var/www/html/2...')\n#3 /var/www/html/2na10/wp-load.php(37): require_once('/var/www/html/2...')\n#4 /var/www/html/2na10/wp-admin/admin-ajax.php(22): require_once('/var/www/html/2...')\n#5 {main}\n thrown in /var/www/html/2na10/wp-content/plugins/woocommerce-dotpay/woocommerce-dotpay.php on line 64, referer: https://2na10.pl/wp-admin/admin.php?page=smush
==> /var/log/apache2/access.log <==
162.158.89.31 - - [16/Jan/2019:00:53:08 +0100] "POST /wp-admin/admin-ajax.php HTTP/1.1" 500 3451 "https://2na10.pl/wp-admin/admin.php?page=smush" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
==> /var/log/apache2/error.log <==
[Wed Jan 16 00:53:08.438588 2019] [ssl:debug] [pid 2472] ssl_engine_io.c(1017): [client 162.158.89.31:39150] AH02001: Connection closed to child 5 with standard shutdown (server 2na10.pl:443)