[proftpd and chmod]

Titam

Verified User
Joined
Apr 29, 2005
Messages
168
Hi,

First, sorry for my english, i'm french.

Well, DA is installated on my dedicated server. All works fine except one thing and i don't understand.

When a user upload a file on the server via FTP, owner is the users, and chmod is 755. It's good BUT

I tried to install mambo (CMS) and there is this message :

administrator/backups/ Unwriteable
administrator/components/ Unwriteable
administrator/modules/ Unwriteable
administrator/templates/ Unwriteable
cache/ Unwriteable
components/ Unwriteable
images/ Unwriteable
images/banners/ Unwriteable
images/stories/ Unwriteable
language/ Unwriteable
mambots/ Unwriteable
mambots/content/ Unwriteable
mambots/search/ Unwriteable
media/ Unwriteable
modules/ Unwriteable
templates/ Unwriteable


And i don't understand why ... in fact, with different test, for mambo sees "Writable", i have to chmod my files 777 ... and you will agree with me, it's not possible ...

Anyone have an idea ?

Thanks, and sorry again for my english.
 
Those directories/files will need to be chmod 777 (at least as long as the application is going to write to them).
This is because the scripts are running as apache instead of the user.
The only way around this, where you won't have to chmod 777 them, is to install suPHP or similar which will make php script run as user instead of apache.
 
What is the best ? Let files like this and chmod 777 when asked or install suPhp ? Your mind ?

Thanks for your reply :)

<nb inside ^_^>
 
suPHP is more secure. However files usually only need to be chmod 777 while their being written to (i.e. writing initial configuration).
The other con to suPHP is it requires more installation and configuration and can cause problems with other software, such as installatron.
 
We manage Mambo as installed by Installatron on recent versions of DA. The OS in this case is RHL 7.3.

The problem we see is that new directories are written by Mambo as the apache user and we need them to be owned by the user.

So we create the following cronjob as root:

*/10 * * * * chown -R username:username /home/username/domains/domain.com/public_html/*

where of course username is the domain's username and domain.com is the name of the domain.

This makes sure that every ten minutes the new directory names are renamed as required by Mambo.

From your example, this may not be the problem you are having, but this is our problem.

Jeff
 
I'd like to do just the opposite.
Certain files are owned by the user, but they must be owned by apache.
What cronjob would I need to create to do that?
 
If it's for all files, then the above, with the username you want (apache?).

But if not all files, well then how I can I write a crontab that reads your mind?

:)

Jeff
 
No need to read my mind. All files must be owned by apache. That way, the user can manage everything through his CMS.
thx, I'll give it a try.
 
It's been a while since I tried this, but never got it working. I'm doing a new attempt at this :)
I made a script called, test.sh
In it I have this line:
chown -R username:apache /home/username/domains/mydomain.com/public_html/folder/subfolder/*

I added this script to my cronjobs
the command is added like this:
1 * * * * /home/username/test.sh

Yet, the owner of the files in subfolder (username) isn't changed to apache after a minute.
What am I doing wrong? :confused:

After this (if it works), I suppose apache will own all files in subfolder.
Who will own subfolder (the folder itself)? apache or username ? (apache must also own subfolder in my case)
 
Last edited:
When we've created similar cronjobs we've always run them as root.

Jeff
 
Our clients don't either; they write us and ask us to set it up, and we do.

Jeff
 
Back
Top