What's xbithack?

They have: 52 posts

Joined: Nov 1999

Hello,
What is xbithack and where can I get it?
Thanks
Boris

------------------
-------------------------
Echo Web: The Web Developer's Starting Point
http://echoweb.newn.com

http://EchoWebHQ.com
WIN cash, free web hosting and up to 50,000 button exposures at http://echodev.com/contest/ in less than 60 seconds. EVERYONE IS A WINNER (seriously)!

They have: 334 posts

Joined: Dec 1999

It's not a file, it an .htaccess modification for Apache webservers.

Just add the following line to your .htacess file:

XBitHack on

They have: 52 posts

Joined: Nov 1999

All right, thanks
In my previous post, somebody told me that using XBitHack wil allow me to use ssi in .cgi files...
What do I do now?
Thanks
Boris
p.s. Sorry for asking so many questions

http://EchoWebHQ.com
WIN cash, free web hosting and up to 50,000 button exposures at http://echodev.com/contest/ in less than 60 seconds. EVERYONE IS A WINNER (seriously)!

They have: 334 posts

Joined: Dec 1999

I don't think it was explained right. XBitHack changes how the server views and handles the CGI output, but it DOES NOT allow it to be parsed. So you can't use XBitHack to do things like includes and echoes for time/date

From the apache.org FAQ

quote:How can I have my script output parsed?
So you want to include SSI directives in the output from your CGI script, but can't figure out how to do it? The short answer is "you can't." This is potentially a security liability and, more importantly, it can not be cleanly implemented under the current server API. The best workaround is for your script itself to do what the SSIs would be doing. After all, it's generating the rest of the content.

This is a feature The Apache Group hopes to add in the next major release after 1.3.

Personally, I'm hoping this does get implemented in Apache 2.x It would be really useful for those of us that rely on includes for site maintenence. It would mean the end of editing all the CGI output template files.

[This message has been edited by Maverick (edited 28 February 2000).]

They have: 12 posts

Joined: Feb 2000

So what exactly does XBitHack do? I had read somewhere that it did in fact cause CGI output to be parsed for SSI.

------------------
"The way that can be told is not the eternal,
it cannot be defined or explained,
it can only be experienced..." Ashida Kim

"The way that can be told is not the eternal,
it cannot be defined or explained,
it can only be experienced..." Ashida Kim

They have: 334 posts

Joined: Dec 1999

Maybe one of the Apache gurus can clear this up or explain it better in case I have it wrong, but here goes.....

By default, the server doesn't allow caching of parsed documents. Since it can't be sure if the output of the parsing will be the same as the last time a client viewed that document (as in the case of a simple include) or if the parsing output will differ (like adding a date/time stamp), the default is no caching. That prevents the server from delivering an outdated version of the file rather than the most current version.

XBitHack sort of works around that. It tells the server to treat certain documents, like CGI output, as if they were in fact SSI. But that's generally only for cache/no-cache purposes as far as I can tell. Rest assured though, even if the server treats the CGI output as a parsable document, it WILL NOT actually process the SSI directives. I've tested that myself in myriad ways and including SSI tags like a simle <!--#echo var="DATE_LOCAL" --> in CGI output will cause server errors with XBitHack enabled.

They have: 12 posts

Joined: Feb 2000

Here is what the Apache documentation says about XBitHack:

code:

The XBitHack directives controls the parsing of ordinary html documents. This directive only affects
files associated with the MIME type text/html. Status can have the following values: 

off 
     No special treatment of executable files. 
on 
     Any file that has the user-execute bit set will be treated as a server-parsed html document. 
full 
     As for on but also test the group-execute bit. If it is set, then set the Last-modified date of the
     returned file to be the last modified time of the file. If it is not set, then no last-modified date is
     sent. Setting this bit allows clients and proxies to cache the result of the request. 

     Note: you would not want to use this, for example, when you #include a CGI that produces
     different output on each hit (or potentially depends on the hit). [/code]
 http://apache.org/docs/mod/mod_include.html#xbithack 

------------------
"The way that can be told is not the eternal,
 it cannot be defined or explained,
 it can only be experienced..." Ashida Kim 

"The way that can be told is not the eternal,
it cannot be defined or explained,
it can only be experienced..." Ashida Kim

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.