I'm trying to move Drupal from a shared sever to a VPS. I'm getting 12,000 page views a day with 1,200 visitors.
I installed Drupal as normal onto the shared server and built it from there. I didn't need to change any file permission to make it work. It automatically changed the config.php permissions for me.
When I moved to the VPS, Drupal started to throw errors that it couldn't write to certain files. After four days of looking I found an answer in the install.txt file. So I followed the instructions and chmod o+w sites/default/filesphp . Now my sites/all/default/files is set at 757 which doesn't make much sense to me. Why isn't it set at 755 like it is on the shared site and Drupal (or Apache) write the files as owner?
How do I change Apache to recognize Drupal as the owner?
I have access to apache.conf on the VPS so how do I configure apache to run as the user I created in the WHM panel?
Comments
The drupal files, are they of
The drupal files, are they of the right user and group? You can check this with following ssh command:
ls -lIf it isn't the user and group needed, you can give them a other user and group with doing following command logged in as root:
chown -R username:groupname /path/to/your/drupal/rootfolderI used cpanel restore
I used cpanel restore function to put the files onto the VPS server so the usernames and group names are the same as on the shared server. Is it possible that the users have the same name but different user numbers? I don't know.
After uploading/unzipping
After uploading/unzipping drupal, using the SSH command: LS -L you should be able to see that the chown 'user' and 'group' permission for all files and directories are the user name for the account eg. USER USER. However, the permissions for file & folders that drupal creates will be: NOBODY NOBODY. As you are logged in as USER, you cannot edit/delete/chmod these.
Although it looks like a chown problem, probably what is actually wrong is that your shared server had phpSueExec installed, whereas your VPS will probably comes without it installed (because it takes up memory and sometimes has incompatibilities with older, legacy scripts). Without phpSueExec, drupal will not be able to write to folders/files with 755 permissions. phpSueExec will also fix the problem of drupal creating files with nobody.nobody chown.
Assuming you have a WHM/CPanel VPS, you can check for it by going to WHM -> Service Configuration -> Configure PHP and SuExec. You should see 'suphp' listed and 'Apache suEXEC on' if it is installed.
If not, phpSueExec is installed via WHM -> software -> easyapache. You have to recompile apache. If everything goes ok, it is fairly easy. If things don't go ok, it can difficult and time-consuming to troubleshoot (and frightening if you're a noob like me). If your host will do it for free, you might wish to ask them. I'd only do it yourself if you want to learn more about your VPS and become more competent.
here is my solution: sudo
here is my solution:
sudo a2enmod rewrite
and in etc/apache2/sites-avialable/default
allowoverrid all