禁用CentOS下Apache的測試頁面

2021-12-29 16:22:50 字數 1197 閱讀 2912

禁用centos下apache的測試頁面

在centos中安裝apache並啟動後,預設centos會為apache新增乙個測試頁面,安裝完畢並且對apache的保持預設配置,之後在瀏覽器中輸入你的站點的網域名稱或ip位址,瀏覽器會開啟如下介面

該介面是用來測試apache伺服器是否工作正常。

禁用該測試頁面的方法如下:

1.開啟終端,登陸到centos上

2.在終端中輸入以下命令

3.繼續輸入命令,顯示當前目錄下的檔案

ls4.找到名為welcome.conf的檔案,並用vim開啟

vim welcome.conf

welcome.conf的內容如下

# this configuration file enables the default "welcome"

# page if there is no default index page present for

# the root url.  to disable the welcome page, comment

# out all the lines below.

options -indexes

errordocument 403 /error/noindex.html

檔案中的說明性內容說明了該檔案的主要作用,以及關閉該作用的方法。其實該檔案也是乙個普通的配置檔案,並被包含進了apache伺服器httpd.conf主檔案中,只要用"#"將welcome.conf的內容注釋掉即可,如下:

# this configuration file enables the default "welcome"

# page if there is no default index page present for

# the root url.  to disable the welcome page, comment

# out all the lines below.

##    options -indexes

#   errordocument 403 /error/noindex.html

5.重新啟動apache

注:檢視noindex.html為存放路勁

cd /var/www/error/

ls

centos下如何解除安裝apache

在linux上刪除已經安裝的軟體或者服務,比如centos上解除安裝apache要如何操作呢?下面來一起看看。02.接著開始使用centos下的解除安裝命令,rpm e 軟體或服務名 我們執行 如果出現類似 httpd 2.2.0 is needed by installed gnome user ...

CentOS下Apache安裝總結

作業系統 centos 6.8 伺服器 apache 2.4.29 其他關鍵依賴庫 apr 1.6.3 apr util 1.6.1 pcre 8.41 命令格式 命令說明 命令引數解釋 tar zxvf dir1 c dir2 將dir1下的檔案解壓到dir2指定的目錄下 無rpm qa soft...

CentOS 下編譯安裝Apache

centos 下編譯安裝apache 解除安裝原有的apache 安裝apr tar zvxf apr 1.4.6.tar.gz cd apr 1.4.6 configure prefix usr local apr make make install 安裝apr util tar zvxf apr...