Permissions for websites owned by "admin"

MKTG

Verified User
Joined
May 1, 2010
Messages
16
Hello

I just got a VPS with directadmin which seems a very nice control panel, and pretty easy to use.

Using the admin account (I'll use the VPS to host my own websites so I don't really need resellers and users) I have logged as 'admin' via SFTP into the server and I've uploaded all the files of a website ( it's an empty wordpress cms ).

In case you don't know when you setup Wordpress it creates a config file, hence it needs writing permissions.

All the files have permissions set to 664 and are owned by admin:admin , but I get this message: "Sorry, but I can't write the wp-config.php file."

What am I doing wrong? Do I need to create resellers and users and login as user in order to have the files permissions work?
 
All the files have permissions set to 664 and are owned by admin:admin , but I get this message: "Sorry, but I can't write the wp-config.php file."
If youre using mod_php, you need to chmod that file to 777...... let the installer do its stuff then chmod it back to 664...... If you are using php as cgi, then it should work regardless of file permissions.
 
thanks for the replies

the directory /home/admin/domains/domain.net/public_html/ is owned by 'admin', I even tried to create an end user and upload the files using that user. These files show as owned by "ftp" and group "ftp"

The phpinfo output says "Server API:Apache 2.0 Handler ", instead other 2 shared hosting plans that I use (and where I have never had such problems) show "CGI" and "CGI/FastCGI"

I didn't find anything in Directadmin related to the PHP execution mode, can I do this myself modifying php.ini or do the entire apache/php packages need to be reconfigured?

How are usually set up DirectAdmin servers for shared hosting? Mod_php, CGI, FastCGI? It's important for me to be able to perform installations ( writing files ) with no need to manually edit permissions etc, and these wordpress installations will need to write to files even after the installation.

Should I ask my provider to reconfigure php to run as cgi/fastcgi? If yes, which one?
 
Hello,

I'm not too sure about the permission set to ftp:ftp, as nothing we have uses those permissions (perhaps that's something different with sftp vs ftp?)... however assuming your sftp account used the "admin" permission, then the files would be owned by admin.

As for running a php script and having it write to disk, as mentioned, you'd either need to set them to 777, since php would run as "apache".

The other alternative is to change php to run using suPhp (cgi). This lets php scripts run as the user, eg "admin".
http://help.directadmin.com/item.php?id=197

John
 
John and others:

Standard linux ftp clients show ownership as ftp:ftp whenever you use a linux/unix ftp client (Microsoft clients don't care). But when you look at them in either a shell login or through the DirectAdmin files system you'll see the ownership is correct, based on whomever uploaded them, and the permissions are whatever the default is for the directory in which they're being uploaded. Some helpful information here.

Jeff
 
so I asked my VPS provider to configure PHP with suPHP, they recompiled it and now everything is working like a charm ( at least for what I've seen doing some basic stuff)

Connecting via SFTP, files are shown as owned by username:username
Connecting via FTP as 'username' I get ftp:ftp

FTP Client: Filezilla on Windows

Just to clarify: this issue was resolved with suPHP
 
well sure it could have been fixed changing permissions as you previously suggested, but these websites will need to be able to write files even after the installation everyday for as long as they stay online.

I'd have needed to leave these files with 777 permissions being more prone to vulnerabilities and attacks of any kind, which doesn't sound smart to me, especially using a popular cms as wordpress.

I'm not a server administrator, this is just what I suppose.
 
Back
Top