Announcement

Collapse
No announcement yet.

Install file permissions for linux running FastCGI / SuPHP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Install file permissions for linux running FastCGI / SuPHP

    The following only applies to those running SC development software on a linux server.

    I have FastCGI setup on my server. This is becoming more common with other Cpanel webhosts like BlueHost or HostGator. On FastCGI systems all folders have permission 755 and files are set to 644 permission with the exception of executable files such as .so, .pl etc.

    You never need permission 777 for folders on systems running php as FastCGI since on Cpanel scripts run as the actual Cpanel user instead of "nobody". This really simplifies things in my opinion.

    I'm writing this because it may help someone on the same setup.

    The problem is a lot of zip install packages with have file and folder permissions set when you extract them. I've had this issue with zip install packages for linux from SC and others. The result is a lot of folders with permissions set to 777 and php files set to 755 when you extract. These permissions will not run on FastCGI at all and will generate a server misconfiguration error.

    There are a couple of ways to handle this.

    1. extract all files from the zip file on your computer and upload them by FTP to the server. Typically the correct permissions for folders and files will be set as they are uploaded. (this can take forever with SC btw)

    2. A faster way is to upload the zip file, extract it on the server and use Filezilla to set the correct permissions for folders and files. Once the files and folders are expanded on the system open Filezilla and FTP to the site. Right click on the directory that has the installation with the messed up permissions after extraction. Choose "File Attributes" from the pop open menu. Near the bottom of the menu that opens you will see the option to "Recurse into subdirectories". Enter 755 into the permissions box, check the Recurse option and choose "Apply to directories only". Once filezillia is done (can take a while), repeat the process but this time set permissions to 644 and choose the option "Apply to files only".

    Now you have one more thing to do. With SC there are executable files located in devel/lib/third/zend. All of the files in that directory need to have permissions 755 to execute.

    Last word: I've had permission issues on FastCGI with SC fresh install packages. But worst of all is this also sometimes happens with auto-update right from SC. The last time this happened I spent most of the day trying to get back up until I figured out that it was a permission issue, the one that really threw me as finding the executable in the zend folder.

    BTW, if you have shell access (SSH) you could do the same thing faster through command line. A lot of people are on shared hosting running FastCGI and I wanted to cover how to do this without SSH access.

    I'm hoping that this helps some one.
    Latest version of Scriptcase updated regularly. Hosted on my own Cpanel server running php 5.4x and Centos. Use latest version of Firefox for development browser.

  • #2
    Thanks for sharing. It is much appreciated.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      You are welcome. Hope it saves some others trouble.
      Latest version of Scriptcase updated regularly. Hosted on my own Cpanel server running php 5.4x and Centos. Use latest version of Firefox for development browser.

      Comment


      • #4
        Quick one please. Does this still apply with Centos 7? Or are there still other things to set?

        Comment


        • #5
          Muy buen aporte para los que hemos tenido estos problemas de permisos y modos de ejecuccion del servidor.

          Comment

          Working...
          X