LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2011, 03:23 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
.htaccess question


I have a site hosted with a cheap hosting company and limited control of the site. I need to allow some other users all over the world to have write access to files or complete directories and I have no idea how to do that. Initially I thought I could use "chown" somehow but it looks like it's a no-go with ftp and others.
By default, there is a .htaccess file and a .htpasswd file in the root directory of the site and the hosting company suggested to use .htaccess file with something like below:
<Limit READ WRITE>
AllowUser user1
DenyAll
</Limit>
<Limit READ>
AllowUser user1, user2
DenyAll
</Limit>

I changed the script as follows:
<Limit READ WRITE>
AllowUser user1
DenyAll
</Limit>
<Limit READ>
AllowAll
</Limit>
and put it in a .htaccess file in the directory of user1 but the server does not like something since I inserted that file.

Is it an error in the script or is there more to it than that? Can someone point me to a suitable tutorial or explain what to do?

Thank you for your help.
 
Old 04-23-2011, 04:07 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
talk this over with a person at the HOSTING company
they might or might NOT allow that
it is up to them .
 
0 members found this post helpful.
Old 04-23-2011, 05:41 AM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
As explained, I "talked" to them and I did what they suggested and I get a "500 server error". I was expecting hints on how to use the .htaccess file which they allow since, as I explained, there is one by default when I got the site.
 
Old 04-23-2011, 12:19 PM   #4
Bodi
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Rep: Reputation: 2
Hi,

In order for a user to have write access to certain files, the files must have certain ownership and permissions. You can do that with chown, you will have to connect to your server with SSH to do that, not with FTP. If you are on a windows you can use Putty, to connect via SSH.

Possible reasons for 500 error caused by an htaccess file are actually a LOT. You better speak with your hosting company, as they are familiar with the environment settings that they have.

I will quote you a couple possible reasons for this :

Quote:
Incorrect file/directory permissions: 766 or 777.
The webserver does not process php/cgi scripts with higher permissions than 755. Change the permissions of your file/directory to 755 in order to solve this issue.

Incorrect Apache directives inside .htaccess file.
In case custom Apache directives have been added to the .htaccess file, the Internal Server Error means these directives are either not supported and should be removed or are incorrect and should be re-written.

Php directives set in the .htaccess file instead of the php.ini files.
All custom php settings (e.g. php_flag) must be placed inside a php.ini file. For each separate directory you should create its own php.ini file.
If your hosting company gives you access to error logs, you can check for a more specific error, explaining the problem. ( If your company uses CPanel, you have access to an error log there)

Are there more htaccess files on the server ?

Quote:
<Limit READ WRITE>
AllowUser user1
DenyAll
</Limit>
<Limit READ>
AllowUser user1, user2
DenyAll
</Limit>

I changed the script as follows:
<Limit READ WRITE>
AllowUser user1
DenyAll
</Limit>
<Limit READ>
AllowAll
</Limit>
Is this everything which is specified in the htaccess ?
 
1 members found this post helpful.
Old 04-24-2011, 08:57 AM   #5
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you Bodi.
There was only a .htaccess and a .htpasswrd file, each with standard directives from the host in the root directory when the host set up the site. I found the host does not allow "chown" and suggested to use the directives you mentioned. I tried that and a few others after having created a .htaccess in a subdirectory after I had created a user for this purpose and all gave a "500 server error" even the example supplied by the host (after changing "user1/2/3" of course) this was the only .htaccess file I created and there is no other directive in it. I even tried a simple directive by its own which prevents execution of scripts and should not be vetoed and the result was the same.

So I thought I should make sure the scripts should work and ask the experts.

Last edited by rblampain; 04-24-2011 at 09:00 AM.
 
Old 04-24-2011, 10:00 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

There are no READ WRITE request methods nor "AllowUser user1" and "DenyAll" directives". That's why you get a 500 error.
You can use authentication and based on that allow users to GET or PUT stuff:
Code:
AuthUserFile /path/to/.htpasswd
AuthName "Whatever"
AuthType Basic
<Limit POST PUT DELETE>
Require valid-user
</Limit>
<Limit GET>
Allow from all
</Limit>
Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess question comptech520 Linux - Newbie 18 11-20-2009 11:52 AM
.htaccess allow question?? eagletalontim Linux - Security 4 04-23-2006 01:07 AM
.htaccess question kidestranged Linux - Software 0 03-08-2005 11:57 AM
.htaccess Question tommytomato Linux - Security 2 06-14-2004 11:37 AM
.htaccess question djthewombat Linux - General 1 10-21-2002 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration