PDA

View Full Version : Default Error Pages?


jlasman
08-30-2003, 02:18 PM
Whenever I type the name of an html page that doesn't exist I get a default error message that says, in part:

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Aren't there default error pages?

If there are, how do I enable them?

Thanks.

Jeff

l0rdphi1
08-30-2003, 05:49 PM
http://domain.tld:2222/HTM_ERROR_PAGES?DOMAIN=domain.tld

Make sure they're over 512 bytes, and I think they're enabled automatically (not sure).

jlasman
08-30-2003, 06:09 PM
Phil, the line is too long so it doesn't show, and my browser errors out without copying in the URL so I can't turn it into a real one to look.

Do you, does anyone, know where the default error pages are on the server.

Default, as in "already there when the site is created"????

The 512 k limitation is an ie limitation, and I'm testing with Konqueror, Mozilla, and Netscape. None of which care; the error pages can be of any length and will still show up.

The error we're getting is coming from Apache, which is telling us it can't find a default error page.

Jeff

l0rdphi1
08-30-2003, 06:17 PM
Yeah, I see. You're asking where DA tells apache to use them, and that I do not know.

And by the way, that URL is:http://domain.tld:2222/HTM_ERROR_PAGES?DOMAIN=domain.tld

jlasman
08-30-2003, 06:26 PM
Thanks, Phil.

When I type that in (and fix it of course :) ), I get a "document contains no pages" error : ( ).

I don't know if there are defaults or not.

So far that's the least of my worries.

It's taken me since last night to move five sites, and ALL of them have failed in one significant manner or another.

And it looks like Mark and John are out of touch this weekend :( .

I already lost one client, and I just got off the phone sweet-talking another.

The problem is I have a timed Plesk License, as a gold partner, and I didn't renew the partnership, in expectation of the DA working for me. But I got delayed in implementing it, and had the wrong date for the Plesk license expiration.

So I may have to either renew the Plesk partnership or at least buy a Plesk license, just to stay in business.

I have other Plesk licenses, but there's no way to do a partial Plesk restore (a restore wipes the machine :( ), and I'm not allowed (under license terms) to use the same license on more than one system.

As you may have noticed, in one post I even offered to pay for support today.

Jeff

DirectAdmin Support
08-31-2003, 12:55 AM
Hello,

You should be able to access the required links by simply going through the User Panel.

More information can be found here:
http://www.site-helper.com/misc.html#404

John

l0rdphi1
08-31-2003, 01:00 AM
I think he tried already:
Originally posted by jlasman
When I type that in (and fix it of course :) ), I get a "document contains no pages" error : ( ).

DirectAdmin Support
08-31-2003, 01:03 AM
Odd... nowhere in DirectAdmin does that string exist. Perhaps an email to support@directadmin.com is in order. Are you using on of our skins?

John

jlasman
08-31-2003, 04:03 PM
John,

I'm using your default skin.

The error message in question comes from Apache itself when it can't find the error file it's supposed to use.

I'll check this more later, but first I want to move and test some real sites.

If this problem continues, then the best way to track it down would be for you to tell me where you keep the actual default error pages; then I can check through the apache configuration.

Or you could do it as well, if you have the time.

Jeff

DirectAdmin Support
08-31-2003, 05:37 PM
It's up to the User to add error pages. They will be located in their document root. If they don't have them, they'll get an error page, with an additional note about not having an error page. (Possibly similar to the one you have)

The name of the 404 page file should be 404.shtml

John

jlasman
08-31-2003, 10:44 PM
Hmmm....

This puts a burden on the site-owner that I've not seen from any other control panel I've used (admittedly, nowhere near all).

The default installation of Apache has it's own error pages, Cobalt RaQs have a default error page, and Plesk has them as well.

Is there some way I could have default error pages? Perhaps put them into the skel directory?

Thanks.

Jeff

DirectAdmin Support
08-31-2003, 10:48 PM
Jeff, there is a "default" directory that is used to copy default files into each domain that is created. (The same one that shows the default "welcome to domain.com, upload your index.html file to public_html").

The location of this folder is under the resellers home directory:

/home/resellername/domains/default

Everything in that directoy is copied to the user's public_html directory when a new domain is created, so if you want default error pages, put them in there. Also, the index.html file will be tokenized.

John

gerrybakker
02-07-2007, 11:13 AM
I know this topic hasn't been touched in almost 4 years but here is a nudge. The default httpd.conf has references to the 401,403,404,500.shtml files and yet they don't exist by default on the server.

So my server logs are stuffed with needless log entries showing the files don't exist. This is so unnecessary and ugly - why hasn't the default pages for this been implemented for all sites without any end user intervention? I agree with jlasman that this puts an unnecessary burden on all end users and it affects their search engine rankings when they get improperly terminated pages.

Shouldn't there be a standard apache set of error pages sitting in the /var/www/html folder so it becomes the default for all sites who don't have their own 404.shtml files in their own public_html folders?

Yes I could put the default shtml files the /home/resellername/domains/default folder but this also puts an unnecessary burden on me when initially configuring a new server. All your competition provides this default set of error pages? Why are you resisting after all these years?

