Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by rwniceing
at 2024-08-29 23:49:18
Point:500 Replies:10 POST_ID:829203USER_ID:12079
Topic:
Linux;;Apache Web Server
I have two questions for my apache Centos6 VPS server with root access, please advise
Question-1
I try to setup my own error.html for 404. But when include or NOT-include "ErrorDocument 404 /error.html" in my .htaccess file, whatever both methods will also go to error.html page when try to go to my testing site at http://mysite.com/store/no-this-file.html on browser(which is not existing on the store directory that just for testing). So somehow, I let it worked before or long time ago.
I can NOT remember where or when I made the error.html page forward work, Besides error page forwards is enabled(ErrorDocument 404 /error.html) in .htacess file, where else apache server can make it possible.I check /usr/local/apache/htdocs/, there is no any .htaccess
When I go to check the httpd.conf file at /etc/httpd/conf/, there is NO any about error document handle stuff
.htaccess file
==============================
ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
Question-2
If I try to go to directory such as http://mysite/store on browser , it will show out
404 forbidden page, I want to know where is the forbidden page is located on my
apache Centos VPS server, I try to find it at /usr/local/apache, nothing find.
Where is the fobidden page located ? because I want to do some css on it.
Fobidden page:
--------------------------
Question-1
I try to setup my own error.html for 404. But when include or NOT-include "ErrorDocument 404 /error.html" in my .htaccess file, whatever both methods will also go to error.html page when try to go to my testing site at http://mysite.com/store/no-this-file.html on browser(which is not existing on the store directory that just for testing). So somehow, I let it worked before or long time ago.
I can NOT remember where or when I made the error.html page forward work, Besides error page forwards is enabled(ErrorDocument 404 /error.html) in .htacess file, where else apache server can make it possible.I check /usr/local/apache/htdocs/, there is no any .htaccess
When I go to check the httpd.conf file at /etc/httpd/conf/, there is NO any about error document handle stuff
.htaccess file
==============================
ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
Question-2
If I try to go to directory such as http://mysite/store on browser , it will show out
404 forbidden page, I want to know where is the forbidden page is located on my
apache Centos VPS server, I try to find it at /usr/local/apache, nothing find.
Where is the fobidden page located ? because I want to do some css on it.
Fobidden page:
--------------------------
Forbidden
You don't have permission to access /store on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_bwlimited/1.4 PHP/5.3.21 Server at 212.1.209.242 Port 80
You don't have permission to access /store on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_bwlimited/1.4 PHP/5.3.21 Server at 212.1.209.242 Port 80
Author: rwniceing replied at 2024-08-30 20:27:35
Thanks for all of your, this thread is partially solved.
it will continue on next new thread with re-write question-1 and add more detail.
it will continue on next new thread with re-write question-1 and add more detail.
Expert: Dave Baldwin replied at 2024-08-30 11:22:26
I don't what else to tell you. You can click on "Request Attention" above to get others to look at your question.
Author: rwniceing replied at 2024-08-30 03:26:48
nothing find from grep -R "error.html" besides those are not related
Is there any method to solve this such as checking apache reaction to call error.html page in
event log files so that I can see where apache module or php script to call error.html ?
Is there any method to solve this such as checking apache reaction to call error.html page in
event log files so that I can see where apache module or php script to call error.html ?
Author: rwniceing replied at 2024-08-30 01:45:34
Include "/usr/local/apache/conf/includes/errordocument.conf" that is
shown in httpd.conf. But nothing I can find about error.html
404.shtml is going to locate other page that is not error.html
errordocument.conf file
===================================
# 401 - Unauthorized
ErrorDocument 401 /401.shtml
# 402 - Payment Required
ErrorDocument 402 /402.shtml
# 403 - Forbidden
ErrorDocument 403 /403.shtml
# 404 - Not Found
ErrorDocument 404 /404.shtml
Now I think I need to find a string in a file for all directory to seach error.html string by the
following linux command with root access
grep -R "error.html" *
shown in httpd.conf. But nothing I can find about error.html
404.shtml is going to locate other page that is not error.html
errordocument.conf file
===================================
# 401 - Unauthorized
ErrorDocument 401 /401.shtml
# 402 - Payment Required
ErrorDocument 402 /402.shtml
# 403 - Forbidden
ErrorDocument 403 /403.shtml
# 404 - Not Found
ErrorDocument 404 /404.shtml
Now I think I need to find a string in a file for all directory to seach error.html string by the
following linux command with root access
grep -R "error.html" *
Expert: Dave Baldwin replied at 2024-08-30 01:32:55
All I can think of is that you have another copy of "ErrorDocument 404 /error.html" some where in the path or a 'conf' file.
Author: rwniceing replied at 2024-08-30 01:16:55
Now doing another test, I copy error.html to error2.html
and enable it for error2.html as following new .htaccess file
.htaccess file
======================
ErrorDocument 404 /error2.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
the code ErrorDucument is also working for error2.html that is normal case and supppsed to be working. When I delete or not-include it, it will go to error.html again.
and enable it for error2.html as following new .htaccess file
.htaccess file
======================
ErrorDocument 404 /error2.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
the code ErrorDucument is also working for error2.html that is normal case and supppsed to be working. When I delete or not-include it, it will go to error.html again.
Author: rwniceing replied at 2024-08-30 01:01:41
I tried to detele it or NOT-inciude it such as
#ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
it still works to get the error.html on my browser, why ?
#ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
it still works to get the error.html on my browser, why ?
Assisted Solution
Expert: Dave Baldwin replied at 2024-08-30 00:59:39
250 points GOOD
No, I don't understand your question. Apache does not need the "ErrorDocument 404 /error.html" to put up an error message. "ErrorDocument 404 /error.html" gives you the opportunity to show a custom error message of your own in a page called "error.html" in your root directory.
Also, Apache will read the .htaccess file (if it is there) every time a request is made for a page in that web site. No restart is needed when you change the .htaccess file.
Also, Apache will read the .htaccess file (if it is there) every time a request is made for a page in that web site. No restart is needed when you change the .htaccess file.
Author: rwniceing replied at 2024-08-30 00:43:51
I know when I change .htaccess file at my public_html directory, I don't need to
restart httpd to make the new update on .htaccess is effective right way.
When delete "ErrorDocument 404 /error.html" in my .htaccess file,it also work, why ? Whatever I detele or add the "Error...." or restart httpd or not, it also work , Why ? So I guess somewhere apache did it for me that I might did it a long time ago if .htacess did NOT do it.
Do you understand my question-1 ?
Please advise
restart httpd to make the new update on .htaccess is effective right way.
When delete "ErrorDocument 404 /error.html" in my .htaccess file,it also work, why ? Whatever I detele or add the "Error...." or restart httpd or not, it also work , Why ? So I guess somewhere apache did it for me that I might did it a long time ago if .htacess did NOT do it.
Do you understand my question-1 ?
Please advise
Accepted Solution
Expert: Dave Baldwin replied at 2024-08-30 00:17:36
250 points GOOD
'ErrorDocument 404 /error.html' should be only in .htaccess in the root of your web directories.
As for the 'Forbidden' message, that is not a page, it is text that is built-in to Apache. If you want a page that you can 'style', then add other ErrorDocument pages like this:
As for the 'Forbidden' message, that is not a page, it is text that is built-in to Apache. If you want a page that you can 'style', then add other ErrorDocument pages like this:
ErrorDocument 400 /400.htmlErrorDocument 401 /401.htmlErrorDocument 403 /403.htmlErrorDocument 404 /error.htmlErrorDocument 500 /500.html 1:2:3:4:5: