Posted by Dublin Drupaller on June 1, 2005 at 11:06am
Just got this from my ISP....re: Drupals htaccess file...anyone know if they are taking the proverbial p?
Dear Customer,
We are contacting you to let you know that a .htaccess file on your site has
some badly programmed rewrite rules which have caused the server to crash
and entirly go down.the drupal .htaccess file they are talking about is the one that comes with 4.5.0.
# $Id: .htaccess,v 1.58 2004/10/09 20:41:49 dries Exp $.Anyone else experienced the same?
Dub
Comments
Yea right
Sounds like they don't know how to run Apache. Care to out them so we can all "run away"?
Have fun and check my Drupal Profile: http://drupal.org/user/519
would prefer not to
Hi Vwx..
Thanks but I'd prefer not to "out them" until I have asked around and determined if they really have a point.
I have already asked three techy pals and they have all said the same...the htaccess file looks fine and nothing in there will pull down the server entirely...a badly written line of code wil just fail and apache will just ignore it.
Am hoping others on here who are more savvy with apache/htaccess stuff can offer their two cents before naming and shaming them...
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Hmm
Try asking them for more details. Perhaps the rewrite rules in .htaccess are conflicting with their own rewriting rules in Apache's config and causing an infinite loop or something. Either way, it's almost certainly their fault and not Drupal's.
(You could also host with us instead!)
demolicious | leafish
demolicious | leafish
thanks
thanks for chipping in Leafish...
And thanks for the offer of hosting, but, I have already found an excellent company in the UK called Xeriom whom I cannot recommend highly enough. Anyone in the UK looking for decent, solid, drupal friendly hosting...check them out.
I'm in the process of migrating from the problem hosts to Xeriom at the moment, but, I would still like to find out if there is any truth in what the old hosts are saying...can a htaccess file really bring down an entire server?
I'm extremely dubious to the legitimacy of their claim, as I know of other drupal sites with the same hosts..using the same htaccess file (I checked with them).
When asked for more details this is what they sent..
Whats happening is the .htaccess has been causing Apache to get into infinite loops, eating up a whole load of memory and basically bringing the server down. This may have been causing problems for a long while and occasionally bringin the server down, until the system admin has done a audit of what users are doing on the server - its difficult to tell if it has been causing problems previously however at present the coding does need to be reviewed.
The Apache timeout is 300secs, normally this is fine with 99% of mod_rewrites et al as Apache will time it out successfully, but with a badly coded mod rewrite to go into a loop there is still time to consume memory and CPU along with the other cumlative processes on the server - this may cause the server to fall over before apache can time it out. Which is what happened in this case.
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
The Apache timeout is
(snip)
Tell them to upgrade their version of Apache. Also, they suck.
demolicious | leafish
demolicious | leafish
Installed into a subdirectory?
If you installed into a subdirectory, you need to alter the rewritebase in htaccess.
--
If you have a problem, please search before posting a question.
--
If you have a problem, please search before posting a question.
I managed to bring down my
I managed to bring down my server this way so I think it is a plausible solution.
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
thanks killes..
Appreciate you chipping in..
do you mean that drupals htaccess file pulled down your server when it
was installed in a sub directory?
If the answer is yes: did you find a solution or just delete the .htaccess file ?
It might be worth flagging this in the installation file for drupal. the ability for the .htaccess file that comes with drupal to pull down a server is pretty serious.
Apologies in advance if that is not what you meant and I mis-interpreted your post.
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
I had first placed the site
I had first placed the site in a subdirectory and changed the RewriteBase to match this. When I was finished with the site I moved everything one level up, but forgot to change the RewriteBase. Loads as high as 50 were to be seen afterwards...
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
can you give this a quick scan?
Hi Killes,
Appreciate you are busy, but, if you have a minute can you give the following post a quick glance?
http://drupal.org/node/24064#comment-41550
Cheers
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
I woudn't be so quick to blame yourself
Which version of Apache? The CHANGES file for for > 1.3.28 contains the following that are of interest to this problem.
Changes with Apache 1.3.28
*) Prevent the server from crashing when entering infinite loops. The
new LimitInternalRecursion directive configures limits of subsequent
internal redirects and nested subrequests, after which the request
will be aborted. PR 19753 (and probably others).
[William Rowe, Jeff Trawick, Jim Jagielski, André Malo]
*) backport from 2.x series: Prevent endless loops of internal redirects
in mod_rewrite by aborting after exceeding a limit of internal redirects.
The limit defaults to 10 and can be changed using the RewriteOptions
directive. PR 17462. [André Malo]
I've not seen Drupal cause any problems with running in a sub-dir (which I do for testing).
Have fun and check my Drupal Profile: http://drupal.org/user/519
I know what you mean..
Hi and thanks for chipping in again..
here's the server spec:
Operating system
RedHat linux 7.3
Web server Apache 1.3.27
Scripting language PHP 4.3.10
Scripting language SunONE ASP 3.6.2
CGI Scripting language Perl 5.6.1
Database server MySQL 3.23.56
Mail server Exim 3.36
I'm unclear from other posters on here whether the rewrite thing is indeed crashing the server or if the ISP is covering up something they don't want to admit.
If it's the former and drupals htaccess can indeed crash a server, it's is fairly important to flag that in the installation.txt file to other users.
Worth noting that Clean URLs worked straight out of the box on the server that supposedly crashed because of the rewrite. Which is confusing.
before I post any warnings or suggest changes to the install.txt I want to be certain that drupal can crash a server as described. At the same time, I don't want to post up any bogus warnings.
Any tips appreciated..
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Red Hat 7.3
Is currently unsupported and the Apache version is not current. Also, Exim has know exploits around. I would switch hosting companies ASAP.
Have fun and check my Drupal Profile: http://drupal.org/user/519
thanks..
Thanks Vwx...
Have already moved hosts. Thanks.
Are you saying the reason the ISP server crashed was because of their software and not drupal?
...and instead of flagging this it is simply paying special attention to the system requirement check when installing drupal and nothing to do with the rewite..
I'd like to be crystal clear before flagging anything on the install.txt or suggesting new handbook pages.
Cheers
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Those look familiar
Odd, those server specs are exactly the same as my hosting provider - Webfusion
Except that I have seen no sign of them allowing mod_rewrite to work - even subsites hang on my installation, without Clean URLs.
As I've just had a day of arguing with their parent company Pipex, I think I'll bite my tongue at this point...
/david
David Hamilton
http://www.jiffle.net/
small world..
those server specs look the same, because they are the same as your hosting provider David...glad to know I'm not the only one to be having difficulties with them.
Dub
Hey, Wadya Know?
I've just got the same message from WebFusion!
I've commented out the 'RewriteBase' line in the hope that will sort out the problem.
FYI, the sub sites are now working too, so I have to take back some of what I said about them.
I just have to hope now that their running a 2-year out of date web server and a deprecated mail server doesn't cause the whole lot to get hacked!
/david
http://www.jiffle.net/
David Hamilton
http://www.jiffle.net/
Old Apache Version
Switch ISP's if they aren't keeping their stuff current. If not you are at risk to being hacked/cracked because if they can't do a simple Apache upgrade what else are they slacking on.
Have fun and check my Drupal Profile: http://drupal.org/user/519
Is this documented anywhere?
From htaccess:
# Modify the RewriteBase if you are using Drupal in a subdirectory and# the rewrite rules are not working properly.
#RewriteBase /drupal
Who had never seen this, raise your hands?
/me raises his hand.
- Robert Douglass
-----
http://www.hornroller.com/French_Horn_News
www.robshouse.net
my Drupal book | Twitter | Senior Drupal Advisor, Acquia | Advisor ICanLocalize
hand raised here too..
raised hand here Rob...although even if I had of spotted it...I wouldn't have changed anything...as the clean urls were working.
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Thanks for spot this
It's nice to know this, but, for n00bs like myself, what RewriteBase i have to use if i decide to put drupal in a subdirectory?
I have no clue on this, what lines of the
.htaccessi need to modify?path from root to drupal dir
I think the two things you would need to do are 1) uncomment the rewrite rule (remove the #) and 2) replace
/drupalwith/path/to/your/drupal/dir, starting from the htdocs root.- Robert Douglass
-----
http://www.hornroller.com/French_Horn_News
www.robshouse.net
my Drupal book | Twitter | Senior Drupal Advisor, Acquia | Advisor ICanLocalize
Drupal in a subdirectory
If your site is placed in a directory within your main website root, say 'site', try:
# Modify the RewriteBase if you are using Drupal in a subdirectory and# the rewrite rules are not working properly.
RewriteBase /site
---
paul byrne
web monkey - http://www.leafish.co.uk/
---
paul byrne
paul.leafish.co.uk | leafish.co.uk
thanks guys...does this warrant a handbook page?
I think this is worth a handbook page...I don't mind doing it and ensuring that it is obvious in the installation procedure hanbook pages.
If someone could give the okay on the following:
Proposed title page:
Important changes to .htaccess file when installing Drupal in a subdirectory
Opening blurb:
If you are installing drupal to a subdirectory, please note that if you are enabling the CLEAN URLS feature (which removes the
?q=from your links automatically) you must edit the .htaccess file that comes with Drupal to avoid overloading your servers resources.In some circumstances, the load can become so great, it can crash your server.
#RewriteBase /drupal
to
RewriteBase /subdirectoryname
I'm also going to suggest a warning in the install.txt..I think it warrants it.
Do you agree or have any suggested changes to the handbook page?
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
I didn't know about this. I
I didn't know about this. I run Drupal in /portal subdirectory which is shown to the user as a subdomain at http://portal.wikinerds.org
Although I never saw any problems with the server, I thought maybe I should change my htaccess too. When I tried to set it to RewriteBase /portal the clean URLs stopped working on my site, so I re-commented the RewriteBase line. Now it works ok again, but I am confused: why my server has no problem while the other guy's server goes down because of his htaccess? We both run 4.5.0. The only difference is that I have configured my DNS to allow access to the /portal subdirectory as the portal.wikinerds.org subdomain.
Is my htaccess ok (without RewriteBase)?
--
NSK, Admin of Drupal-based site http://www.wikinerds.org
--
NSK, Admin of Drupal-based site http://www.wikinerds.org
Thanks, NSK Nikolaos S. Karastathis
it's new to me too..
hi nsk.
Sorry, but I'm not the best guy to ask. I was hoping others with a more indepth knowledge would help out and assumed what was given above by Steven and others was qualified & definitive.
i.e. you have to change the .htaccess file if you are installing drupal in a subdirectory and using clean urls as it can crash the server if you don't...
My original post was from an ISP that runs a shared server, so that probably added to the stres on the server with other sites increasing the load/whatever the rewrite does.
I didn't know about this until today, so, it's very new to me. I didn't change the rewrite oin my htaccess because I didn't know I had to change it and if I had of spotted the comment line, I would have ignored it anyway as the clean urls were working fine on the subdirectory install..
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
.htaccess
NSK,
Not really all that sure about .htaccess files themselves, but from reading the posts here, I can see why you would be having a problem with the http://portal.wikinerds.org/ site if you enabled the
RewriteBase /portalline in your .htaccess file. When you activated that line, the effective RewriteBase was http://portal.wikinerds.org/portal, which causes problems. The way Drupal is looking at your site, Drupal sees your site not in a '/portal' subdirectory of http://wikinerds.org, but rather a site at http://portal.wikinerds.org/. The fact that your Drupal installation is in a subdirectory is not a problem and does not effect the Drupal installation.Does that make sense?
- Eor
Thanks
Thanks for the tip guys. This should to be in the handbook, or the readme.txt, imho. :]
readme.txt preferably, I
readme.txt preferably, I don't think anybody will see it on the handbook.
--
NSK, Admin of Drupal-based site http://www.wikinerds.org
Thanks, NSK Nikolaos S. Karastathis
Looks ok to me, maybe you
Looks ok to me, maybe you should add the information about Apache versions. provided by others.
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services