jbrowse icon indicating copy to clipboard operation
jbrowse copied to clipboard

In which situation would the .htaccess file being replaced?

Open billzt opened this issue 5 years ago • 3 comments

I've just encountered (and luckily solved) a servious bug related with .htaccess:

In order to make my website faster (using apache, including JBrowse and other situations), I use gzip compressing through setting .htaccess by:

SetOutputFilter DEFLATE

In order to exclude files such as .tbi being influenced, I set an additional rule in the .htaccess in my JBrowse data directory (for example, /path/to/my/jbrowse_data, which has been linked to the JBrowse main directory) by:

# in /path/to/my/jbrowse_data/.htaccess
SetEnvIfNoCase Request_URI "\.fa$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.bam$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.bw$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.tbi$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.csi$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.gz$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.gz\.fai$" no-gzip dont-vary
SetEnvIfNoCase Request_URI "\.gz\.gzi$" no-gzip dont-vary

All things seems going well now! However, after I made some operations (such as name indexing using generate-names.pl ?), I've found that in firefox and IE the GFF3Tabix and VCFTabix track can't be rendered! (Although it seems OK in Chrome)

Finally I resolved by checking the /path/to/my/jbrowse_data/.htaccess file. It has been replaced. All my editings have been lost!!! Re-editing the .htaccess file can fix the bug.

I checked the source code in src/perl5/Bio/JBrowse and indeed find some code related with .htaccess, however I'm not sure in which situation would the .htaccess file being replaced? I guess the name indexing process (generate-names.pl) is one of them, bu I'm not sure whether there exists any other similar scripts.

billzt avatar Jun 17 '19 00:06 billzt

I'm sorry your settings were overwritten. It's not a great experience to have your tools overwrite your work. I think we could probably make JBrowse just simply not overwrite this file if it already exists

cmdcolin avatar Jun 17 '19 21:06 cmdcolin

I think the issue with Firefox and IE not working, but Chrome working, is probably due to having this header (probably automatically by the webserver) enabled

Content-Encoding: gzip

If you don't have this though, then please submit more information

Previous discussion https://github.com/GMOD/jbrowse/issues/1291

cmdcolin avatar Jun 17 '19 21:06 cmdcolin

I am also pretty sure something, probably JBrowse, had been overwriting configured passwords in my .htaccess files. I.e. password restrictions were removed ....

My workaround is a daily cron-job copying .htaccess backup files over the .htaccess files but as cmdcolin says this isn't great behaviour.

colindaven avatar Aug 14 '19 11:08 colindaven