【发布时间】:2019-01-25 07:09:47
【问题描述】:
我对 wordpress 很陌生,我使用 tutorial 在我的系统上安装了它,一切正常,我的 wordpress 正常工作,我设置了所有内容并关闭了我的系统。当我重新启动系统并访问http://localhost/wordpress/ 时出现此错误
Not Found
The requested URL /wordpress/ was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
在互联网上搜索了一段时间后,我尝试了许多修复方法,例如:
sudo nano /etc/apache2/apache2.conf
并更改权限,但直到现在我都没有这样做。
希望得到你们的积极回应。
apache2.conf
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /usr/share>
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
<Directory /opt/lampp/htdocs/wordpress/>
AllowOverride All
Allow from All
</Directory>
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
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
【问题讨论】:
-
你在
apache2.conf中有这个目录的定义吗? -
是的,我添加了 apache2.conf,请查看@RomeoNinov
-
尝试将
DocumentRoot添加到wordpress 的Directory定义 -
真的很抱歉,但我不知道该怎么做你能告诉我@RomeoNinov
-
请查看我的回答