How to remove apache test page in CentOS


After you install apache web server in CentOS and point your browser to http://localhost you will see a Apache 2 Test Page powered by CentOS. You can disable or remove this apache test page from the configuration file. Before you do any modification, please make sure you have the privilege to reload the apache webserver.


apache test page

To remove apache test page in CentOS, follow the steps below:-

Advertisements

  • Start your Terminal and login to your webserver thru SSH
  • Once logged in, edit this file with your favorite editor
    /etc/httpd/conf.d/welcome.conf
  • The content of the file should look similar like this:-
    # 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.
    #
    <LocationMatch "^/+$">
       Options -Indexes
       ErrorDocument 403 /error/noindex.html
    </LocationMatch>
    
  • To remove the apache test page, comments all the line like below:-
    # 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.
    #
    #<LocationMatch "^/+$">
    #    Options -Indexes
    #    ErrorDocument 403 /error/noindex.html
    #</LocationMatch>
    
  • now reload your apache web server
    service httpd reload
  • Now point your browser to http://localhost and you shouldn't see any Apache Test Page again.



Share this with your friends:-

11 Responses to “How to remove apache test page in CentOS”

  1. I’m completely lost

  2. KHALIQ KAKAR says:

    Options -Indexes
    ErrorDocument 403 /error/noindex.html

  3. chua says:

    removing the test wont affect anything except the welcome page.

  4. Ivette says:

    Hi, i have a problem… i have read your recommendations, the issue is that we don´t have that files that you mention (the folder call “test” was erasure) but i still have the test page on my site. We have install wordpress a few days ago with the respective coming soon page and i was right and now we have this APACHE page, and we don´t know what do to have our page back. We don´t have any idea abut apache, and we dont have this: /etc/httpd/conf.d/welcome.conf .. we dont know if this is because the folder “test” was remove.

  5. Rahul says:

    Thanks – it worked for me!

  6. Nikola says:

    Work, thank’s 🙂

  7. diantokam says:

    It work for me, thank’s

  8. Roberto says:

    I’m sorry but it doesn’t work for me, if I comment the lines in welcom.conf file it still shows the Apache Test Page. And even if I add an index.html file in /var/www/html the result is the same.

    How can I get rid of this page and put the one that I want?

    Thanks

  9. ben says:

    NO! it is still in page: Apache 2 Test Page powered by CentOS

  10. Jorge says:

    Muchas gracias por vuestro aporte.

    Gracias.

  11. Bernie says:

    By default if you comment out welcome.conf you get a browser page showing the index of the http root folder (I’m using CentOS 5.5 with Apache 2.2.3). Most folks probably don’t want this.

    Maybe a better way is to run the command:

    # touch /var/www/html/index.html

    This creates a blank index.html file and when you browse the site you just get a white screen. Another benefit of this method is you don’t have to restart Apache for it to take effect.

Leave a Reply