bruin03
03-28-2007, 09:23 PM
I know this topic hasn't been touched in almost 4 years but here is a nudge. The default httpd.conf has references to the 401,403,404,500.shtml files and yet they don't exist by default on the server.

So my server logs are stuffed with needless log entries showing the files don't exist. This is so unnecessary and ugly - why hasn't the default pages for this been implemented for all sites without any end user intervention? I agree with jlasman that this puts an unnecessary burden on all end users and it affects their search engine rankings when they get improperly terminated pages.

Shouldn't there be a standard apache set of error pages sitting in the /var/www/html folder so it becomes the default for all sites who don't have their own 404.shtml files in their own public_html folders?

Yes I could put the default shtml files the /home/resellername/domains/default folder but this also puts an unnecessary burden on me when initially configuring a new server. All your competition provides this default set of error pages? Why are you resisting after all these years?
I found this thread due to finding that domains on my machine don't have error messages by default.
I agree with the previous poster. This puts an uneccessary burden on me when configuring a new server. I do hope that this was initially an oversight and that the Direct Admin Team ultimately listens to their customers and reconsiders. I don't see any benefit to leaving the error messages out by default.

DirectAdmin Support
03-31-2007, 05:57 PM
Hello,

default error messages can be added by default.
For us with releases, they can be put into:

/usr/local/directadmin/data/templates/default/404.shtml

so newly created resellers/admins have them for new accounts they create.

For existing resellers/admins, if you want your new users to have them, put them in:

/home/reseller/domains/default/404.shtml

and they'll get copied to the new account when it's created.

So my only question at the moment is:

1) do you actually want them.
2) what do you want them to look like, if anything at all.
3) do you want the other pages as well, not just 404?

John

jlasman
04-01-2007, 02:02 PM
John, if it were me, I'd like them to look like ordinary default error pages Apache creates if you don't have paths for them in your httpd configuration. And yes, I think they should be available for all of them.

This is good enough for me:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL /nothere.html was not found on this server.<P>
</BODY></HTML>
This is exactly what I get when I comment out the ErrorDocument lines on a DA server running httpd 1.x, and restart apache.

Personally, I believe cute error messages, similar to the ones the old Cobalt RaQ servers used, look ugly to me, and uses extra resources, and should be left for those who want something customized.

Jeff

DirectAdmin Support
04-01-2007, 03:38 PM
Hello,

I've added 400, 401, 403 and 404 as default in /usr/local/directadmin/data/templates/default/*.shtml.
Will apply to new resellers when they're created and copied to /home/reseller/domains/default/*.shtml along with everything else in the tempates/default directory.

Here is the html used
400<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request/H1>
There was an error in your request.
<HR>
<I><!--#echo var="HTTP_HOST" --></I>
</BODY></HTML>401<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>401 Authorization Required</TITLE>
</HEAD><BODY>
<H1>Authorization Required</H1>
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
<HR>
<I><!--#echo var="HTTP_HOST" --></I>
</BODY></HTML>403<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>403 Forbidden</TITLE>
</HEAD><BODY>
<H1>Forbidden</H1>
You don't have permission to access <!--#echo var="REQUEST_URI" --> on this server.
<HR>
<I><!--#echo var="HTTP_HOST" --></I>
</BODY></HTML>404<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL <!--#echo var="REQUEST_URI" --> was not found on this server.
<HR>
<I><!--#echo var="HTTP_HOST" --></I>
</BODY></HTML>John

jlasman
04-02-2007, 03:32 PM
Thanks, John. Will this just happen during the next update, for existing domains? For existing servers for new domains?

Jeff

