|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Searching text within a file
hi,
i'm trying to find the file in a unix server that contains the text: "The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, XXXX@XXXX.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log." i know that you can use the find command, but im not too experienced in using it.. can someone show me how with the text above? |
|
#2
|
||||
|
||||
|
Check in this file:
$apache_install_dir/error/HTTP_INTERNAL_SERVER_ERROR.html.var
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
find /start/of/search/path | xargs grep "something"
You might want to pick out something very specific text for your grep. |
|
#4
|
|||
|
|||
|
Maybe I misunderstood...
find /start/of/search/path -name "filename" |
|
#5
|
|||
|
|||
|
Quote:
can i do this? find / -name "HTTP_INTERNAL_SERVER_ERROR.html.var" also, is HTTP_INTERNAL_SERVER_ERROR.html.var where all server error logs are stored for all unix servers? |
|
#6
|
||||
|
||||
|
The error quoted in your original post is (or appears to be) what Apache sends to the browser (by default) when a 500 server error occurs. Apache has one of these .html.var pages for just about every possible server error, and it's configured (via ErrorDocument in httpd.conf) to show these files when one of those errors occurs. They are in $apache_install_dir/error/
Apache logs its errors in the file set by ErrorLog in httpd.conf. It may or may not be similar to the error message displayed in the browser, and it will show more information. So when Apach encounters an error, two things happen: it logs an error in the ErrorLog and sends the ErrorDocument for that error to the browser. You may see that as one action: "an error occurred", but I see it as two actions that are related by the fact that an error occurred. BTW: Code:
grep -r "The server encountered an internal error" /usr/local |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Searching text within a file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|