cant solve the permmisions problem

Discussion in 'General OpenLiteSpeed Discussion' started by andreig, Apr 17, 2017.

  1. andreig

    andreig New Member

    Hi,

    I wanted to install wordpress on OLS and received a error that wp-config.php cant be created, witch means is a permissions problem somewhere, here are my settings.

    Server Configuration > External App running as nobody:nobody
    Server Configuration > Script Handler > Handler Type > LiteSpeed SAPI
    Server Configuration > Script Handler > Handler Name> lsphp5

    Virtual Host Name domain.com
    Virtual Host Root $SERVER_ROOT/$VH_NAME/
    Config File $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
    Note: Instantiated from template PHP_SuEXEC

    Virtual Host domain.com > Basic > ExtApp Set UID Mode Server UID
    Virtual Host domain.com > General > Document Root /home/user/html
    Virtual Host domain.com > External App running as user:user
    Virtual Host domain.com > Script Handler > Handler Type LiteSpeed SAPI
    Virtual Host domain.com > Script Handler > Handler Name [Server Level]: lsphp5


    /home/user/html and all files in the folder are owned by user:user

    What i'm doing wrong ?

    thanks.
     
  2. lsfoo

    lsfoo Administrator

    Hi @andreig

    How are you trying to create a wp-config.php file? Is it through PHP, FTP, or directly (like with vi)?

    Cheers,
    Kevin
     
  3. lskagan

    lskagan Administrator

    Hi @andreig

    Looking at your configuration you have ExtApp set to use Server UID, this would require the files to be owned at minimum user:nobody. If you switch it to use DocRoot UID it will then be able to be run as user:user.

    Cheers,
    Jon
     
  4. while1

    while1 New Member

    I have same problem in my lab
    Document Root = $VH_ROOT/
    Virtual Host Root = /usr/local/lsws/public_html/site1
    ExtApp Set UID Mode = DocRoot UID


    $ getfacl /usr/local/lsws/public_html/site1
    # file: usr/local/lsws/public_html/site1
    # owner: user
    # group: nobody
    # flags: -s-
    user::rwx
    group::r-x
    other::r-x

    all dir`s 755 (user:nobody)
    all files 644 (user:nobody)

    php:
    $uid = posix_getuid();
    echo var_export(posix_getpwuid($uid),true);

    return:
    array (
    'name' => 'nobody',
    'passwd' => 'x',
    'uid' => 99,
    'gid' => 99,
    'gecos' => 'Nobody',
    'dir' => '/',
    'shell' => '/sbin/nologin',
    )

    Thanks to the helpers and the community!
     
  5. lswave

    lswave Member

    what's your OLS version ?
     
  6. while1

    while1 New Member

    OLS 1.4.27
     
  7. lswave

    lswave Member

    I can reproduce the issue.
    ols 1.4.7, lsphp 7.1.9.
    in php script, I used
    PHP:
    echo system("whoami");
    for the test.
     
  8. while1

    while1 New Member

    This php code return "nobody nobody" on my system
     
  9. David

    David New Member

    I did some tests locally with a newly installed OLS and instantiated a new vhost from template PHP_SuEXEC, set the public_html DIR another as own as test:test.
    It runs as DOC GUID.

    1207 postfix 20 0 92108 4112 3020 S 0.0 0.0 0:00.00 pickup
    1208 root 20 0 136720 5080 3848 S 0.0 0.1 0:00.14 sshd
    1210 root 20 0 115520 2196 1696 S 0.0 0.0 0:00.08 bash
    1498 root 20 0 41576 3740 2472 S 0.0 0.0 0:00.14 litespeed
    1505 root 20 0 41044 1160 344 S 0.0 0.0 0:00.02 litespeed
    1544 nobody 20 0 42772 2420 1092 S 0.0 0.0 0:00.34 litespeed
    1545 nobody 20 0 43320 3540 1720 S 0.0 0.0 0:00.36 litespeed
    1581 lsadm 20 0 29748 4216 2556 S 0.0 0.1 0:00.00 admin_php
    1584 root 20 0 157576 2092 1500 R 0.0 0.0 0:00.00 top
    1585 test 20 0 30012 3520 2024 S 0.0 0.0 0:00.00 lsphp

    I tested with current code, and this part is the same as 1.4.27.
     

Share This Page