serer迁移后未加载apache2默认主页

时间:2018-05-05 05:51:55

标签: apache apache2.2

您好我的服务器已迁移,其IP已更改。

当我尝试在浏览器中打开我的IP时,应该加载的Apache 2默认主页没有加载,不确定它是否是IP chnage的原因,我非常怀疑。

我得到了:404找不到

  

在此服务器上找不到请求的网址。

尝试了所有可能的搜索并做了R& D,但无法解决。

检查以下步骤:

1)运行Apache 2服务器

2)启用mod_rewrite

2)tail -f apache logs ..没有错误

下面是我的apache2.conf文件

等\ apache2的\ apache2.conf

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

我的etc \ apache2 \ sites-available \ 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
#ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# 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>
 #vim: syntax=apache ts=4 sw=4 sts=4 sr noet

我需要检查以解决这个问题的其他可能性是什么?

1 个答案:

答案 0 :(得分:0)

好的,我的000-default以某种方式被删除了,或者在apache的启用网站的文件夹中没有...感谢。在启用相同功能后工作。

sudo a2ensite 000-default.conf

service apache2 reload