所以我正在运行 wordpress docker 容器,我想增加在 php.ini 中设置的上传文件大小限制。我的问题是我在任何地方都找不到该文件。
我使用 docker-compose 文件安装了容器。
Wordpress 无法识别来自 repos 的 Ubuntu 18.04 droplet 和 PHP 7.4.3 上的 PHP 更新。
它说我有 PHP 版本 7。
如何让 WP 接受更新?
我的 .htaccess 中有这个
# END WordPress
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 400M
php_value max_execution_time 180
php_value max_input_time 180
# Wordfence WAF
<IfModule mod_php7.c>
php_value auto_prepend_file '/var/www/html/wordfence-waf.php'
</IfModule>
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
# END Wordfence WAF
WP_DEBUG true 没有错误
root@benja2:~# a2enmod php7.4
Considering dependency mpm_prefork for php7.4:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.4:
Enabling module php7.4.
To activate the new configuration, you need to run:
systemctl restart apache2
root@benja2:~# systemctl restart apache2
root@benja2:~#
我的 wordfence-waf.php 中有这个
<?php
// Before removing this file, please verify the PHP ini setting `auto_prepend_file` does not point to this.
if (file_exists('/var/www/html/wp-content/plugins/wordfence /waf/bootstrap.php')) {
define("WFWAF_LOG_PATH", '/var/www/html/wp-content/wflogs/');
include_once '/var/www/html/wp-content/plugins/wordfence /waf/bootstrap.php';
}
?>
谢谢
我在我的 Ubuntu/var/www/html
目录中安装了 3 个 WordPress。过去两年没有任何问题。但是最近当我在同一目录中安装另一个脚本时,我不得不清除并重新安装 apache2.
之后,我无法访问我的所有网站。它说“无法连接”
当我输入 IP 地址时,它显示的是 Apache 服务器主页,而不是之前显示的 3 个目录页面。
我试图重新启动 Apache 服务器并且它运行良好,但仍然没有结果。
当我尝试访问 localhost/blog 时,
它说我无权访问此服务器上的 /blog/ 并且 403 被禁止。
我已经尝试了几个小时,找不到任何问题。
我尝试了很多解决方案,但似乎都不适用于我的
DocumentRoot /var/www/html/p1929018
ubuntu 18.04 版本
我尝试添加更改 000-default.conf 文件但仍然保持不变
我不确定我得到了哪一部分丢失。
我的 000-default.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 www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/p1929018
<Directory /var/www/html/p1929018>
Require all granted
</Directory>
# 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
我的 apache.conf
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default
#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/p1929018>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all granted
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我的错误日志
我可能遗漏了一些细节
当我无法在 Firefox 上打开 wordpress 页面时会出现问题,那么我该如何解决这个问题?
所有帮助将不胜感激
我在 AWS 上有一个 ec2 实例,其中已经安装了一些 Wordpress-es。我想设置一些东西,让更多人处理他们自己的项目,如果我仍然想的话,我也可以使用终端进入服务器。
我一直在关注
如何在 Ubuntu 上设置受限 SFTP 服务器?和其他一些人。我想他们都只是教用户如何sftp
进入他们自己的主文件夹,这些步骤也一直在说addUser
,但一些用户已经存在,删除它们可能会导致一些问题。
如何授予现有用户将 SFTP 用于 Wordpress 项目的权限?
假设我所有的 Wordpress 项目都已经在/var/www/
其中设置了www-data:www-data
.
设置这样的东西真的很新。
提前感谢您的帮助。
这是我/etc/ssmtp/ssmtp.conf
的,省略了 root、电子邮件、密码和主机名:
[email protected]
[email protected]
AuthPass=my_gmail_password
hostname=my_host_name
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=YES
文件权限为rw-r-----
.
虽然我保存了这个 conf,但我仍然在 WordPress 中遇到错误(通过Contact Form 7 插件,或简称 CF7)。
没有创建/var/log/mail.log
或/var/log/ssmtp.log
创建任何具有相似名称的日志文件(我知道我可以创建这些文件,touch
并假设如果我觉得确实需要它,我会这样做)。
我将 Ubuntu 16.04 与 Bash、Nginx 和sSMTP
. 在这个环境中,我有 2 个或更多 WordPress 应用程序。
的基本配置sSMTP
允许它将 WordPress 联系表单电子邮件从一个应用程序路由到我的个人电子邮件帐户 (Gmail)。
sudo cat /etc/ssmtp/ssmtp.conf
:
[email protected]
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES
[email protected]
AuthPass=___MY_GMAIL_PASSWORD___
rewriteDomain=gmail.com
hostname=alien
FromLineOverride=YES
如果我有 2 个或更多应用程序,sSMTP
当 Ubuntu 用户有 2 个或更多应用程序时应该如何重建 conf?
在您的回答中,还请参考安全问题。将我的个人 Gmail 密码暴露在配置文件中似乎是一种安全风险,而不是我想做的事情。另一方面,我不想创建第二个 Gmail 帐户,或者我必须并且应该闭嘴并这样做?...
在 DigitalOcean 中带有 LEMP 的 Ubuntu 16.04 VPS 中,我有一个 WordPress 网站,其中有一个我使用联系表 7 (CF7) 创建的联系表。
我在将电子邮件从我的 WordPress 联系表 (CF7) 传输到我的电子邮件 (Gmail) 时遇到问题。
我必须说,我会谦虚地更喜欢非插件解决方案。
A
记录持有该域。Cname
记录持有www.
域的变体。NS
将 DNS 请求与我的域、我的 IP 和其机器中的相关应用程序相关联的三个记录。我确实尝试MX
通过自动 DigitalOcean 方式添加记录(通过单击Add Gmail MX records
DigitalOcean DNS 管理工具中的按钮),并MX
添加了 5 条记录,但在我立即尝试从 WordPress 发送测试电子邮件后仍然遇到同样的错误(见下面的错误)。
目前,DNS 区域没有MX
记录,因为如果我在电子邮件上下文中想要的只是将 WordPress 联系表查询发送到我的 Gmail 帐户并且我仍然处于与同样的错误。
我总是在联系表下方的红色框中收到以下错误消息:
无法发送您的消息。
由于这个错误,没有任何东西被发送到任何地方(甚至没有发送到垃圾邮件文件夹)。
为了调试这个,我运行了以下代码来为 Postfix 创建一个日志:
touch /var/log/mail.log
权限是:
rw-r--r-- 1 root root
但是,在我尝试向自己发送一封测试电子邮件但失败后,此错误日志中没有任何内容。
sudo apt-get update && sudo apt-get upgrade postfix
.是什么导致了这个问题?
也许我可以尝试使用 Postfix 或我应该使用的替代工具,如sSMTP?我更喜欢最小到无配置的工具。我强调,除了那些登陆 WordPress 联系表的邮件外,我不会向我的 Gmail 发送任何其他电子邮件,我也不会从这台机器在任何地方发送任何其他电子邮件。
过去,我如上所述安装了 Postfix,没有任何问题。如果您知道要检查什么,我应该提供哪些详细信息,请告诉我,我会进行编辑。
1)文件/etc/postfix/main.cf
全部默认。
2)输出ps -efl | grep postfix
:
5 S root 4611 1 0 80 0 - 16352 ep_pol 07:42 ? 00:00:00 /usr/lib/postfix/sbin/master -w
4 S postfix 4613 4611 0 80 0 - 16881 ep_pol 07:42 ? 00:00:00 qmgr -l -t unix -u
4 S postfix 4930 4611 0 80 0 - 16869 ep_pol 11:02 ? 00:00:00 pickup -l -t unix -u -c
0 S root 5201 5187 0 80 0 - 3236 pipe_w 12:19 pts/0 00:00:00 grep --color=auto postfix