Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 10:53:20 AM

Pages: [1] 2   Go Down
  Print  
Author Topic: File Permission  (Read 2993 times)
hpower
Newbie
*
Offline Offline

Posts: 1


« on: September 25, 2008, 07:52:35 AM »

Hi,
i have recently moved to lunar vps.

i have serious file permission problem.. with Joomla

through ftp i can do whatever i like...
but when i am connected through Joomla admin interface i am not able to change  or create files..

my httpdocs folder is set to User:psaserv
file in httpdocs are set to    User:psacln

with 775 i do not have permissions to write or change a file.. only works with 777.


 Help Help Help Help Help
Logged
mke
Trekkie
**
Offline Offline

Posts: 16


« Reply #1 on: September 25, 2008, 06:13:47 PM »

Have the same problem with joomla, it's very important for me
That is what one of the administrator said earlier:

"Our shared servers use suPHP to run PHP scripts. suPHP executes the scripts as the user specified under virtualhost of your domain configuration in such case. Since your account is the owner of all files you upload, this allows PHP scripts to create or modify your files without any problems with permissions.
However, PHP is configured via mod_php module in Plesk by default. This means that all PHP scripts will be executed as the user used to run Apache which is nobody. So in order to get your scripts working, you need to allow nobody to write into files or folders by granting write permission into the files owned by your username to all others users or changing the folders and files modified in PHP scripts to the ownership of nobody."



to solve this you have to install mod_suphp from here http://dag.wieers.com/rpm/packages/mod_suphp/
I'm not sure but for linux centos mod_suphp-0.6.1-2.2.el4.rf.i386.rpm should be ok

then something has to be configured but I don't understand that exactly.
http://www.web-hosting-control-panel-addons.com/description.php/HOW-TO_setup_a_PLESK_Dedicated_Server/6/
I got up to line "shell: mv ... "
Could you please explain this to beginner, make tutorial, faq, make it sticky? A lot of people use Joomla, make it easy for us please.

18. mod-suPHP (still experimental on PLESK to work 100% ok).

A lot of people have problems with different PHP softwares like Joomla, different Gallery softwares, especially where need to upload pictures. Why? Because now in a new settings, PHP will work as apache:apache user and any files uploaded via a web interface will get this user rights. Any files uploaded via FTP clients, will get the domain ownership. SO, if you for example want to get all picture files added via WEB INTERFACE, you cannot download or overwrite via FTP because the file rights. Also on install a lot of people need to setup folders to 777 rights to uload in it.

So seems the mod_suPHP solution is nice and working with the following settings.

