Apache2 当没有启用站点时,是否应显示apache默认页面?

Apache2 当没有启用站点时,是否应显示apache默认页面?,apache2,Apache2,当我这样做时: sudo a2dissite 我明白了 意味着所有站点都被禁用 当我将IP本地网络地址放入浏览器时,我会得到默认的Apache页面 http://192.168.1.101/ (putting this in the browser address bar gets me the default apache page) 用 sudo service apache2 stop 给了我“无法访问此站点”的提示,因此apache正在为该默认页面提供服务 那么,在没有启用站点的情

当我这样做时:

sudo a2dissite
我明白了

意味着所有站点都被禁用

当我将IP本地网络地址放入浏览器时,我会得到默认的Apache页面

http://192.168.1.101/ (putting this in the browser address bar gets me the default apache page)

sudo service apache2 stop
给了我“无法访问此站点”的提示,因此apache正在为该默认页面提供服务

那么,在没有启用站点的情况下显示apache默认页面是否合适

后续:如何将不同的目录设为默认目录?我有一个test.conf设置

<VirtualHost 127.0.0.2:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /home/myusername/websites/wp-test-site/site

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

服务器管理员webmaster@localhost
DocumentRoot/home/myusername/websites/wp测试站点/site
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
我认为启用该选项将使默认的站点文件夹/home/myusername/websites/wp测试站点/site,但事实并非如此


是,我正在使用sudo重新启动。

将.htaccess文件添加到文档根目录。 将默认文件更改为如下所示

DirectoryIndex index.php default.html
现在在文档根目录中放置一些index.php。
接下来,您可以从索引文件指向用户所在的位置。

将.htaccess文件添加到文档根目录。 将默认文件更改为如下所示

DirectoryIndex index.php default.html
现在在文档根目录中放置一些index.php。 接下来,您可以从索引文件指向用户所在的位置