.htaccess solution to increase upload file size does not work

Re: .htaccess solution to increase upload file size does not work

by Helen Foster -
Number of replies: 33
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Josep,

Please note that a server re-start is required for the changes to take effect.
In reply to Helen Foster

Re: .htaccess solution to increase upload file size does not work

by Josep M. Fontana -
Wow!! Does this cat ever sleep?? smile
This is amazing, Hellen. It's 11.30 at night. I post this request for help and I get a response in about 5 minutes. There is no company in the world that could offer this quality and speed in customer support!

By the way, how do you re-start the server (we have a LAMP server). I'm looking at the man pages but I cannot find the command to re-start the server.

Thanks a lot!

Josep M.
In reply to Josep M. Fontana

Re: .htaccess solution to increase upload file size does not work

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Your questions are just too enticing to resist! tongueout Also, you always say thanks so nicely. smile

Sorry I can't advise on re-starting the server, though perhaps this link may help: http://www.slvbocs.org/apache/htdocs/manual/stopping.html
In reply to Helen Foster

Re: .htaccess solution to increase upload file size does not work

by Josep M. Fontana -
Well, this is one of those "vicious circles". If you help in such a nice way, how else am I going to thank you? smile

Thanks for the link. It occurred to me to google for an Apache manual and I found information about the command to restart the Apache server. Since we have Apache 2.0, it seems that what I need to do is: apachectl -kill restart

However, when I do so, I get the message "bash: apachectl: command not found"

Oh well, I'm stumped. I'll send a message to the server administrator. People working on a project in our Moodle site needed to upload files bigger than 2M and for security reasons, the university does not allow them to access the server via FTP. I was trying to get around the problem as soon as possible but come to think of it they won't be working much during the weekend.  I think it is time to go to sleep.

Many thanks, anyway. I wish I could send you some scrumptious cat food smile

Josep M.

In reply to Josep M. Fontana

Re: .htaccess solution to increase upload file size does not work

by Ray Lawrence -
Hi Josep,

I've managed to get this to work OK without a server re-start.

Heres an example from a .htaccess file currently in use - 20 MB

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

Ray
In reply to Josep M. Fontana

Re: .htaccess solution to increase upload file size does not work

by Tim Allen -
Hi Josep,

Maybe the apachectl binary is not in your path, so it can't be found.  Do a search to find where it is and then issue the command with the full path:

[root@tim /]# find ./* -name apachectl

./usr/local/apache2/bin/apachectl

Mine is there but if you installed via the RPM then it is usually at /usr/bin/apachectl

If so you would do:

/usr/local/apachectl restart

Also if you are using a redhat based distro like Fedora you can do:

service httpd restart

which is a nice shorthand



Another possible problem is that you have not enabled overrides in your apache configuration file httpd.conf.  The .htaccess file only works if you have enabled it there:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

If "AllowOverride" is set to none as above then the .htaccess file will not be enabled and will thus not work.

Hope this helps,   smile
Tim

In reply to Tim Allen

Re: .htaccess solution to increase upload file size does not work

by Josep M. Fontana -
Well, thanks everybody!

I first tried Lawrence suggestion but it didn't work. I think it makes sense that it didn't work because the only difference was that I wrote '20M' (which should be acceptable) as opposed to '20971520' as he suggested.

Now I know why it must not be working. As Tim warned, in my httpd.conf AllowOverrride is set to None. What I'm not sure about is whether I should switch 'None' to 'All' or to "any combination of the keywords: # Options FileInfo AuthConfig Limit". I understand what 'All' does and I'm not sure whether this is what I want to do (a little scared of screwing up things for other people who use the server). But I don't understand what the other options or combinations of options would do.

Also, one thing that is not clear to me is whether restarting Apache is needed whether one takes one route or the other to increase the allowed upload size (via modifying .htaccess or via modifying php.ini). I suppose in my case, since I will have to modify the httpd.conf file, I will have to restart Apache anyway if I want the changes to apply. But if AllowOverrride had not been set to None, would I still have to restart Apache?

I'm asking all this so that if in the future I (yes, knowing myself I know in a few months I could be in the situation of having to ask the same question again: my memory is like the memory of that lady fish that accompanies Nemo's father in his quest for his lost fish son blush) or somebody else is inquiring about this subject, it is much easier to decide which route to take. It seems to me that, all things being equal, using the .htaccess solution is simpler and safer.