DirectAdmin Support
04-02-2007, 03:36 PM
It will be for next update (it's already coded), and only few newly created Resellers/Admins after the update. Existing Resellers will not have their /home/reseller/domains/default directory updated with this data, so their new Users will not get the new shtml files unless they manually create the shtml files in their own default directory.

John

RadMan
05-29-2007, 07:34 PM
It will be for next update (it's already coded), and only few newly created Resellers/Admins after the update. Existing Resellers will not have their /home/reseller/domains/default directory updated with this data, so their new Users will not get the new shtml files unless they manually create the shtml files in their own default directory.

John

John..

Is there any way that the error files can be inserted into an /error folder by default when creating a new user?

Reason I'm asking is because I just created a new re-seller last week and set up a couple of users in his account...

All five of the error files are now being displayed loosy goosy in the user's root directory..

If SSH instructions to create a default subfolder for all users are in order, can you please give me a step by step process right after logging in as root..

Floyd.. Don't bother answering.. I can't see you anyways and the question has not been posted to you.

Cheers

DirectAdmin Support
05-30-2007, 12:02 AM
Yes they can.cd /usr/local/directadmin/data/templates/custom
cp -Rp ../default .
cd default
mkdir error
mv *.shtml errorWhich will now create the new folder for all new Resellers in /home/reseller/domains/default/error/*.shtml

Now.. for any *existing* Reseller and/or Admins, you'll need to fix them, eg:cd /home/reseller/domains/default
mkdir error
mv *.shtml errorand.. again for all users who need this particular setup, from their public_html to public_html/error.

Lastly, you'll need to tell apache that their location has changed.
Edit your main /etc/httpd/conf/httpd.conf file. Find the code:ErrorDocument 400 /400.shtml
ErrorDocument 401 /401.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtmland change it toErrorDocument 400 /error/400.shtml
ErrorDocument 401 /error/401.shtml
ErrorDocument 403 /error/403.shtml
ErrorDocument 404 /error/404.shtml
ErrorDocument 500 /error/500.shtmlJohn

RadMan
05-30-2007, 04:58 AM
Thank you.. Much appreciated..

Just wondering if you can include this in your next update as I think it would maintain a clean directory sructure for users and eliminate the need of loose files laying aorund in the root.. :)

Cheeers

tlchost
05-30-2007, 05:23 AM
John..

Is there any way that the error files can be inserted into an /error folder by default when creating a new user?



AFAIK, Apache expects to see the error files in the root(public_html) folder...so if you were to move them you'd most likely have to change the httpd.conf, which would involve the dreaded shell commands.

RadMan
05-30-2007, 05:51 AM
AFAIK, Apache expects to see the error files in the root(public_html) folder...so if you were to move them you'd most likely have to change the httpd.conf, which would involve the dreaded shell commands.

Are you saying that the code that John posted is not sufficient enough to make the changes I'm looking for?

Cheers

tlchost
05-30-2007, 07:32 AM
Are you saying that the code that John posted is not sufficient enough to make the changes I'm looking for?

Cheers

No....John posted a way for you to have the error pages in /error ... which then meant that you would have to change httpd.conf and some other things using the shell.

Based on your ongoing complaints about the shell(whichy you label as ssh), I was simply trying to tell you that if you moved the error pages you would have to do some stuff in the shell.

You'll also notice that John gave you several commands that would have to be initiated in order to make all of it work.

My question is...is all that work worth it simply to NOT have the error pages in the public_html?

Finally...I hope that John does NOT take up your suggestion to move the error pages to a new location. If he does, then those of us with existing reseller accounts may have to make changes, and then we would be faced with part of the accounts having the error pages in public_html and part in public_html/error

jlandes
05-30-2007, 07:39 AM
Also, if you move the error pages, then the Custom Error Pages function in DirectAdmin would not edit those error pages, since DA looks for them to be in the public_html directory.

RadMan
05-30-2007, 07:40 AM
AHhhh.. Okey Dokey...

Maybe I didn't make myself clear enough on where I would like the the error pages consolidated..

I would like to see them in their own folder eg:

www.yoursitename.com/error/400.shtml
www.yoursitename.com/error/401.shtml
www.yoursitename.com/error/402.shtml
www.yoursitename.com/error/403.shtml
www.yoursitename.com/error/404.shtml
www.yoursitename.com/error/500.shtml

Right now they sit in the users root:
www.yoursitename.com/400.shtml
www.yoursitename.com/401.shtml
www.yoursitename.com/402.shtml
www.yoursitename.com/403.shtml
www.yoursitename.com/404.shtml
www.yoursitename.com/500.shtml

I'm just looking to clean up the users root by default

RadMan
05-30-2007, 07:55 AM
Also, if you move the error pages, then the Custom Error Pages function in DirectAdmin would not edit those error pages, since DA looks for them to be in the public_html directory.

Jeremy.. Where can you find this feature in the admin panel?

Custom Error Pages function in DirectAdmin

Cheers...

GranTW
05-30-2007, 08:35 AM
Log in, click the User access level link to show the user panel then click a domain if you have too, then under advanced features you should see "Custom Error Pages".

Grant

RadMan
05-30-2007, 09:09 AM
Log in, click the User access level link to show the user panel then click a domain if you have too, then under advanced features you should see "Custom Error Pages".

Grant

Thanks Grant.. Right under my nose.. doh

Just goes to show ya how much weight I place on the look of an error page.. :p

RadMan
06-01-2007, 06:20 AM
John...

I followed your proceedure step by step and the /error folder is being created for all users in the two reseller accounts that I have set up, BUT, the error folder isn't being populated (with the .shtml files), for the users in one reseller account .

How do I "make this happen" for the one re-seller?

DirectAdmin Support
06-01-2007, 11:04 AM
For Resellers creating Users, the data is taken from:
/home/reselelr/domains/default/*

So you'd be looking for:
/home/reselelr/domains/default/error/404.shtml
etc..

where reseller is the name of the account that is creating the User account. Eg, "admin" would be one such account. (anyone that can create Users)

John

RadMan
06-01-2007, 09:05 PM
Maybe I didn't make myslef clear enough...

OK.. The code as you previously outlined worked fine for reseller# 2

How do I do the same for reseller# 1 when the only folder that is being created is the "error" folder for all the resellers user accounts..

The error folder is getting populated just fine for all th eusers that reseller# 2 has in his accounts but not for reseller# 1.. The error folders stay empty for his new users.