Results 1 to 14 of 14

Thread: cPanel/WHM custom 403 page for all accounts?

  1. #1
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default cPanel/WHM custom 403 page for all accounts?

    how to custom 403,404,500 page for all accounts?i want to do it on server wide by cPanel/WHM. i want to do it on server side, to all the accounts on the server not a single user. thank you.

  2. #2
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello

    This can be achieved by creating an alias for "/errorfolder" in the /usr/local/apache/conf/httpd.conf file via the following steps:

    1) Create a directory in /usr/local/apache to store your custom error messages. In this case, I have named the directory "customerror":

    Code:
    mkdir /usr/local/apache/customerror
    2) Ensure your custom error pages have been added to this directory (400.shtml, 404.shtml, etc).

    3) In Web Host Manager, browse to:

    "WHM Main >> Service Configuration >> Apache Configuration >> Include Editor"

    4) Select "All Versions" under "Pre Virtual Host Include".

    5) Add the following to the text box:

    Code:
    Alias /errorfolder /usr/local/apache/customerror/
    ErrorDocument 400 /errorfolder/400.shtml
    ErrorDocument 401 /errorfolder/401.shtml
    ErrorDocument 403 /errorfolder/403.shtml
    ErrorDocument 404 /errorfolder/404.shtml
    ErrorDocument 500 /errorfolder/500.shtml
    6) Click "Update", and then click "Restart Apache".

    Your custom error pages will now be used by default.

    Thank you
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  3. #3
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    1) Create a directory in /usr/local/apache to store your custom error messages. In this case, I have named the directory "customerror":
    how to do this? and how to upload the error pages which created by me to the customerror file?

    if the user want to overrite the error pages? could he overrite those error pages by his cpanel or .hactess. many thanks.

  4. #4
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello

    1) Create a directory in /usr/local/apache to store your custom error messages. In this case, I have named the directory "customerror":

    how to do this? and how to upload the error pages which created by me to the customerror file?
    Assuming you have root access to the server, this can be done via the command line using the command provided in my last response:

    Code:
    mkdir /usr/local/apache/customerror
    More information on accessing your server via SSH can be found at:

    SSH/Shell Access

    The easiest method to create the files within this directory would likely be to create them through a command line text editor:

    Code:
    vi /usr/local/apache/customerror/404.shtml
    If you are not familiar with using "vi", feel free to use the text editor of your choice (e.g. nano or pico)

    if the user want to overrite the error pages? could he overrite those error pages by his cpanel or .hactess.
    Yes, this can be achieved via "cPanel -- Advanced - Error Pages":

    Error Pages

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  5. #5
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    many thanks,cPanelMichael . you made me know a lot. if i want to add some css and image in the 404.shtml. where should i put the image in, and how to upload the images which will be used on the 404.shtml?

    i am sorry i am a newbie. can i write the css code in vi for the 404.shtml.

    could i name it to 404.html not 404.shtml?

  6. #6
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello

    You can simply create an images directory within your error log directory. EX:

    Code:
    mkdir /usr/local/apache/customerror/images
    You can upload the images via SFTP/SCP, or upload them to an account via FTP and move them to the directory through the command line using the "mv" command.

    You can insert or edit CSS code into the error page using "vi" if you prefer, yes. If you want to name it 404.html, remember to update the entry used during steps 3-5 from my initial reply to:

    Code:
    ErrorDocument 404 /errorfolder/404.html
    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  7. #7
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    i have created the images according to the code which you told me. when i used the FileZilla Client tool with user root and whose password via SFTP to upload the images. i didn't find the images file that i created in vi. i see some files eg:root->csf/public_ftp/cpanel3-skel...and so on. how could i can find the images file.

  8. #8
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello

    The images would be located in the directory you uploaded them to. You can not edit or create an image using a text editor such as "vi". You have to upload them to the directory, which if you used the example provided would be:

    /usr/local/apache/customerror/images

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  9. #9
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    i am sorry, but when i access my WHM via SFTP with root, i can't find this directory
    Code:
    /usr/local/apache/customerror/images
    the directoy i found like this:
    root
    csf
    public_ftp
    cpanel3-skel..
    ....and so on
    i can't find the customerror/images file, so i don't know where should i upload my images to and how in vi to invoke it.eg:

    Code:
    <img src="">  
    background:url(".....")...;
    how to write the image path and the background image path?

  10. #10
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello

    You mentioned using FileZilla. In Filezilla, where it lists "Remote Site" on the right hand side, you can manually enter a directory such as:

    /usr/local/apache

    As for coding the page using HTML, the following URL should be useful for that:

    HTML Tutorial

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  11. #11
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    got it. i find i don't necessary to code it.i can upload the file to customerror file directory. many many thanks!

  12. #12
    Registered Member
    Join Date
    May 2011
    Posts
    13

    Default Re: cPanel/WHM custom 403 page for all accounts?

    oh,damn it. the directory is as this:
    Code:
    /usr/local/apache/customerror/images
    /usr/local/apache/customerror/404.shtml
    style.css
    the 404 page can' invoke the image and style.css. why? when i access a user's site which is on my server and doesn't overwrite the 404 page. the 404 page show no style and images,

  13. #13
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    11,263
    cPanel/WHM Access Level

    Root Administrator

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Check the permissions on the files and folders you've put in place.

  14. #14
    Registered Member
    Join Date
    Jan 2011
    Location
    Gomel, Belarus
    Posts
    5

    Default Re: cPanel/WHM custom 403 page for all accounts?

    Hello,

    Custom error pages applied to every user account. But how to allow users to make their own error pages in this case? I'd like my error pages to be defined only for accounts who didn't make such pages.

    Thanks for reply on advance.

Similar Threads

  1. How To Create Custom 500 Page - WHM
    By kshazad in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 09-04-2011, 01:04 PM
  2. WHM custom 404 page for all accounts
    By enjoylife in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 05-16-2011, 01:51 AM
  3. Replies: 6
    Last Post: 09-30-2010, 11:24 PM
  4. Custom index page for accounts under a reseller?
    By jhyland87 in forum cPanel Developers
    Replies: 43
    Last Post: 06-03-2009, 02:21 PM
  5. Custom page for new accounts
    By Wicked in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 01-20-2007, 06:54 AM
bargain