+ Reply to Thread
Results 1 to 9 of 9




  

Thread: Prevent Apache and PHP from displaying too much information

      
  1. #1
    Grand Masters vectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nice vectro's Avatar
    Join Date
    September 5, 2008
    Location
    U.S.A.
    Posts
    1,499
    Rep Power
    4
    Feedback Score
    0

    Default Prevent Apache and PHP from displaying too much information

    Ever hit a 404 page on someone's web site, and at the bottom see all of the information about their server? You might see the version of Apache they are running, which modules they use, what version of PHP they have and a bunch of other stuff.

    This information can be useful to hackers! Knowing what software is running and how it is configured can be a starting point for them to find an attack vector.

    Here are two simple settings for your httpd.conf file to prevent this:

    Code:
    ServerTokens ProductOnly
    ServerSignature Off
    Do a text search your config to see if you already have these directives before you add them. If you already have them and they are set to 'On' just change them to the settings above.
    Vectro Web Hosting - Web hosting with solid tech support.

    x Proxy Host - Affordable PHP proxy hosting with proxy-specific features.

  2. #2
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    Good info!

  3. #3
    Grand Masters vectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nice vectro's Avatar
    Join Date
    September 5, 2008
    Location
    U.S.A.
    Posts
    1,499
    Rep Power
    4
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    One other thing, if it is a cPanel server, don't edit httpd.conf directly unless you are advanced and familiar with the Apache distiller. Instead, log into WHM and go to Apache Configuration --> Global Configuration and you will see the settings for ServerSignature and ServerTokens.
    Vectro Web Hosting - Web hosting with solid tech support.

    x Proxy Host - Affordable PHP proxy hosting with proxy-specific features.

  4. #4
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    Quick checked mine and found I had to change 1 item on both my cpanel servers

  5. #5
    Super Moderator tsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to behold tsdesigns's Avatar
    Join Date
    February 6, 2008
    Location
    Scotland
    Posts
    1,078
    Rep Power
    6
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    Or just make sure no-one can see your default 404 page, like I said in that other thread:

    You can make your own 404 page easily enough.

    Just make a .htaccess file and use this:

    ErrorDocument 404 /notfound.php

    Where /notfound.php is your 404 page file. You can do it with any of the error pages.
    I guess making sure it can't be seen at the server end of things is probably better, but this is a good alternative for those who don't have access to their server (e.g. shared hosting).

  6. #6
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    I send all my error pages on my main sites direct back to the index myself.

  7. #7
    Super Moderator tsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to beholdtsdesigns is a splendid one to behold tsdesigns's Avatar
    Join Date
    February 6, 2008
    Location
    Scotland
    Posts
    1,078
    Rep Power
    6
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    Quote Originally Posted by grim View Post
    I send all my error pages on my main sites direct back to the index myself.
    I used to do that, but then someone pointed out to me that it's much better to actually tell the user that they have stumbled upon a page that doesn't exist than just have it go back to the main page. Having it on it's own page also means you can track where/how the user came to that page - storing the URL they came from in the database for you to go and look at to see where/how and see if you can fix it.

  8. #8
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    I do it on ecom sites, most users have no clue and an error page confuses them more than anything. Some even think it means the site is totally broken/not secure.

  9. #9
    Grand Masters vectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nice vectro's Avatar
    Join Date
    September 5, 2008
    Location
    U.S.A.
    Posts
    1,499
    Rep Power
    4
    Feedback Score
    0

    Default Re: Prevent Apache and PHP from displaying too much information

    Quote Originally Posted by tsdesigns View Post
    Or just make sure no-one can see your default 404 page, like I said in that other thread
    True. While you're at it you might want to create custom pages for other error messages. Different error codes show the server info as well. The .htaccess code would look something like:

    Code:
    ErrorDocument 400 /400.html
    ErrorDocument 401 /401.html
    ErrorDocument 403 /403.html
    ErrorDocument 404 /404.html
    ErrorDocument 500 /500.html
    Then the corresponding pages would need to be created and placed in the website's root directory.
    Vectro Web Hosting - Web hosting with solid tech support.

    x Proxy Host - Affordable PHP proxy hosting with proxy-specific features.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. New version of Apache web server released
    By vectro in forum Dedicated / VPS Hosting
    Replies: 2
    Last Post: Aug 28th, 2009, 3:58 pm
  2. Replies: 7
    Last Post: Aug 28th, 2009, 10:41 am
  3. Displaying part of page in IE7 issue
    By Urfin in forum HTML & Website Design
    Replies: 0
    Last Post: Jul 17th, 2009, 1:24 am
  4. Prevent replies to a thread?
    By Autumn in forum Forum Management
    Replies: 6
    Last Post: Jul 11th, 2008, 1:57 am
  5. Apache Editing? WTFFF.
    By unr in forum Programming
    Replies: 6
    Last Post: May 13th, 2008, 5:13 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads