I try to configure a fresh installation of drupal-4.7.4.tar.gz and get the message "The requested URL /admin/settings was not found on this server" when I click the link "Run the clean URL test". The server runs Gallery2 and s9y too and I don't have problems with mod_rewrite.

Indeed there is no directory admin at my drupal-directory, and there is non in drupal-4.7.4.tar.gz.

Thanks for your help.

Comments

cog.rusty’s picture

I think the key problem is that this error message does not come from Drupal itself (as it should). It is essential for Drupal to handle the 404 messages with its own index.php.

Does Drupal's .htaccess exist? Is it modified?

linuxuser’s picture

In my "top"-directory, there is no .htaccess. The only hidden file is .ftpquota. Maybe the error doesn't come from drupal, but

grep -r "admin/settings"

shows a result, so the php-code searches for something which doesn't exist.

cog.rusty’s picture

grep found the "admin/settings" string in some drupal files. How is this relevant?

-----

Edit: To explain this a little better:

Without clean URLs, you request yoursite.com/?q=admin/settings
- The web server goes to /, invokes Drupal's index.php, which handles the query string and everything is OK.

With clean URLs, you request yoursite.com/admin/settings
- The web server tries to go to /admin/settings and just gives a 404 error page. Drupal never gets a chance to look at this.

This is where Drupal's .htaccess comes into the picture, with its redirects and its error handling. It hands the request over to Drupal's index.php. If you can do that in another way, for example in apache's configuration, then no problem.

linuxuser’s picture

What do I have to do, that drupal writes a .htaccess-file. I found a .htaccess-file in a directory file, which I added manually before the installation. The owner of this .htaccess-file is nobody nobody now. Its content is:

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

It would be no problem for me to start the installation again. What could I have done wrong? There was only the directory "files", which I added before the installation, with the rights of 777.

I am not a coder, but I believe, if there is some code which refers to /admin/settings there should be a directory called admin, which doesn't exist here and which should be created by drupal. For a test I added a dir admin with an empty file settings and I get no error anymore, but this doesn't help me with the drupal configuration.

cog.rusty’s picture

Not that one, that is only for the files directories. The .htaccess you want is in Drupal's tarball. You can get it and upload it.

The /admin/settings directory does not really exist. Drupal works with the database, not with stuff in files and directories, so its paths are virtual. Make sure to delete the /admin directory which you created or else Drupal will respect it as a real directory and will have a problem.

linuxuser’s picture

I found the error I made, I moved the files with fish:// without activating hidden files. I installed all new and everything worked fine.

I have a security question. As recommended I created a folder "files" and changed the rights to 777, otherwise I got an error. The .htaccess-file in the directory files contains:

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

ls -l files/
total 12
drwxrwxrwx 2 me me 4096 Dec 20 06:50 ./
drwxr-xr-x 10 me me 4096 Dec 20 06:46 ../
-rw-r--r-- 1 nobody nobody 93 Dec 20 06:50 .htaccess

Is this ok or a security risk, since files is drwxrwxrwx?

cog.rusty’s picture

It is required for all the user files directories that apache (user 'nobody') must have 'write' access. So you can use:

- 777 (directories) or 666 (files) if the owner is you and apache is not in your group
- 775 (directories) or 664 (files) if the owner is you and apache is in your group
- 755 (directories) or 644 (files) if the owner is apache

Of course these write permissions only matter for someone who has gained access to your server's file system.

Also notice that if someone can run their own scripts on your server as user apache (just like Drupal) then all the above permissions are exactly equally safe (or unsafe).