Jump to content

Solved: Proper folder/file permissions


Recommended Posts

I have a question regarding proper permissions during/after installation.

 

I've uploaded the zip package for 1.5.6.2 and unzipped via SSH. I noticed that all folder permissions are all set to 700 and all file permissions are set to 644.

 

Obviously to reach the installation page, I need to change some permissions. My question is what exactly should I change to 755 for installation? Do I change just the /install folder to 755? Or do I change everything inside that folder to 755 also?

Do I need to change permissions on any folders or files in the prestashop directory AFTER installation?

 

I've done some googling and the explanations I found weren't very specific other than to say 'change folders to 755', but they don't specify exactly which folders, or what permissions should be for files inside those folders. Some clarification would be awesome.

 

Thanks.

 

 

Edited by waterworks2 (see edit history)

Share this post


Link to post
Share on other sites

Thanks for the good info vekia. So I am trying to get to my install page and still getting the 403 error.

 

I have set permissions on the /install/ folder to 755 along with all the folders/files within it. However, I still cannot access the install page. What other folders do I need to set to 755 during install? Currently all other folders are set to 700 and all other files within those folders set to 644, which is how they appeared when unpacked from the original zip file for installation.

 

I am using Bluehost.

Edited by waterworks2 (see edit history)

Share this post


Link to post
Share on other sites

You can try a chmod -R 755 /var/www  to change the permissions recursively inside sub folders also. You said you have ssh into the server so i assume you have root access? Or some kind of direct command line access? Usually , to access the install page, these permissions are enough. Its later on during the installation that prestashop will warn you with not enough permissions. Maybe you havent copied over the files properly from the unzip?

Edited by indus (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Yes, I'm using SSH and I have root level access. I used filezilla ftp program to upload the zip file. Then I used SSH program PuTTy to unzip. Things went good there. Then I changed permission on the /install/ folder to 755 only and also all the files inside of that folder. However, I did not touch the rest of the prestashop files/folders.

 

I tried your command and it worked great.So the way I understand it then, ALL folders in the prestashop zip file need to be set at 755 along with the files inside in order for installation to work.

 

Thanks.

Share this post


Link to post
Share on other sites

Actually, here is a better command, since the above sets file permissions also to   755 which isnt really needed.

 

Once you enter your web root, for example /var/www .,

 

Type this :

 

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;

 

So it will set the appropriate permissions for files and folders. It will take a few seconds to finish.

 

Now the good thing about most good shared hosts is, they auto set file and folder permissions to the above settings usually. But with your own VPS , you have to be a bit more careful.

Edited by indus (see edit history)
  • Like 3

Share this post


Link to post
Share on other sites

Ok thanks thanks for the feedback guys. Great stuff!

However, I am still a bit confused on which folders should be set to what AFTER installation.

 

So I've successfully installed Prestashop. It's working good. But now do I change the permissions on ALL folders back to the 755 and files to 644? I just want a secure shop that runs good.

 

Of course this is just a test run of Presta so I can practice with it and get familiar with all of it's features. So far I'm really liking the admin area. Clean and organized which is nice.

Edited by waterworks2 (see edit history)

Share this post


Link to post
Share on other sites

  • 5 months later...

Do you know if there's an issue setting directory permissions to 765 instead of 755?  I want to use vsftp and add the user FTPing to the www-data group vs. setting ownership to the user.

Share this post


Link to post
Share on other sites

I have tested extensively using 775, and it works great.  775 allows the group owning the folder to read/write/execute but prohibits anyone else.  You need to add the user to www-data via ssh: # usermod -a -G www-data yourftpuser.  Verify the group membership, #id yourftpuser.  Verify the ownership of the folder #ls -l.  Try your FTP.  Good luck!

Share this post


Link to post
Share on other sites

  • 1 year later...

I really appreciate this thread!  I have a situation where I needed to install an ancient copy of Prestashop.  The default permissions that Prestashop set are wacky and all needed to be changed.  Running a custom command in WINSCP worked.  It's all about:

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;

Thanks indus!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More