Tim Baas
Tim Baas

Reputation: 6185

How to upload a site to a server where folders are writable for php

This problem occurred to me multiple times now, and it's time for me to do it the right way!

How can I upload a website to the server, where php has access to the folders for writing data.

Usually I use an FTP program, but I can't upload as root, so there are restriction problems all over the place...

How do you do stuff like this?

Thanks!

EDIT

I'm sorry, I accidentally added rails to the tags instead off php.

Probably I need to clarify my problem, since the answers didn't really help me out here:

I already have a server running apache, DirectAdmin and some other stuff like rails.

And the problem is when I upload a website like joomla or wordpress via FTP the restrictions always need to be set to 777/775 or these sites can't write to the folders..

So what I need to know is: How can I upload these sites (via FTP/SSH) as a user (root) that is the same as php, so that php can create files in all folders it needs to write to?

Hope I'm being more clear now, thanks for the help so far!

Upvotes: 1

Views: 233

Answers (2)

Tim Baas
Tim Baas

Reputation: 6185

The solution

  1. Upload your site with FTP

  2. SSH to the server and go to the public_html folder

  3. chown -R [user_name]:[group_name] [folder_name]

For me the right user was apache..

Upvotes: 0

smathy
smathy

Reputation: 27961

Use a server with ssh access and full write access to wherever your Rails app is hosted (and usually ssh access is as the user that Rails runs as).

For me this usually means a VPS type server, I like Rackspace Cloud which turns out to be around $11 - $15 per month for a low traffic, low spec server. I've also heard good things about Linode

Upvotes: 1

Related Questions