Apache mod_lsapi issues
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Morten
  2. 26.04.2016
  3.  Subscribe via email
Some error on when enabling mod_lsapi on cPanel server
Rate this post:
  1. 26.04.2016 15:04:03
  2. # 1
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Hello,

Thanks for the great work you did on mod_lsapi and releasing it to production. We have waited years to change to something else than suPHP!

Today I have tested this on 4 different productions servers. Both Cloudlinux 7.2 and Cloudlinux 6.7.

On one server all sites went down after installing:
yum install liblsapi liblsapi-devel 
yum install cpanel-mod-lsapi

Then on another server they stopped working when running:
/usr/bin/switch_mod_lsapi --setup

Well, I restarted Apache/MySQL and after some minutes they were back again.
But you should also add to your howto (http://docs.cloudlinux.com/index.html?installation_mod_lsapi.html) that cagefs should be updated a couple of times as I had to do manually in order to get things working:
cagefsctl --force-update

I also had to run switch_mod_lsapi --build-native-lsphp since sites using native php stopped working.
Well, some minutes of downtime we can live with.

The last server I tried I cannot get it working. Nothing in Apache error_log but in sulsphp_log I found these:
[Tue Apr 26 13:34:21 2016] sulsphp: uid :( 651/username1); gid :( 650/username1); with suexec mode; cmd :( /usr/local/bin/lsphp)
[Tue Apr 26 13:35:31 2016] sulsphp: uid :( 1301/username2); gid :( 1299/username2); with suexec mode; cmd :( /usr/local/bin/lsphp)

Have any idea how to fix these?
  1. 26.04.2016 19:04:29
  2. # 2
Igor Ghertesco Accepted Answer
Posts: 153
Joined: 07.08.2015
0
Votes
Undo
Hello,

First, we apologize for incorrect information in our docs, you should run $ yum install mod_lsapi instead of cpanel-mod-lsapi, and follow our instructions further.

If you still face any issue, please create a ticket at https://helpdesk.cloudlinux.com, and we would be happy to assist you.
  1. 27.04.2016 06:04:52
  2. # 3
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Thanks, but yum install cpanel-mod-lsapi worked fine also. What's the difference? Please also update your docs then.

Should sulsphp_log log entries like this all the time even if the site is loading fine:
[Tue Apr 26 13:34:21 2016] sulsphp: uid [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/> 651/username1); gid [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/> 650/username1); with suexec mode; cmd [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/>/usr/local/bin/lsphp) 
[Tue Apr 26 13:35:31 2016] sulsphp: uid [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/> 1301/username2); gid [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/> 1299/username2); with suexec mode; cmd [img WIDTH=16 HEIGHT=16]http://old.cloudlinux.com/bitrix/images/forum/smile/icon_sad.gif"/>/usr/local/bin/lsphp) 
  1. 27.04.2016 07:04:27
  2. # 4
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
I stumbled upon a new issue.
I switched on mod_lsapi on the whole server, but there are spesifically one customer that is getting 500 error on their page because of symfony framwork.

And when trying to do:
/usr/bin/switch_mod_lsapi --disable-domain domain.tld

The domain is still using mod_lsapi. Why? Is that not possible to enable the whole server and disable those who have issues?

In order to get this working I had to disable cagefs on that account and then site is loading fine and checking phpinfo.php I see it\'s using mod_lsapi:
Server APILiteSpeed V6.9
  1. 27.04.2016 11:04:54
  2. # 5
Ryan Smith Accepted Answer
Posts: 32
Joined: 27.04.2016
0
Votes
Undo
I\'ve also found that a cagefsctl --force-update was required after enabling it globally.

One edge case we\'ve encountered is PHP breaking for customers with custom .htaccess rules like:

AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

This will cause the page to download until they either comment this out or or change to application/x-httpd-lsphp.

Is there any way to keep x-httpd-php5 working so these customers don\'t need to make any changes?

I\'ve noticed that our servers with LiteSpeed Web Server and Alt-PHP work with both x-httpd-php5 and x-httpd-lsphp.
  1. 27.04.2016 12:04:06
  2. # 6
Scott Neader Accepted Answer
Posts: 87
Joined: 12.06.2014
0
Votes
Undo
I am looking to enable mod_lsapi globally, after running it successfully for about a year, for certain domains.  It is really a great product.

I am watching this thread, as I'm very interested in what is the proper procedure to change the handler for some customers back to suPHP, if needed.

- Scott
  1. 27.04.2016 16:04:22
  2. # 7
Ryan Smith Accepted Answer
Posts: 32
Joined: 27.04.2016
0
Votes
Undo
I have some servers with Apache + Mod_Lsapi and some with LiteSpeed.

The Apache + Mod_Lsapi servers don't work if they have AddType application/x-httpd-php5 in their .htaccess file and they must comment it out or change it to x-httpd-lsphp. Just a edge case that is breaking some sites after the switch to Mod_lsapi that I'm checking if it's possible to avoid.

On a LiteSpeed server with Alt-PHP they can use x-httpd-php5 or x-httpd-lsphp in .htaccess and it'll work without any issues.
  1. 28.04.2016 11:04:36
  2. # 8
Ryan Smith Accepted Answer
Posts: 32
Joined: 27.04.2016
0
Votes
Undo
I had a client using AddType application/x-httpd-php5 .php .html in order to process some PHP within a HTML page. So, a rare edge occurrence.
  1. 30.04.2016 14:04:13
  2. # 9
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Bug: Each time we run yum install mod_lsapi Apache goes down. It will not get back up again before I do a service httpd restart.

Bogdan: Will it be possible to enable all acounts on a server and disable single domains in newer releases of mod_lsapi?
That will help in order to resolve issues for customers that face problems after enabling mod_lsapi. And instead of enable/disable a whole server with 500-100 accounts that would be a much easier way for us.
  1. 30.04.2016 15:04:55
  2. # 10
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Did try a new server now and after /usr/bin/switch_mod_lsapi --setup I saw this in ssh:

Updating user username...
Traceback (most recent call last):
  File "/usr/share/cagefs/cagefsctl.py", line 4307, in main
    main_func()
  File "/usr/share/cagefs/cagefsctl.py", line 4787, in main_func
    setup_cl_alt(config)
  File "/usr/share/cagefs/cagefsctl.py", line 3919, in setup_cl_alt
    reload_php_for_users(all_users = True)
  File "/usr/share/cagefs/cagefsctl.py", line 3367, in reload_php_for_users
    reload_processes('php', user)
  File "/usr/lib/python2.6/site-packages/clcommon/clfunc.py", line 90, in reload_processes
    os.kill( int(parts[0] ;) , signal.SIGHUP )
OSError: [Errno 3] No such process

Reconfiguration completed

Seen that before?
  1. 04.05.2016 04:05:56
  2. # 11
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
After EasyApache update of php version etc do we need to run switch_mod_lsapi --build-native-lsphp again?
  1. 05.05.2016 09:05:01
  2. # 12
Scott Neader Accepted Answer
Posts: 87
Joined: 12.06.2014
0
Votes
Undo
Hi Bogdan.  Your documentation specifically states that it is not possible to disable mod_lsapi for an individual domain, once you have enabled mod_lsapi globally:

http://docs.cloudlinux.com/index.html?apache_mod_lsapi.html
--enable-global - sets up mod_lsapi as a default way to serve PHP, making it enabled for all domains. Once that mode is enabled, you cannot disable mod_lsapi for individual domain
I would be curious to know if your idea works or not.  I have not used --enable-global yet on any of our servers, because I wanted the flexibility to disable for any problematic domains.

- Scott
  1. 05.05.2016 09:05:21
  2. # 13
Mike Tindor Accepted Answer
Posts: 35
Joined: 08.11.2013
0
Votes
Undo
Bogdan,

Your recommendation in Post #15 doesn't work for me, FYI.    It causes all PHP pages to be downloaded.

Mike
  1. 05.05.2016 11:05:44
  2. # 14
Ryan Smith Accepted Answer
Posts: 32
Joined: 27.04.2016
0
Votes
Undo
Causes all PHP pages to be downloaded for me as well.
  1. 05.05.2016 11:05:17
  2. # 15
John MacKenzie Accepted Answer
Posts: 14
Joined: 02.04.2011
0
Votes
Undo
just an fyi i had a support ticket about this yesterday and the solution for me was this in case it helps


switch_mod_lsapi --setup; switch_mod_lsapi --enable-global;service httpd restart
  1. 05.05.2016 14:05:00
  2. # 16
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Bogdan: Post 15 did not work.

When an account is added to mod_lsapi it should look like this:
#mod_lsapi suphp domain handled by lsphp
AddType application/x-httpd-lsphp .php .php4 .php5 .php53 .php54 .php55 .php56 .php6 .phtml
AddHandler application/x-httpd-lsphp .php .php4 .php5 .php53 .php54 .php55 .php56 .php6 .phtml

And Mike and John, you have to uncomment these lines in .htaccess file:
#mod_lsapi suphp domain handled by lsphp
#AddType application/x-httpd-lsphp .php .php4 .php5 .php53 .php54 .php55 .php56 .php6 .phtml
#AddHandler application/x-httpd-lsphp .php .php4 .php5 .php53 .php54 .php55 .php56 .php6 .phtml

Then the account/domain does not use mod_lsapi. As easy as that?!
Or you can juse disable cagefs for that account aswell?!

And Bogdan, I rebuilt php to 5.6.21 on native that cPanel just released. I didn\'t have to run any commands to get accounts/domains on server to use the new version. That happend automatically.
  1. 05.05.2016 14:05:40
  2. # 17
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Bogdan: I will do some more testing on other servers aswell and update this thread...
But have you gotten many error/issues reported yet and when will there be a new updated release available?
  1. 05.05.2016 14:05:00
  2. # 18
Scott Neader Accepted Answer
Posts: 87
Joined: 12.06.2014
0
Votes
Undo
Morten, apparently you do not understand the difference between "/usr/bin/switch_mod_lsapi --enable-global" and "/usr/bin/switch_mod_lsapi --enable-domain"

I would suggest you read documentation on these two commands, as your advice is meaningless when using --enable-global (which is what Mike, John, Ryan and I are all talking about)  :)

- Scott
  1. 05.05.2016 15:05:55
  2. # 19
Morten Accepted Answer
Posts: 115
Joined: 16.04.2014
0
Votes
Undo
Hmm, I don't think I'm missing something here.
I have run /usr/bin/switch_mod_lsapi --enable-global on the server and all domains use mod_lsapi.

Then on different accounts I uncomment those lines from .htaccess file and when checking phpinfo.php etc they are not using Server API LiteSpeed V6.9 anymore.
Please elaborate on what I'm missing here?
  1. 05.05.2016 15:05:39
  2. # 20
Scott Neader Accepted Answer
Posts: 87
Joined: 12.06.2014
0
Votes
Undo
You are NOT using GLOBAL then.  With Global, there is no .htaccess changes at all.  ALL sites are forced to use mod_lsapi PHP handler. 

- Scott
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.