LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > php on external server

Reply
 
Thread Tools Display Modes
  #1  
Old 11-19-2009, 11:44 AM
sysadm sysadm is offline
Member
 
Join Date: Nov 2009
Posts: 35
Default php on external server

Is it possible or will it be possible to have PHP processes on the external server? I mean TCP/IP communication between lshttpd and lsphp.

I'm sure secondary server for PHP should have the same homedirs replicated by admin but this is not problem.
Reply With Quote
  #2  
Old 11-19-2009, 11:48 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yes, you can use TCP for the socket between web server and lsphp.

lsphp -b <TCP_SOCK>

can start lsphp on the second server from command line, you need to set related environment variables first to control many lsphp children processes can be started.

http://www.litespeedtech.com/php-litespeed-sapi.html
Reply With Quote
  #3  
Old 11-19-2009, 12:18 PM
sysadm sysadm is offline
Member
 
Join Date: Nov 2009
Posts: 35
Quote:
Originally Posted by mistwang View Post
Yes, you can use TCP for the socket between web server and lsphp.

lsphp -b <TCP_SOCK>

can start lsphp on the second server from command line, you need to set related environment variables first to control many lsphp children processes can be started.

http://www.litespeedtech.com/php-litespeed-sapi.html

Nice to hear. I can run lsphp listening on any port without problems. But I can't see there how to set "External Applications" in LSWS admin panel to make it able to connect by tcp/ip to remote lsphp. I've tried to give IP and port number in "Address" column but it is not enought. LSWS still users local lsphp.

Best regards,
sysadm
Reply With Quote
  #4  
Old 11-19-2009, 12:29 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Just set "Auto start" to No.
http://www.litespeedtech.com/docs/we...pps/#autoStart
Reply With Quote
  #5  
Old 11-19-2009, 02:02 PM
sysadm sysadm is offline
Member
 
Join Date: Nov 2009
Posts: 35
Thank you for advise, now I see the difference. Lshttp doesn't try to run local lsphp by socket any longer so that is good. Just for test I have my lsphp runned on the local machine as TCP/ip server. But all of my websites are blank (Alert!: Unexpected network read error; connection aborted) or I've connection timeout.

Additionally I can't see any network traffic on port 3000 (where my lsphp is listening to). Sory for such questions but I can't see any complex howto about running lsphp as external tcp/ip server for LSWS.

Nothing special in LSWS error logs.

2009-11-19 22:59:14.108 [NOTICE] [AutoRestarter] cleanup children processes and unix sockets belong to process 68947 !
2009-11-19 22:59:14.115 [NOTICE] [AutoRestarter] child process with pid=68947 exited with status=0!
2009-11-19 22:59:14.115 [NOTICE] [AutoRestarter] cleanup children processes and unix sockets belong to process 68823 !
2009-11-19 22:59:14.218 [NOTICE] [AutoRestarter] child process with pid=68823 exited with status=0!
2009-11-19 22:59:14.219 [NOTICE] [PID:68783] Server Stopped!

Anything in domain's logs.
Reply With Quote
  #6  
Old 11-19-2009, 02:11 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Your need to change the "Address" of lsphp external app to "IP:Port", do you?
Reply With Quote
  #7  
Old 11-19-2009, 02:21 PM
sysadm sysadm is offline
Member
 
Join Date: Nov 2009
Posts: 35
Quote:
Originally Posted by mistwang View Post
Your need to change the "Address" of lsphp external app to "IP:Port", do you?
Yes, I do.
Name lsphp5
Address 1.2.3.4:3000

Where 1.2.3.4 is my address. I can telnet to this IP on port 3000.

I found something else in logs. I've got this at any refresh of website (website is blank):

2009-11-19 23:17:04.235 [INFO] [HTAccess] Updating configuration from [/home/username/domains/xxx.com/public_html/.htaccess]
2009-11-19 23:17:04.238 [INFO] Start listen socket [/tmp/lshttpd/APVH_www.xxx.com_Suphp.sock.896].
2009-11-19 23:17:05.236 [NOTICE] [AutoRestarter] child process with pid=76888 received signal=11, a core file is created!
2009-11-19 23:17:05.263 [NOTICE] [AutoRestarter] cleanup children processes and unix sockets belong to process 76888 !
2009-11-19 23:17:05.369 [NOTICE] [AutoRestarter] new child process with pid=77026 is forked!
....
2009-11-19 23:20:07.343 [INFO] Stop listener .........
.....
2009-11-19 23:19:51.445 [NOTICE] Core dump is enabled.
2009-11-19 23:19:51.445 [NOTICE] [child: 78315] Successfully change current user to apache
2009-11-19 23:19:51.445 [NOTICE] [Child: 78315] Setup swapping space...
2009-11-19 23:19:51.445 [NOTICE] [Child: 78315] LiteSpeed/4.0.11 Enterprise starts successfully!



And kernel logs:

pid 76576 (lshttpd.4.0.11), uid 6200: exited on signal 11
pid 76574 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 76704 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 76749 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 76888 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 77061 (lshttpd.4.0.11), uid 6200: exited on signal 11
pid 77059 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 77503 (lshttpd.4.0.11), uid 6200: exited on signal 11
pid 77968 (lshttpd.4.0.11), uid 6200: exited on signal 11
pid 77964 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 78216 (lshttpd.4.0.11), uid 6200: exited on signal 11
pid 78214 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 78234 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 78284 (lshttpd.4.0.11), uid 1003: exited on signal 11 (core dumped)
pid 78491 (lshttpd.4.0.11), uid 6200: exited on signal 11


etc...

Last edited by sysadm; 11-19-2009 at 02:24 PM..
Reply With Quote
  #8  
Old 11-19-2009, 02:26 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
It wont work with PHP suEXEC, as each suEXEC PHP process need its own listening socket, has to be "Auto start" using "Unix domain socket".
Reply With Quote
  #9  
Old 11-19-2009, 02:52 PM
sysadm sysadm is offline
Member
 
Join Date: Nov 2009
Posts: 35
Thank You. I am able to run this without suexec, but I thought there is possible to run lsphp in suexec mode for multiuser environment like directamin with only one instance of tcp/ip listener.

There is too wasting for us to run at least one lsphp -b process for each system user and too insecure for us not to use suexec.

Anyway thank you for all help.

Best regards,
sysadm
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:29 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.