Make all website directories writable (by default)

Discussion in 'Installation/Configuration' started by mgibson, Apr 22, 2009.

  1. mgibson

    mgibson New Member


    Is there a way to make all site directories writable by default instead of chmod 777 everytime?

    My scenario is - joomla.

    - A new domain, ftp user & mysql db will be created through ISPConfig3
    - Joomla is uploaded via ftp to the /web folder.
    - The Joomla setup is ran, and cannot write a configuration file in the root directory (/web).

    Can this be done?


  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The directory permissions are all fine, there is no need to set them to 777. You just used the wrong php type. For joomla you will have to use either suphp or php-fcgi + suexec so that the php scripts run under the correct admin user of the website user instead of the apache user.
  3. mgibson

    mgibson New Member

    I thought it might be something silly but couldn't figure this out.


  4. tebokkel

    tebokkel New Member

    Simple cron-job could do the trick, but messing around with world-writable rights by a knitwit admin was once the cause I managed to get myself root-rights to get my email going again. :cool:
    Even world-readable is basically dangerous on a shared server. Database passwords in config files from other users are very interesting and very difficult to prevent (without suPHP, suEXEC, basedirs, safepaths, no CGI, no shell, etc, etc, etc, etc).

  5. robertlouwen

    robertlouwen New Member

    @ Till,

    Actually really stupid but I want to be sure I understand.

    For each website select fast - CGI and put a tick in SuEXEC box.

    And for your information: Finally I got my FTP- SMTP and WEB server up and running.
    I did not give up and succeeded ( there are a few minnor issues )

    Thanks for ISPConfig !
  6. SamTzu

    SamTzu Active Member

    File/Folder permissions

    I have noticed some issues with file/folder permissions on Joomla.
    After migrating sites to ISPConfig3 some sites suffer from permissions issues.
    New pictures on Virtuemart get incorrect file permissions etc.

    umask 0022 is correct so what could cause this?
    I'm using CGI, SSI, suEXEC and suPHP on Joomla sites.

    Any suggestions?

    pebkac likes this.
  7. robertlouwen

    robertlouwen New Member

    @ Samtzu

    Just like you I am struggling with this.
    Tried all kinds of php ( fast-cgi, suphp, mod-php ) and so far did not find a combination that works.
    On the other hand I also tried chown on the entire directory and I have reasons to believe it works.
    My joomla web is here : /var/www/clients/client1/web1/web/joomla ( client1 is me ) so i did this : cd /var/www/clients/client1/web1/web (enter)
    chown -R -v -f web1:client1 joomla (enter)

    maybe this works for you.
    Good luck
  8. SamTzu

    SamTzu Active Member

    I have been forced to run these commands on web folder...
    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;
    chmod 777 tmp/ -Rf
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    This should both not be nescessary if you uploaded the files with FTP and then used either suexec + php-fastcgi or suphp. as the files will have the correct owners when uploaded with ftp and chowning is not nescessary as the files will get written by the cms systems under the same user. I run a lot of sites like that and never neded to chown or chmod something when using ispconfig 3.
  10. robertlouwen

    robertlouwen New Member

    @ Till,

    Thank you for this !

    To me it seemed easier to upload joomla.tar.gz to the website then go to my linux machine do tar xvzf and after that chown.

    I go try to unzip joomla.tar.gz first and than upload all files ( takes a little longer but who cares )
  11. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Surely you can upload and untar directly on the server.
    The only difference is that you have to chown all the files after that to the ftp user and group.
  12. robertlouwen

    robertlouwen New Member

    @ Till

    Again ...

    Something that pop up in my dummy brain.

    Like in your tut. create a compileuser so if I create a web1 or client1 user with the same password as in ISPConfig and than su web1 or client1 and then tar xvzf ?

    Or is this completly crazy talk ?
  13. robertlouwen

    robertlouwen New Member

    @ Croydon,

    This is only possible for me because I have the linux machine here right under my desk
    My son ( the only other client ) lives somewhere else so he has to upload all files

    Am I right ?
  14. Slowhand

    Slowhand New Member



    Is this true only for Joomla or should suphp always be used?

    Or only for cms-type installs...?

  15. till

    till Super Moderator Staff Member ISPConfig Developer

    there is no need to create a user. Just login to our server and then run for example (if you want to install the files in web1):

    su web1

    before you untar the files and all files will have the correct user.
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    This is recommended for every cms system that will upload files or images. Choose either suphp or php-fastcgi + suexec.
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    No, it does not depend on were the server is. You can always login with SSH on the shell and then do these tasks rom everywhere.
  18. SamTzu

    SamTzu Active Member

    I'm now wondering if my problems are actually OpenVZ related. I have noticed that su in Proxmox's Debian Lenny does not seem to work. Could this be an issue since we have built our Joomlas on top of ISPConfig3 that lies on top of Proxmox/OpenVZ.

    Anyway the problems are not clearly defined. Difficult to make conclusions.
  19. falko

    falko Super Moderator ISPConfig Developer

    On the host or in the guest systems?
  20. SamTzu

    SamTzu Active Member

    On the guest.

Share This Page