Josep M.
In reply to Josep M. Fontana

Re: .htaccess solution to increase upload file size does not work

by Tim Allen -
Hi Josep,

To change PHP settings in a .htaccess file (it can also be done in the httpd.conf file), you need:

AllowOverride Options

(http://www.phpbuilder.com/manual2/manual/fi/configuration.php)

If you are using Apache 2, also check to see whether there is a LimitRequestBody directive in httpd.conf, and if there is make sure that it is not less than the maximum upload file size you want (or set it to 0 which means no limit).

I'm pretty sure that you need to restart the apache server whenever your change a .htaccess file. Part of the logic of this is that everything you can do in an .htaccess file you can also do in a directory container within the httpd.conf file - so if you have to restart apache when changing the latter, then I think the same would apply when changing the former.

Hope this helps,
Tim.
In reply to Tim Allen

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
Hi Tim.
Well, your instructions were correct but I managed to screw up really bad.

OK, I did what you said. I managed to locate the folder were the binary 'apachectl' was. I did [root@parles bin]# ./apachectl restart and it worked. I went to the Moodle administration > variables page to increase the limit and indeed I noticed that I could increase it beyond 2M. However, the maximum sice that the menu allowed was 8M.

I went back to the .htaccess file to check that I had set the appropriate size and I simply wrote the following.

php_value upload_max_filesize 20M
php_value post_max_size 20M

Before I had the lines suggested by Lawrence:

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

I know it shouldn't matter which option you use, but I changed it any way.
I went back to the directory with the binary 'apachectl' and issued the command ./apachectl restart again. And then is when things went gad. When I went back to the Moodle administration page, I got the following horrible message:

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@parles.upf.es and inform them of the time the error occurred, and anything you might have done that may have caused the error.


Can I get out of this awful mess?? My students and the students from other courses in this Moodle installation are supposed to be working using Moodle during this weekend, and because of my impatience I managed to screw things up. What did I do wrong? How can I fix this?

Josep M.
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
OK, I did what seemed to be logical and I managed to get out of the mess. I went back to httpd.conf and I reset AllowOverride back to 'None' (instead of 'Options'). This seems to have solved the problem because now the server is working again. Ufff!!

I also managed to figure out why I had the 8M limit. In php.ini I had changed upload_max_filesize from 2M to:

upload_max_filesize = 20M

But looking into the code, I noted that I had forgotten to modify
post_max_size = 8M

I changed that value to 20M and now it works.

So this will solve the problem for now. I'm not totally satisfied, though, because I would have liked to use the alternative involving the modification of .htaccess so that the increase in the upload file size limit affected only that particular Moodle installation.

Do you have any idea of why I got the 500 Internal Server Error when I set AllowOverride to Options?

Well, in fact, that cannot have been the problem because, as I said, the first time I restarted apache the line AllowOverride Options was there in the httpd.conf file and everything was OK. The only problem was  that the  maximum allowed size was  8M.

Josep M.
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
I've spent the last hour trying to figure out what might have happened and the only thing that occurs to me is that I might have modified the wrong AllowOverride (I notice that there are several). Below is the part of the httpd.conf file that I have modified (the relevant lines are in red). When I change 'None' to 'Options' I get the server error message I mentioned before. I'm also including the .htaccess file I'm using just in case but everything looks correct there (at least to my ignorant eyes).

If I replace 'Options' by 'None' again, everything goes back to normal and I don't get the server error messages. So, I guess I've managed to solve the basic problem since I know now I can increase the upload file size limit by modifying the php.ini file, but the initial title of my posting is still valid:
"the
.htaccess solution to increase upload file size does not work (at least for me)"

----------- portion of httpd.conf file -------------------------

<Directory "/extern/web/httpd/htdocs">

# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews
Options +FollowSymLinks
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"

AllowOverride Options
Order allow,deny
Allow from all
#<Files *.php>
# SetOutputFilter PHP
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ups! Where is your .htaccess file? wink

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
Ooops, I would have sworn that I attached it. Well, let me try again. I added a txt extension just in case this was what prevented it from being attached.

Gracias Iñaki.

Josep M.
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Ray Lawrence -
Josep,

This has been a bit of a white knuckle ride. wide eyes Glad you got it back. smile

Ray

a.k.a. Lawrence

In reply to Ray Lawrence

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
Oops, sorry Ray. I was referring to you by your last name blush. Since you have a last name that is so first-namish ... smile.

But yes, that was a real white knuckle ride (a new expression for me, but I think I know perfectly what it means). For a while I thought "that's it, the administrator is going to take away all my privileges and prevent me from fiddling with the server again" (and she'd be right to do so).

Josep M.
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I went back to the .htaccess file to check that I had set the appropriate size and I simply wrote the following.

php_value upload_max_filesize 20M
php_value post_max_size 20M

Before I had the lines suggested by Lawrence:

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

I know it shouldn't matter which option you use, but I changed it any way.

It matters a lot! You can only use the multiplier notation (20M, 10K, etc) in php.ini. You have to use the complete integer value when you do it in .htaccess, etc.

I guess this is where you get you Internal Server Error (when parsing that "meaningless" value).

Saludos. Iñaki
In reply to Iñaki Arenaza

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
But wait, Iñaki, not that I doubt what you say is true because it makes a lot of sense, but Ray in a previous message in this thread says that he has this exact setting and he doesn't seem to have any problems.

Thanks for looking into this.

Josep M.

In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I just got that information from the PHP people themselves: http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
OK, thanks Iñaki. I had misunderstood you, actually. It is obvious that Ray shouldn't have any problem because he used integers in his .htaccess file.

I'm afraid this is not the problem I'm having, though, because I changed the 20M value to integers in my .htaccess file and I still got the error when I restarted the server. You can see that in the file I attached to my previous message. So the mystery still persists.

Josep M.
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ok, as it seems you have control of your apache server, let's try a couple of things.

First, you should check your apache error logs. If you are not using VirtualHost directives for your Moodle site, then have a look at your ErrorLog directive to see where apache is sending all its error stuff. Every time you get an 'Internal Server Error', apache logs the reason it caused the error. So having a look there is always a Good Idea(tm) smile

Second, having read apache docs with more detail, I think you should change your AllowOverride directive to include not onlye 'Options', but also 'Indexes'  (to be able to use 'DirectoryIndex' in your .htaccess file). I'm not sure 'LimitRequestBody' needs and additional AllowOverrie value (the apache docs says nothing about it), but having a look at the error logs should give us a clue.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
Hi Iñaki,

Thanks a lot (eskarrik asko) for helping me with this. Besides solving my problem, I'm learning a lot about the inner workings of the server and hopefully this will make me less of a nuissance in the future and will allow me to help others better.

OK, the first thing I have to say is that I would not have expected that there were soooo many errors going on unnoticed "under the hood". I "mored" the error_log file and it was PACKED with errors. Above all, errors of the type:

[Sat Jan 21 19:41:49 2006] [error] [client 83.41.104.45] File does not exist: /extern/web/httpd/htdocs/moodle/theme/cornflower/images/sideblock.jpg, referer: http://parles.upf.es/moodle/course/view.php?id=22

This made it difficult to mine information that was relevant for the problem we are trying to solve. I searched through the log, and I extracted these logs that seemed to me to be relevant. They don't help ME figure out what the problem is, though smile

[Sat Jan 21 19:46:50 2006] [notice] SIGHUP received. Attempting to restart

[Sat Jan 21 19:46:51 2006] [notice] Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.4 configured -- resuming normal operations

[Sat Jan 21 19:46:59 2006] [alert] [client 212.106.250.198] /extern/web/httpd/.htaccess: Invalid command 'admin:{SHA}Bxu8vZqvMyG7sSWaJ4EzKhvZt+Q=', perhaps mis-spelled or defined by a module not included in the server configuration, referer: http://parles.upf.es/mellange/admin/config.php

[Sat Jan 21 19:47:05 2006] [alert] [client 62.57.25.86] /extern/web/httpd/.htaccess: Invalid command 'admin:{SHA}Bxu8vZqvMyG7sSWaJ4EzKhvZt+Q=', perhaps mis-spelled or defined by a module not included in the server configuration, referer: http://parles.upf.es/moodle/course/view.php?id=6

Errors like the last two are repeated many times (the IP of the 'client' changes, some times it is [client 127.0.0.1]).

Now, there was one particular entry that called my attention:

[Sat Jan 21 20:05:16 2006] [alert] [client 217.172.65.183] /extern/web/httpd/.htaccess: Invalid command 'admin:{SHA}Bxu8vZqvMyG7sSWaJ4EzKhvZt+Q=', perhaps mis-spelled or defined by a module not included in the server configuration, referer: http://by105fd.bay105.hotmail.msn.com/cgi-bin/getmsg?msg=C13E17B5-6B3B-4207-B3AD-2D2F3EF7A23E&start=0&len=7014&imgsafe=n&curmbox=00000000
%2d0000%2d0000%2d0000%2d000000000001&a=bd70b2192a63a5927c44c8539fc2ad537cec98016467cdf94945f30182e8a0dc&curmbox=00000000%2d000
0%2d0000%2d0000%2d000000000001&a=bd70b2192a63a5927c44c8539fc2ad537cec98016467cdf94945f30182e8a0dc

Since in a different thread today, I noticed that I was having problems with users that had a Hotmail account (forum notifications are returned saying that the Hotmail addresses had permanent fatal errors). I wonder whether this error log can help me figure out what is going on (although, its meaning is totally obscure to me).

Finally, the last errors that seem to be relevant are the following. At the end, in red I've marked errors having to do with
'DirectoryIndex', which you suggested could be the origin of the server errors I was experiencing:

[Sat Jan 21 21:26:57 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/phpmyadmin
[Sat Jan 21 21:26:57 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/PMA
[Sat Jan 21 21:26:58 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/db
...and a bunch of other similar lines ending in things like
mysqladmin, mysql-admin, phpMyAdmin-2.5.6, phpMyAdmin-2.5.4, etc (this doesn't seem to be related to the problems we are discussing, but just in case)

[Sat Jan 21 21:31:35 2006] [notice] SIGHUP received. Attempting to restart
[Sat Jan 21 21:31:36 2006] [notice] Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.4 configured -- resuming normal
operations
[Sat Jan 21 21:31:47 2006] [alert] [client 212.106.250.198] /extern/web/httpd/htdocs/mellange/.htaccess: DirectoryIndex not allowed here, referer: http://parles.upf.es/mellange/course/mod.php?id=2&section=4&sesskey=MXmm7MENxC&add=resource&type=file
[Sat Jan 21 21:32:10 2006] [alert] [client 212.106.250.198] /extern/web/httpd/htdocs/mellange/.htaccess: DirectoryIndex not allowed here
...
[Sat Jan 21 21:33:18 2006] [alert] [client 81.43.80.128] /extern/web/httpd/htdocs/moodle/.htaccess: DirectoryIndex not allowed

...

[Sat Jan 21 21:40:00 2006] [alert] [client 127.0.0.1] /extern/web/httpd/htdocs/TEST/.htaccess: DirectoryIndex not allowed here


Does any of this mean anything to your expert eye? Does any of this confirm any of the suspicions you had?

Again, thanks a lot for your time.

Josep M.

In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Tim Allen -
Hmm, your log errors refer to four different .htaccess files, did you notice that?

The first one refers to a .htaccess file in /extern/web/httpd:

[Sat Jan 21 19:46:59 2006] [alert] [client 212.106.250.198] /extern/web/httpd/.htaccess: Invalid command 'admin:{SHA}Bxu8vZqvMyG7sSWaJ4EzKhvZt+Q='

Now this would not have been affected at all by the AllowOverride directive you showed us above which was within a /extern/web/httpd/htdocs directory container (one directory below /extern/web/httpd/.htaccess).

The following ones refer to .htaccess files in /extern/web/httpd/htdocs/mellange, /extern/web/httpd/htdocs/moodle and /extern/web/httpd/htdocs/TEST (why so many?), such as:

[Sat Jan 21 21:31:47 2006] [alert] [client 212.106.250.198] /extern/web/httpd/htdocs/mellange/.htaccess: DirectoryIndex not allowed here, referer: http://parles.upf.es/mellange/course/mod.php?id=2&section=4&sesskey=MXmm7MENxC&add=resource&type=file

These .htaccess files are definitely affected by the AllowOverride values because they are below the /extern/web/httpd/htdocs directory which the particular AllowOverride command you quoted above refers to.

This group of errors definitely refers to the omission of the Indexes value from the AllowOverride directive you showed us. (I didn't know about those other commands in the .htaccess file because in the opening post you only mentioned the PHP lines)

Hope this helps your troubleshooting Josep! smile
In reply to Tim Allen

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
I was trying to answer your message but I encountered some problems with the Moodle HTML editor. I got the following message: "Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved."

Rather than rewriting my message, I'm enclosing it as an adjunt.

Josep M.
In reply to Tim Allen

Re: .htaccess ...HELP, I SCREWED UP :-{

by Josep M. Fontana -
By the way, Tim. I'm curious about something. How did you do it to reference a particular posting in the link you included in your message? I'm referring to the link in " directive you showed us above which..." Up to now, when I wanted to introduce a link to a particular message, I cut and pasted the whole URL for the whole thread because I thought this was all I could do (since I saw no way to figure out what the "anchors" were for specific messages).

Josep M.
In reply to Josep M. Fontana

Re: .htaccess and linking to particular postings

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Josep,

If you display replies in threaded form for this discussion and mouse over all the links you'll find the URLs all start with http://moodle.org/mod/forum/discuss.php?d=38087 and end with &parent=175381 (my reply), &parent=175382, &parent=175383 etc.

Now you've thoroughly discussed htaccess issues, please could you just let me know whether or not a server re-start is required. thoughtful It would be great if you would also consider adding to or editing the limits on uploaded files FAQ in MoodleDocs Administration FAQ. smile
In reply to Helen Foster

Re: .htaccess and linking to particular postings

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The idea behind .htaccess files is allowing you to change your Apache settings (those which can be changed there and you are allowed to, obviously) without having to reload or restart Apache.

That way, any user with write access to those files can change the configuration of that directory (and the ones under it) and apply those changes without needing administrator/root privileges (that you usually need to edit the main apache configuration files, and to reload/restart the service/daemon).

Saludos. Iñaki.
In reply to Helen Foster

Re: .htaccess and linking to particular postings

by Josep M. Fontana -
Hi Helen,

If you display replies in threaded form for this discussion and mouse over all the links you'll find the URLs all start with http://moodle.org/mod/forum/discuss.php?d=38087 and end with &parent=175381 (my reply), &parent=175382, &parent=175383 etc.

Today I had a very hard day. I don't understand what you mean here. I never view the forums in threaded form. I'm a display-replies-flat-with-oldest-first kind of person smile. What is the problem with the URLs?

Now you've thoroughly discussed htaccess issues, please could you just let me know whether or not a server re-start is required.


d
In reply to Josep M. Fontana

Re: .htaccess and linking to particular postings

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Josep,

Sorry for not explaining things well enough. thoughtful You asked how Tim referenced a particular posting. My suggestion to display replies in threaded form was so that you could see the URLs for particular posts e.g. http://moodle.org/mod/forum/discuss.php?d=38087&parent=175381.

I hope this helps. I'm sorry to hear you had a hard day. sad


In reply to Helen Foster

Re: .htaccess and linking to particular postings

by Josep M. Fontana -
Hi Helen,

Not only did I have a hard day but I was also in bad luck. Bad luck because I lost a whole message I had (I swear) posted in the forum. The message you are responding to (where I mentioned I had a hard day) was in fact quite a bit longer. Among other things I said that I would do as you suggested and add the missing info on how to increase the size of uploaded files. But what I see is that not the whole message was saved angry.

Actually, this happened twice during this hectic weekend when I was posting help messages like crazy. I think this happens every time I toggle the HTML source. I seem to remember that this is what I did every time the whole message wasn't saved. Perhaps this is a bug. Can you or anybody who is reading this try to reproduce this problem? I'm using Firefox. After having written something in the WYSIWYG mode, just toggle the HTML source, write some characters in the source view mode (this is important, if you don't write anything and simply toggle HTML source on and off, there are no problems), then go back to the default mode and continue to write a bit more. Post your message and check whether it was saved completely.

Josep M.


In reply to Josep M. Fontana

Re: .htaccess and data loss

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Josep,

I'm sorry to hear you are losing parts of messages. sad Unfortunately I can't reproduce the problem (using Firefox 1.5). However, usually my postings are very short. Generally I'll write a longer posting in a text editor first, then copy and paste it, since there are many causes of data loss on the Internet. thoughtful
In reply to Josep M. Fontana

Re: .htaccess ...HELP, I SCREWED UP :-{

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
[Sat Jan 21 19:46:50 2006] [notice] SIGHUP received. Attempting to restart

[Sat Jan 21 19:46:51 2006] [notice] Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.4 configured -- resuming normal operations

These two are normal. They are a 'notice' (informational message). They tell you that apache was restarted successfully.

[Sat Jan 21 19:46:59 2006] [alert] [client 212.106.250.198] /extern/web/httpd/.htaccess: Invalid command 'admin:{SHA}Bxu8vZqvMyG7sSWaJ4EzKhvZt+Q=', perhaps mis-spelled or defined by a module not included in the server configuration, referer: http://parles.upf.es/mellange/admin/config.php

This is an error in file /extern/web/httpd/.htaccess. Either you or the web server admin put the file there, and it has a mistake. Given the error message, I guess someone has included users and passwords in there (SHA is a common password encoding system this days), when they have to be outside of .htaccess.

As apache opens and reads .htaccess files in each and every directory it walks throught to get to the page it's been asked for, you will see this error for every page you ask.

[Sat Jan 21 21:26:57 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/phpmyadmin
[Sat Jan 21 21:26:57 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/PMA
[Sat Jan 21 21:26:58 2006] [error] [client 66.235.214.152] File does not exist: /extern/web/httpd/htdocs/db
...and a bunch of other similar lines ending in things like mysqladmin, mysql-admin, phpMyAdmin-2.5.6, phpMyAdmin-2.5.4, etc (this doesn't seem to be related to the problems we are discussing, but just in case)

As you guessed, these have nothing to do to the problem we are discussing.

[Sat Jan 21 21:31:47 2006] [alert] [client 212.106.250.198] /extern/web/httpd/htdocs/mellange/.htaccess: DirectoryIndex not allowed here, referer: http://parles.upf.es/mellange/course/mod.php?id=2&section=4&sesskey=MXmm7MENxC&add=resource&type=file

This is the root of your problems (and confirms my suspicions), as Tim Allen already states. Without adding 'Indexes' to your AllowOverride statement, the DirectoryIndex directive is not allowed and execution of the page search halted, giving you the 'Internal Server Error'.

So adding 'Indexes' in your AllowOverride directive should make the problem disapear (as Tim Allen already says).

Saludos. Iñaki.
In reply to Tim Allen

Re: .htaccess solution to increase upload file size does not work

by Josep M. Fontana -
>Maybe the apachectl binary is not in your path, so it can't be found. Do a search >to find where it is and then issue the command with the full path:

>[root@tim /]# find ./* -name apachectl

>./usr/local/apache2/bin/apachectl

Gee, this is more complicated than I had expected. I found not one but several folders containing a binary 'apachectl'. However, I tried to execute both the 'apachectl -k restart' and the 'service httpd restart' commands within each one of these folders and in all of them I got the same (surprising) response: "bash: apachectl: command not found"  or "bash: service: command not found" .

It's been a long time since I've used a Unix system (I did when I was a grad student, and this is a loong time ago smile), but it seems to me that if I have all permissions (I entered with %sudo su root -) and I am in a folder with the binary 'apachectl', I should be able to execute it.

Can anybody see what I'm doing wrong?

Josep M.
In reply to Josep M. Fontana

Re: .htaccess solution to increase upload file size does not work

by Tim Allen -
Hmm interesting...

Josep, it would be helpful if you copied the exact commands you typed in and the output you received, but let me have a guess:


Firstly, forget about the service httpd restart command, if it didn't work then I am guessing that you are not using a Redhat based distro like Fedora.  This command does not come with all linux versions, but apachectl does as it is part of the standard apache server package.

If apachectl is not in your path (you can check which directories are in your path by typing echo $PATH), then once you know where the apachectl binary is located there are two ways you can run it:

give the full directory path as in:

/usr/bin/apachectl restart (this can be done from any directory)

or, only from within the directory in which the apachectl binary is located:

./apachectl restart

Note the dot-slash at the beginning. My guess is that you omitted it and that might have been the problem.

Quotation: "For security reasons the current directory is not in the PATH so to run a program contained in the current directory you must prefix ./ (dot front slash) to the programs name as in:

./command" (http://www.math.mcgill.ca/services/linux_basics.php)

(Also, just to make sure that the permissions are not the problem, have a close look at them).

Tim.