shell: yum install mod_suphp
(alternate http://dag.wieers.com/rpm/packages/mod_suphp/)

After this, /etc/httpd/conf.d/mod_suphp.conf (imporatnt this line LoadModule suphp_module modules/mod_suphp.so, rest can be uncommented); /etc/suphp.conf (use default, except ; Security options allow_file_group_writeable=false allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false; )

If is PHP5, change in /etc/suphp.conf

unmask=0022
[handlers]
;Handler for php-scripts
php5-script=php:/usr/bin/php-cgi

In some case, suphp.conf in /etc/httpd/conf.d will not work, so
shell: mv /etc/httpd/conf.d/suphp.conf /etc/httpd/conf.d/mod_suphp.conf

If you compiled suphp with setid-mode "force" or "paranoid", you can specify the user- and groupname to run PHP-scripts with.
Example: suPHP_UserGroup ftpuser psacln

The major things come with: httpd.include of each domain need to add, before < /VirtualHost >, the line Include /var/www/vhosts/fieldstonealliance.com/conf/vhost.conf
Then create vhost.conf. (We suggest to use for this Power Toys, this will suggest exacctly what you need to do and modify the file for you)

In vhost.conf you need:
< IfModule mod_suphp.c >

< Directory "/var/www/vhosts/DOMAIN/httpdocs/" >

php_admin_flag engine on

suPHP_Engine On

suPHP_ConfigPath "/var/www/vhosts/DOMAIN/httpdocs/"

AddHandler x-httpd-php .php

AddHandler php5-script .php

AddHandler x-httpd-php .php .php5 .php4 .php3 .phtml

suPHP_AddHandler x-httpd-php

suPHP_AddHandler php5-script .php

suPHP_UserGroup ftpuser psacln

php_value open_basedir "/tmp/"

php_value upload_tmp_dir "/var/www/vhosts/DOMAIN/tmp/"

< Files php.ini >

order allow,deny

deny from all

< /Files >

< /Directory >

< /IfModule >

Need to focus on BOLD issues. DOMAIN is your domain, AddHandler one line is for PHP4, the other for PHP5, dunno if will work both together. Create in httpdocs/tmp directory, to write in it, as temporary upload dir. We still study this to move one directory up, but is not tested yet: DOMAIN/tmp/. After this, you need to add a php.ini file in your httpdocs directory, which will be use for that domain. this file cannot be read from outside because is restricted. To test if is work, create a file wit lines, < ?php phpinfo(); ? > and call it from web. You can see if is loaded new PHP.INI or not and mod_suPHP is on.







Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #2 on: September 27, 2008, 10:34:05 PM »

Hi Mke, 

The howto you found looks good to me and we will try to create our own a bit later. As for the step with mv, you wouldn't do it and only issue if suphp does not start work to see, if incorrect location of configuration file is the case.

Logged

Kind Regards,
Vlad Artamonov
berryc
Trekkie
**
Offline Offline

Posts: 10


« Reply #3 on: December 06, 2008, 09:55:31 AM »

I've got a Joomla site in development on a shared host and want to move it to a LunarPages VPS. I have limited *nix experience and could never pull off these configuration steps...safely!

When/if I order this VPS...should I request this setup from Lunarpages staff (willing to pay $$$) .... but will THEY be able to pull it off?

I've been running another Joomla site on a Lunarpages VPS and have just been working with the apache user having all permissions...so FTP doesn't work for me...but I definately don't like this arrangement.

Thanks for any input!

-Craig
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #4 on: December 08, 2008, 08:41:44 AM »

Hello Craig,

Lunarpages administrators will be able to assist you with this setup for $75/hour assistance fee. As an option, it can be counted as free script install, if you purchased the managed intense addon. Please, email vps@lunarpages.com.
Logged

Kind Regards,
Vlad Artamonov
berryc
Trekkie
**
Offline Offline

Posts: 10


« Reply #5 on: December 08, 2008, 10:34:19 AM »

Hi Vlad,
Thanks for the information.

I'm going with the $10/month VPS management addon...is that what you were referring to?

Thanks again,
Craig
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #6 on: December 08, 2008, 10:59:17 PM »

Hi Craig,

I'm sorry, I overlooked we are in VPS area. Unfortunately, your 10$/month management which is referred as managed lite addon includes only monitoring of your server.
Logged

Kind Regards,
Vlad Artamonov
berryc
Trekkie
**
Offline Offline

Posts: 10


« Reply #7 on: January 08, 2009, 07:17:14 AM »

Hi Vlad,
Well...I gave it a shot and it didn't work out. The support staff installed it, but it broke a few things and we had to reset the VPS. It sounds like a number of techs took a turn at it.

I've got another Lunarpages VPS running Joomla and I had to set user and group permissions to Apache and it works...so that's the way I'll probably go. The only downside I've found is I cannot use FTP.  Sad

It sounds like a messy issue, way beyond me...and it sounds like hosts that run suexec have better luck with this sort of issue.

This thread sheds some light on it.. http://forum.joomla.org/viewtopic.php?f=34&t=51041

I hope there's a long-term solution to this though. I love Joomla!

Thanks for your help,
Craig
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #8 on: January 12, 2009, 11:21:31 AM »

Hello Craig,

I am very sorry to hear about such experience. Suphp mentioned in this thread is suexec for php in fact. If you want to try to give it a try once again, I'll be happy to look into this myself. If you would like to proceed, please send me a private message with your tickit number.
Logged

Kind Regards,
Vlad Artamonov
sartala
Newbie
*
Offline Offline

Posts: 2


« Reply #9 on: February 28, 2009, 05:36:32 AM »

HI
Hi
I uploaded joomla on my VPS hosting it is installed successfully
But now I unable to install joomla extinction and also I changed the folder permission already
What is the problem? Is there problem between pleask and joomla?
What do you think? Should I change my pleask control panel with cpanel
Logged
berryc
Trekkie
**
Offline Offline

Posts: 10


« Reply #10 on: February 28, 2009, 04:03:05 PM »

Hi Sartala,
I had the same problems. If you go to the Joomla back end and find the permissions tab, you'll see that everything is 'unwriteable'. It's all about file/folder ownership.

I truly wish LunarPages would adequately address this, because I have had to select another host for all of my Joomla client sites, which is growing quickly. I have one client on a LunarPages VPS, but I had set file/folder ownership to APACHE...which works...sort of. It breaks FTP access...and that is a frustrating problem.

Please LunarPages...address this issue. Surely you've got the technical expertise in-house to solve it.

Vlad...are you still there? You seem to understand the issue pretty well...is there any way you can work with vps/dedicated support to write up a FAQ or knowledgebase article for this?

I'm looking at getting 3-5 VPS accounts in the next year for my clients, but at this point I have to go with a different hosting provider.

The LunarPages VPS package is a very good value! Other than this particular issue, I've had great support and service here.

-Craig
Logged
conga3
Knows just enough to get in trouble.
Spacescooter Operator
*****
Offline Offline

Posts: 39


WWW
« Reply #11 on: February 28, 2009, 08:09:08 PM »

Lunarpages VPS + suPHP + Joomla = Success. Thumbs Up



« Last Edit: February 28, 2009, 08:12:02 PM by conga3 » Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #12 on: March 01, 2009, 10:33:45 PM »

Hi

To Sartala:

The cause of your problem is the permissions that do not allow web server to modify files under joomla install. This usually gets solved by changing the permissions on joomla parts that can be modified out of joomla scripts to make the files and folders owned by the user apache runs under (this is apache use for plesk server). Another way to solve the issue is to install suphp which allows the web server to execute the php scripts under your username making them allowed for modification out of scripts by that. Suphp installation for Plesk server requires a few manual steps to be done in shell. In cPanel server this involves compilation of suphp which is done via the panel itself.

I'll create the suphp install howto for plesk on these forums on this week once I have a spare hour. I hope this will happen shortly.
Logged

Kind Regards,
Vlad Artamonov
sartala
Newbie
*
Offline Offline

Posts: 2


« Reply #13 on: March 02, 2009, 04:27:39 AM »

Hi
Dear administrator
Thanks for your answer
I changed my folder and file permission and also I installed my template successfully but now there is no thing in my front page when I type my site address it shows me a white and blank page without any thing I installed two other template but it is not working as well it mean that there is no problem with template what is wrong?
Please help me
Logged
conga3
Knows just enough to get in trouble.
Spacescooter Operator
*****
Offline Offline

Posts: 39


WWW
« Reply #14 on: March 02, 2009, 05:51:49 AM »

The server admin (not lunarpages) I hired to install suPHP on my -NEW- LP VPS server told me these were the steps he took.

So far no issues, and Joomla operates perfectly.

Hope this helps, but an official LP approved complete suPHP install walkthrough would be very nice.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Install suPHP on the server

INSTALL YUM

rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/gmp-4.1.4-3.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/readline-4.3-13.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-2.3.4-14.7.el4.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/libxml2-2.6.16-12.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/libxml2-python-2.6.16-12.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/expat-1.95.7-4.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/elfutils-libelf-0.97.1-5.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/elfutils-0.97.1-5.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/rpm-4.3.3-26_nonptl.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/rpm-python-4.3.3-26_nonptl.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm
rpm -Uvh http://ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/os/alpha/CentOS/RPMS/centos-yumconf-4-4.5.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-metadata-parser-1.0-8.el4.centos.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm



INSTALL GCC compiler

yum remove glibc-dummy-centos-4

yum -y install gcc*



INSTALL missing APXS

yum install httpd-devel


INSTALL SUPHP

./configure --with-apxs=/usr/sbin/apxs --with-php=/usr/bin/php-cgi --with-logfile=/var/log/suphp.log --with-min-uid=30 --with-min-gid=30 --with-apache-user=apache --with-apr=/usr/bin/apr-config --with-setid-mode=owner -prefix=/usr --sysconfdir=/etc
make
make install

Configure SUPHP

vi /etc/suphp.conf

    ;Loglevel
    loglevel=info

    ;User Apache is running as
    webserver_user=apache

    ;Path all scripts have to be in
    docroot=/

    ;Path to chroot() to before executing script
    ;chroot=/mychroot

    ;Security options
    allow_file_group_writeable=true
    allow_file_others_writeable=false
    allow_directory_group_writeable=true
    allow_directory_others_writeable=false

    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true

    ;Send minor error messages to browser
    errors_to_browser=false

    ;PATH environment variable
    env_path=/bin:/usr/bin

    ;Umask to set, specify in octal notation
    umask=0077

    ;Minimum UID
    min_uid=100

    ;Minimum GID
    min_gid=100


    [handlers]

    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php-cgi

    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self



Configure Apache Module

vi /etc/httpd/conf.d/suphp.conf

    LoadModule suphp_module modules/mod_suphp.so
    #php_admin_value engine off
    suPHP_Engine on
    AddHandler x-httpd-php .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php


UPGRADE to PHP5

   1. Open up /etc/yum.repos.d/CentOS-Base.repo and look for the section centosplus:

      [centosplus]
      name=CentOS-$releasever - Plus
      mirrorlist=http://mirrorlist.centos.org/…
      #baseurl=http://mirror.centos.org/…
      gpgcheck=1
      enabled=0
      gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
      priority=2
      protect=1
   2. Change enabled=0 to enabled=1
   3. Save the file
   4. Run yum update php*
   5. Restart Apache: service httpd restart
   6. chmod 777 /var/lib/php/session
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to: