• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to disable the default apache “Welcome Page” in CentOS/RHEL 7

by admin

The Problem

When you install Apache 2, you would see the “Welcome Page” as shown below when you first open the URL IP of the server.

disable apache 2 welcome page in CentOS RHEL 7

You may not find this page in the default Document Root “/var/www/html” as well. How can we disable this page and have our own page being displayed?

The Solution

In order to change this behaviour, check to see if there is a file called /etc/httpd/conf.d/welcome.conf. This is the page that is displayed as the Welcome Page.

Disabling Apache Welcome Page

Method 1 : removing/renaming Welcome Page

1. In order to disable this page, we have to rename the file /etc/httpd/conf.d/welcome.conf to something else or you can simply delete it if you don’t need it.

# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf_backup

2. Make sure that Apache is restarted (as root) with the command:

# systemctl restart httpd

Method 2 : allow Indexes in /etc/httpd/conf.d/welcome.conf

1. Without an index at the DocumentRoot, the default Apache Welcome page will display unless /etc/httpd/conf.d/welcome.conf is modified to allow Indexes. Edit /etc/httpd/conf.d/welcome.conf to allow Indexes.

2. Comment the Options line (add a # mark) in /etc/httpd/conf.d/welcome.conf as shown below:

# vi /etc/httpd/conf.d/welcome.conf
<LocationMatch "^/+$">
#   Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

Or you can enable Indexes by changing the – to a +

# vi /etc/httpd/conf.d/welcome.conf
<LocationMatch "^/+$">
    Options +Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

3. The Apache service (httpd) is restarted for the changes to take effect.

# systemctl restart httpd

Verify

Lets add a smaple index.html page in the Document Root to verify if we have disabled the Welcome Page and can view the pages in the Document Root.

# echo "<h1>This is a Test Page</h1>" > /var/www/html/index.html

Open the browser and point it to the server IP address. The page should look like the one shown in the screenshot below.

disable apache 2 welcome page in CentOS

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. vgextend Command Examples in Linux
  2. Creating and Removing Files and Directories Under Linux
  3. How to Use “repoquery” Command to List Package Dependencies
  4. How to Disable rpc.quotad Service in CentOS/RHEL 6 and 7
  5. How To Add New Disk to An Existing Diskgroup on RAC Cluster or Standalone ASM Configuration
  6. What are Reserved User Accounts in MySQL
  7. What is HBA Queue Depth and How to Check the Current Queue Depth Value and how to Change it
  8. How to use shell aliases in Linux
  9. Understanding The sysfs File System (/sys) in Linux
  10. K3b Nero like CD/DVD Burning Software in Ubuntu Linux

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright