litespeed, chmod conf file to 600

Discussion in 'Install/Configuration' started by Markovic, Jun 16, 2009.

  1. Markovic

    Markovic New Member

    Hello,

    I installed lsws without apache conf file(httpd.conf). Then I created a new virtual host in "suEXEC" Template. I added a new user via SSH and made home dir for him and chowned his home dir + all his files to hisusername:hisusername. His home dir(/home/user/) is chmoded to 755 and his /public_html to 711. It worked fine but after that I installed phpbb3 forum and when I tried to chmod config.php to 600 I got an error on the forum:

    Fatal error: require() [function.require]: Failed opening required './config.php' (include_path='.:/usr/local/lib/php') in /home/username/public_html/common.php on line 127

    When I was using lsws with apache conf file and I had configured suEXEC + suPHP for apache I was able to chmod config file to 600 and it worked fine. I have no idea what could be the problem now.

    It works fine when I chmod config.php to 755 but for security reasons I would need a way to configure it to 600.

    It's really important for me and I really hope I will get a solution here. George? Others?

    Thanks
    Best Regards
  2. mistwang

    mistwang LiteSpeed Staff

    I think PHP is not in suEXEC mode.
    double check the PHP command path in the suEXEC template, make sure it uses the right PHP binary.
  3. Markovic

    Markovic New Member

    Virtual host is in suEXEC Template, I'm 100% sure. How to check PHP command path and PHP binary?

    I installed php 5.2.9 with LSAPI and suhosin patch + sendmail patch from this paper
    http://nix101.com/2007/09/22/setting-up-a-secure-and-fast-php-build-for-litespeed/
  4. mistwang

    mistwang LiteSpeed Staff

    Just check the external app configuration in the suEXEC vhost template.
  5. Markovic

    Markovic New Member

    EX. APP
    LSAPI App
    $VH_NAME_lsphp
    uds://tmp/lshttpd/$VH_NAME_lsphp.sock

    SCRIPT HANDLER
    Suffix: php5
    Type: LiteSpeed API
    Name: [VHost Level]: $VH_NAME_lsphp

    Does it look ok?
  6. Markovic

    Markovic New Member

    Environment is empty, if could be the problem maybe?

    And note, I'm using lsws 3.3.24, I haven't updated yet. Litespeed is running as nobody:nobody
    If you need any other info let me know, I really need to get it fixed
    Last edited: Jun 17, 2009
  7. auser

    auser Super Moderator

    this is for .php5, how about .php ?
  8. Markovic

    Markovic New Member

    Yes, by default there was .php but I changed to .php5 because with .php the server recognizes as php version 4. phpinfo shows I'm running 5.2.9, php -v too but php shell shows I'm running php version 4 and phpmyadmin is not working, guess what, error like it's not compatible with php4 :O

    For .php there was:
    SCRIPT HANDLER
    Suffix: php
    Type: LiteSpeed API
    Name: [VHost Level]: $VH_NAME_lsphp

    Also, I asked about it at WHT forum and I got interesting reply.
    I have a couple of lsws5 processes running as nobody:nobody, but with suEXEC they should be running as user:user, isn't it?

    Thanks
  9. mistwang

    mistwang LiteSpeed Staff

  10. auser

    auser Super Moderator

    at the user's phpbb3 forum root, put phpinfo.php, check php version, 4 or 5.2.9?

    yes, should be.
  11. Markovic

    Markovic New Member

    Fixed, thanks everyone for your help, I cp'd sapi/litespeed/php to /opt/lsws/fcgi-bin/lsphp instead of /opt/lsws/fcgi-bin/lsphp5 and it worked.

    Thanks

Share This Page