Page 1 of 1
What does .htaccess do?
Posted: Thu Mar 30, 2006 10:10 am
by gfroyle
Installed serendipity on a multi-user system where I do not have root privileges, and unsurprisingly got an "internal server error" immediately after it said "successfully installed".
Checked the web logs and got the message
.../serendipity/.htaccess: DirectoryIndex not allowed here, referer ...
I searched around a little, and believe that I have to ask my sysadmins to change the Apache configuration ... but they will ask why, and given that the page
http://httpd.apache.org/docs/2.2/howto/htaccess.html
essentially says "do not use .htaccess files unless you have to" they will undoubtedly ask me to make a case for why they should allow me to.
But I don't even know what the purpose of that file is - the Apache docs mentioned above say "permit per-directory configuration options" but I would like to explain WHY I need to do this configuration to install s9y.
Thanks in advance.. apologies if this is answered elsewhere, but I couldn't find it easily.
Gordon
Re: What does .htaccess do?
Posted: Thu Mar 30, 2006 12:50 pm
by garvinhicking
Hi!
Usually, s9y tries to detect if a .htaccess file can be put online and then chooses the right method for "URL Rewriting". Maybe you changed it from "None" to "Apache Errorhandling" manually?
The .htaccess file is required if you setup URL Rewriting to use "Apache Errorhandling" to create pretty URLs like "/archives/1-my-entry.html" instead of "index.php?/archives/1-my-entry.html". Also .htaccess is used to restrict some people viewing files from your s9y installation.
This usually does no harm, and you can remove the .htaccess if you have problems. But you cannot then use the pretty URL feature.
HTH,Garvin
Re: What does .htaccess do?
Posted: Thu Mar 30, 2006 1:21 pm
by gfroyle
garvinhicking wrote:Hi!
Usually, s9y tries to detect if a .htaccess file can be put online and then chooses the right method for "URL Rewriting". Maybe you changed it from "None" to "Apache Errorhandling" manually?
I tried to do a "Simple Install"...
All I did was
- download and untar, unzip the package
- move it under my own Web area (on the multiuser system)
- change to world-writable
Then I just went to the serendipity directory with my Web browser.
It reported on our installation - mostly OK, but with a couple of things not present (mbstring, ImageMagick). Then I chose Simple Install.
Next page I typed in the details for my mySQL database - name, password and so on and then went to the next page.
It said "Serendipity installed successfully" and had a link that said something like "Welcome to your new blog" (or maybe "click here for your new blog").
Clicked and immediately got "Internal Server Error".
So I did not make any choices.. I just accepted all the defaults.
As I mentioned, I checked the error logs and saw the error message...
I have subsequently checked with our sysadmins and they confirmed that our Apache server is configured to IGNORE all .htaccess files.
So do I need to convince them to change this? Or can it run in some alternative mode?
Cheers
gordon
Posted: Thu Mar 30, 2006 2:31 pm
by judebert
Try going to yourdomain/serendipity_admin.php and logging in. Then you should be able to check the Configuration screen and change the URL rewriting to "none". Let us know what it was beforehand, so we can check the installation logic.
Re: What does .htaccess do?
Posted: Thu Mar 30, 2006 2:32 pm
by garvinhicking
Hi!
Okay, I think the issue would be that you chose the simple installation instead of the detailed expert installation. That's all right for you, and we developers will need to inspect why the .htaccess problem was not properly auto-detected.
Now, if you want to use "pretty URLs" you would need to convince your admins to allow .htaccess files. If you can live with the "unpretty URLs", you can just delete your .htaccess file and be happy without it
HTH,
Garvin
Posted: Thu Mar 30, 2006 3:17 pm
by gfroyle
judebert wrote:Try going to yourdomain/serendipity_admin.php and logging in. Then you should be able to check the Configuration screen and change the URL rewriting to "none". Let us know what it was beforehand, so we can check the installation logic.
Unfortunately I have already been to that screen poking around, so I am not sure about what it originally said..
However it seems that the mere existence of an .htaccess file causes the webserver to spit out an error; so I was incorrect when I said it ignored it - instead it actually generates an error message and stops.
But I think that I will be able to get the sysadmins to configure the server to respect .htaccess files for my directory, so I will reconfigure to the default..
Thanks for your help..
I am enjoying playing with s9y already..
Cheers
Gordon
Contents of .htaccess
Posted: Wed Apr 12, 2006 11:07 am
by chuckwilliams1
I have a similar problem where I did a simple installation and s9y couldn't write .htaccess. My host told me I can write it myself. So what should I write to my .htaccess file?
Re: Contents of .htaccess
Posted: Wed Apr 12, 2006 11:21 am
by garvinhicking
Hi Chuck!
That depends on the URL Rewriting method you chose. If you have no URL rewriting, you don'T need a .htaccess at all.
With Apache Errorhandling, it needs to contian the directive "ErrorDocument 404 /index.php".
With mod_rewrite it contains many values, that s9y needs to write. For that you need to just create an empty .htaccess file, make it world-writable, run the s9y installer and toggle the URL rewriting to "none" and then to "mod_rewrite" back again, this will re-write the .htaccess file.
Regards,
Garvin
Posted: Mon Jul 17, 2006 3:03 am
by mikeh
I just had the same thing happen to me.
That is:
download the 1.0 pacakge; untar; run the installer; setup without error.
Then click on go to your blog link and get the apache internal server error.
Look in the error log and found the actual error: " DirectoryIndexnot allowed here"
After looking around the forum for a second my brain kicked into gear and it dawned on me what the real erorr is:
The .htaccess file that was installed has a line of
DirectoryIndex /serendipity/index.php
but the "DirectoryIndex" apache config command is only allowed in an .htaccess file if the master apache config file has an
AllowOverride Indexes This is not the usual case.
In my case I already have "index.php" as a standard index file in the main configuration file so simply commenting out this line fixed the problem.
If your config file does NOT have index.php then you will want to put it there or allow Indexes as an option in the .htaccess file.
I might have solved it
Posted: Thu Aug 23, 2007 8:40 am
by BobMallett
Hi,
I tried deleteing the .htaccess file which jwas created and ust had the 404 DirectoryIndex directive and ran the install again. I then created a new empty version and made it writeable. Ran the simple install and made it to the completed page. .htaccess now contans
php_value register_globals off
php_value session.use_trans_sid 0
All looking good so far. Will post again if there are any more problems. I have to say the install has been problematic for me on both occasions but once it's running it is very nice, easy to use and robust. Keep up the good work.
