PDA

View Full Version : litespeed, chmod conf file to 600


Markovic
06-16-2009, 09:15 AM
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

mistwang
06-16-2009, 09:23 AM
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.

Markovic
06-16-2009, 10:05 AM
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.

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/

mistwang
06-16-2009, 08:26 PM
Just check the external app configuration in the suEXEC vhost template.

Markovic
06-17-2009, 12:05 AM
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?

Markovic
06-17-2009, 01:34 AM
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

auser
06-17-2009, 05:50 AM
SCRIPT HANDLER
Suffix: php5
Type: LiteSpeed API
Name: [VHost Level]: $VH_NAME_lsphp

this is for .php5, how about .php ?

Markovic
06-17-2009, 07:22 AM
this is for .php5, how about .php ?

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

mistwang
06-17-2009, 07:41 AM
the command parameter points to a PHP4 binary, you should set it
something like $SERVER_ROOT/fcgi-bin/lsphp5 ,
http://www.litespeedtech.com/docs/webserver/config/extapps/#extAppPath

auser
06-17-2009, 07:42 AM
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

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


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?

yes, should be.

Markovic
06-17-2009, 07:56 AM
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