Re: How to force CRLF on non .txt files when directory browsing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good suggestion Jeff, but it won't be instructive as the local end of line delimiter will be linux vs Windows
 
beta1linux:/opt/local/logs/Websphere_7.0_logs/w70edu1 # telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /links/@_View_AppServer_Logs/@DEV_BETA_server_logs/Websphere_7.0_logs/w70edu1/test.log.txt
one
two
Connection closed by foreign host.
beta1linux:/opt/local/logs/Websphere_7.0_logs/w70edu1 # telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /links/@_View_AppServer_Logs/@DEV_BETA_server_logs/Websphere_7.0_logs/w70edu1/test.log
one
two
Connection closed by foreign host.
 
So at least you can see how it displays on linux.  But what is more significant is if it is sending a hex 0D 0A  (CR/LF) after each line, or just a 0A.  In the case of .log files, the HTTP server is only sending a 0A  (LF).
 
Gosh, I can't be the only one that has ever tried to solve this problem!
 
Thanks for the replies and suggestions, I do appreciate your guys time.
 


 
On Tue, Feb 9, 2010 at 1:57 PM, Jeff Trawick <trawick@xxxxxxxxx> wrote:
On Tue, Feb 9, 2010 at 2:51 PM, Jonathon Veencamp <jdveencamp@xxxxxxxxx> wrote:
> I don't think it's a poor editting thing.  I think this is the difference
> between Unix and Windows and CR/LF on Windows versus LF on Linux.  The HTTP
> server is adding CR/LF to .txt files to display them correctly in the
> browser.

no, Apache doesn't do that

>                  But I can't get it to display .log files in the same manner.

I dunno if because of some misunderstood config the "text/plain" isn't
getting to the browser, or if the browser thinks its smarter than the
server.

Try this:

create a very small .log file

replace /example/small.log with the real request URI; if you're using
name-based vhosts, replace 127.0.0.1 with your hostname

C:\> telnet 127.0.0.1 80
GET /example/small.log HTTP/1.1<enter>
Host: 127.0.0.1<enter>
<enter>

See what is displayed for "Content-Type:" just prior to the contents
of the log file.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux