输入域名

时间:2018-06-10 07:16:13

标签: apache ubuntu-16.04 ubuntu-server

我安装了一个ubuntu服务器16.04和LAMP,它工作得很好,我可以使用ip地址加载默认的web。

我还通过域synappse.ir创建了一个新的虚拟主机。如果我输入synappse.ir/index.html,它会加载页面并且没有任何问题,但是当我只输入没有index.php的域名时,它无法找到或加载index.html文件!

这是我的虚拟主机配置文件:

<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 ServerNamei
        # 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 nasser.man@gmail.com
        ServerName synappse.ir
        ServerAlias synappse.ir
        DocumentRoot /var/www/synappse.ir
        DirectoryIndex index.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

        #<Directory /var/www/html>
        #       Options Indexes FollowSymLinks MultiViews
        #       AllowOverride All
        #       Require all granted
        #</Directory>

        # 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>

是否有其他配置可启用此功能?

1 个答案:

答案 0 :(得分:0)

抱歉,页面已缓存,一切正常。