Apache prefolk module cannot run concurrently with php7.2 module - apache

1.Environment
Uname 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Apache/2.4.29 (Ubuntu)
PHP 7.2.17-0ubuntu0.18.04.1 (cli)
2.Problem
I use the a2dismod command to close the mpm_prefolk and php7.2 modules, continue to use a2enmod to open the mpm_event module, open the event successfully, but after I continue to try to open the php7.2 module, an error occurred.
Operation process & ErrorCode
So I just turned off mpm_prefolk and then opened php7.2 as it said, php7.2 loaded successfully, but it automatically loaded the mpm_prefolk module.
Operation process
But at this time, the mpm_event module cannot be loaded.
ErrorCode
It needs to let me close mpm_prefolk,Just like an infinite loop, I don't know if I should reinstall the php environment or apache server, or php7.2 can only work with apache mpm_prefolk working mode, so I can only temporarily change it back.
3.Solution & Analyze
I solved the problem by reinstall the suit of php and apache ,and i read the apache documentation. So i found that apache mod_php only spport the prefolk module. You must install the php fpm Module

Related

Xamp on fedora fails to start

I installed xampp and its been working fine, until I started getting the following error whenever I tried to start xampp:
XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility librar
y for your system.
After commenting the lines of code in /opt/lampp/lampp that referenced this error I now get a new error when launching xampp with /opt/lampp/lampp start:
Starting XAMPP for Linux 7.2.3-0...
XAMPP: Starting Apache...fail.
httpd: Syntax error on line 522 of /opt/lampp/etc/httpd.conf: Syntax error on line 10 of /opt/lam
pp/etc/extra/httpd-xampp.conf: Cannot load modules/libphp7.so into server: libnsl.so.1: cannot op
en shared object file: No such file or directory
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
I have php-7.2.3 installed in /opt/lampp/bin and apache and everything else was working before. How do I get Apache to launch?
it seems you're missing the libnsl, install it through this command:
# sudo dnf install libnsl
In case this doesn't work you can then download it manually:
visit https://pkgs.org/
in the search box (pkgs.org of course) type libnsl.so.1 and choose the appropriate OS. The version shown might be higher e.g libnsl-2.28-9.fc29.x86_64.rpm, but it doesn't matter, the file needed is also included in this very package.
in the terminal, navigate to the directory where the .rpm was downloaded.
then type the following command to install it:
# sudo rpm libnsl-2.XX-X.fc29.x86_64.rpm
Upon completion everything should be working fine.

Apache crashes with munmap_chunk(): invalid pointer after update to php7 on Jessie

I recently updated to php 7.0.4 on my server running a Debian 8.
here is what dpkg -l | grep php gives me:
ii libapache2-mod-php7.0 7.0.4-1~dotdeb+8.1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php-common 21-1~dotdeb+8.1 all Common files for PHP packages
ii php-readline 21-1~dotdeb+8.1 all readline module for PHP [default]
ii php7.0 7.0.4-1~dotdeb+8.1 all server-side, HTML-embedded scripting language (metapackage)
ii php7.0-cli 7.0.4-1~dotdeb+8.1 amd64 command-line interpreter for the PHP scripting language
ii php7.0-common 7.0.4-1~dotdeb+8.1 all Common files for packages built from the PHP source
ii php7.0-curl 7.0.4-1~dotdeb+8.1 amd64 CURL module for PHP
ii php7.0-gd 7.0.4-1~dotdeb+8.1 amd64 GD module for PHP
ii php7.0-imap 7.0.4-1~dotdeb+8.1 amd64 IMAP module for PHP
ii php7.0-intl 7.0.4-1~dotdeb+8.1 amd64 Internationalisation module for PHP
ii php7.0-json 7.0.4-1~dotdeb+8.1 amd64 JSON module for PHP
ii php7.0-mcrypt 7.0.4-1~dotdeb+8.1 amd64 libmcrypt module for PHP
ii php7.0-mysql 7.0.4-1~dotdeb+8.1 amd64 MySQL module for PHP
ii php7.0-opcache 7.0.4-1~dotdeb+8.1 amd64 Zend OpCache module for PHP
ii php7.0-readline 7.0.4-1~dotdeb+8.1 amd64 readline module for PHP
My php applications run fine most of the time.But on some requests I just get a Page being generated for no foreseeable reason.
The /var/log/apache2/error.log states in such a case:
*** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6ddb4a50 ***
*** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6dd5cad0 ***
[Wed Mar 09 11:26:44.940931 2016] [core:notice] [pid 28486] AH00052: child pid 29338 exit signal Aborted (6)
[Wed Mar 09 11:26:44.941017 2016] [core:notice] [pid 28486] AH00052: child pid 29344 exit signal Aborted (6)
*** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6dd5cad0 ***
[Wed Mar 09 11:26:46.942581 2016] [core:notice] [pid 28486] AH00052: child pid 29347 exit signal Aborted (6)
I'll give some more information:
Syntax:
$ apachectl configtest
Syntax OK
Version:
apachectl -v
Server version: Apache/2.4.10 (Debian)
Server built: Nov 28 2015 14:05:48
Before the php update I did not see those errors. What is wrong here? Or how can I better find the source? I am lost here because this error occures kind of random. Sometimes the same request succeeds that faild with this error a minute ago. I would apprechiate your help.
That's now the second time we have been hit hard by the very same issue.
It happens when running PHP 7.0 on a up to date debian.
This will break any type of website system which heavily uses regular expression.
We have seen it iwth Neos (neos.io) or Typo3 (starting with 6.2).
In case it's not possible to use the testing version of the libpcre3.
Someone can disable the just in time compiling within the php.ini
Edit your php.ini add pcre.jit=0 anywhere you like
Restart your apache
Be happy
I have the same version and solved by upgrading libpcre3 like #Kevin Fischer write.
I was upgrade libpcre3 package form 2:8.35-3.3+deb8u4 (stable) to 2:8.38-3.1 (testing) version.
Step by step:
Add line deb http://ftp.us.debian.org/debian testing main contrib non-free to /etc/apt/sources.list
Create file /etc/apt/apt.conf.d/99default-release with content: APT::Default-Release "stable";
Run command apt-get update from root
Run command apt-get -t testing install libpcre3 to install testing version of libpcre3 package
Restart your server and check logs, error should be disappears.
For more info to install testing package see this question.
Warning! Testing packages can works incorrectly! Update in your own risk or wait new release.
We've just had a similiar situation, where one of our framework's components would fail us with:
*** Error in `php': munmap_chunk(): invalid pointer: 0x00007fdce5550060 ***
I can't tell you anything about the bug itself, but the cause of it was a broken libpcre3 version, namely 8.35-3.3+deb8u4. We we're running a custom build, because PHP7 requires JIT support from libpcre3, which isn't included in the default one our Ubuntu version comes with (Ubuntu 14.04 LTS, 8.31-2ubuntu2.3). Upgrading the libpcre3 version solved the problem for us.
I also kept getting those nasty apache crashes, but none of the solutions above and on other websites were working for me.
After a lot of trial and error, I found out the root cause on my system.
I manually edited the PHP configuration and added two extensions. Both for Microsoft's SQL Server.
I added the following lines to the php.ini
extension=sqlsrv.so
extension=pdo_sqlsrv
I did not notice that I fogot the ".so" at the pdo driver.
After changing the lines as shown below, the Apache service is running fine again.
extension=sqlsrv.so
extension=pdo_sqlsrv.so

Apache segfault with passenger

I have problem installin passenger under Linux.
The way I'm doning it is
Added repository: deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main to /etc/apt/sources.list.d/passenger.list
Installed it:
sudo apt-get install libapache2-mod-passenger
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libev4
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
libapache2-mod-passenger
0 upgraded, 1 newly installed, 0 to remove and 580 not upgraded.
Need to get 0 B/273 kB of archives.
After this operation, 1 281 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-passenger.
(Reading database ... 287776 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-passenger_1%3a5.0.13-1~trusty1_amd64.deb ...
Unpacking libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
Setting up libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
Then I tried to enable passenger module with sudo a2enmod passenger but for some reason I had /etc/apache2/mods-available/passenger.conf and /etc/apache2/mods-available/passenger.load files missed after installation. (They are not created and also not removed with libapache2-mod-passenger so I suppose this is some kind of a bug). So I created them manually:
s
set#set:~$ which ruby
/home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
set#set:~$ which rails
/home/set/.rvm/gems/ruby-2.1.5/bin/rails
set#set:~$ ll /usr/lib/apache2/modules/ | grep passenger
-rw-r--r-- 1 root root 1209112 Jul 3 01:35 mod_passenger.so
/etc/apache2/mods-available/passenger.conf:
<IfModule passenger_module>
PassengerRoot /home/set/.rvm/gems/ruby-2.1.5/bin/passenger
PassengerRuby /home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
</IfModule>
and /etc/apache2/mods-available/passenger.load:
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
the module was successfully enabled then but when I was restarting apache it throw me a segfault:
a
Starting web server apache2 Segmentation fault (core dumped)
Action 'start' failed.
The Apache error log may have more information.
The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
and the coredump:
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from apache2...(no debugging symbols found)...done.
[New LWP 30116]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007faa58b8e37e in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_begin() const () from /usr/lib/apache2/modules/mod_passenger.so
So I stuck at this point and have no idea where to move nex. Reinstalling of libapache2-mod-passenger does not help. How can I fix this problem?
This issue is more like memory issue.
I am facing something similar as your issue. But my case is happening with the virtual box VM's. A similar setup for me worked on a typical hardware with more RAM.
What I am doing now to fix this issue is to install the latest passenger module.
gem install passenger and running passenger-install-apache2-module which comes natively with passenger.
and I think the latest module just work.
Here is my puppetmaster.conf file entries under apache conf dir.
LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.0.26/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/share/gems/gems/passenger-5.0.26

Error installing libapache2-mod-rpaf for detecting IPs using nginx as a reverse proxy

I've seen here, that I should install mod_rpaf so that Apache will be able to detect the IPs coming from the Nginx reverse proxy.
Even seen that there is a bug on Ununtu SO, and it should be solved changing the first line on /etc/apache2/mods-available/rpaf.conf.
The first line contains <IfModule rpaf_module>. I've tried replacing with <IfModule mod_rpaf-2.0.c>, but nothing changes when I restart the Apache.
This is the output when I try to install this module:
apt-get install libapache2-mod-rpaf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libapache2-mod-rpaf
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,126 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-rpaf.
(Reading database ... 28714 files and directories currently installed.)
Unpacking libapache2-mod-rpaf (from .../libapache2-mod-rpaf_0.6-2ubuntu1_amd64.deb) ...
Setting up libapache2-mod-rpaf (0.6-2ubuntu1) ...
Enabling module rpaf.
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/rpaf.load: API module structure 'rpaf_module' in file /usr/lib/apache2/modules/mod_rpaf.so is garbled - expected signature 41503234 but saw 41503232 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?
Action 'configtest' failed.
The Apache error log may have more information.
invoke-rc.d: initscript apache2, action "restart" failed.
dpkg: error processing libapache2-mod-rpaf (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-rpaf
E: Sub-process /usr/bin/dpkg returned an error code (1)
Per the error, you already have a version of /usr/lib/apache2/modules/mod_rpaf.so on your system with a filehash that differs from what the package config is expecting (expected signature 41503234 but saw 41503232), so you either need to:
1) Work out what installed the conflicting version and uninstall it:
dpkg -S /usr/lib/apache2/modules/mod_rpaf.so
apt-get --purge remove <package>
Or if manually added:
mv /usr/lib/apache2/modules/mod_rpaf.so /usr/lib/apache2/modules/mod_rpaf.so.bak
apt-get install libapache2-mod-rpaf
This may break other stuff.
2) Manually download, re-compile and install from source, should solve the immediate issue, but you'll hit the same conflicting signature issue if you try to update via apt.
3) Unpack the deb file, hack the hash in the config, repackage and install.

APR based Apache Tomcat Native library was not found on the java.library.path?

When trying to run my app with eclipse/linux on tomcat
I got the following info message:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64:/usr/lib64/xulrunner-addons:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
How do I resolve this issue?
My case:
Seeing the same INFO message.
Centos 6.2 x86_64
Tomcat 6.0.24
This fixed the problem for me:
yum install tomcat-native
boom!
For Ubntu Users
1. Install compilers
#sudo apt-get install make
#sudo apt-get install gcc
2. Install openssl and development libraries
#sudo apt-get install openssl
#sudo apt-get install libssl-dev
3. Install the APR package (Downloaded from http://apr.apache.org/)
#tar -xzf apr-1.4.6.tar.gz
#cd apr-1.4.6/
#sudo ./configure
#sudo make
#sudo make install
You should see the compiled file as
/usr/local/apr/lib/libapr-1.a
4. Download, compile and install Tomcat Native sourse package
tomcat-native-1.1.27-src.tar.gz
Extract the archive into some folder
#tar -xzf tomcat-native-1.1.27-src.tar.gz
#cd tomcat-native-1.1.27-src/jni/native
#JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/
#sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
#sudo make
#sudo make install
Now I have compiled Tomcat Native library in /usr/local/apr/libtcnative-1.so.0.1.27 and symbolic link file /usr/local/apr/#libtcnative-1.so pointed to the library
5. Create or edit the $CATALINA_HOME/bin/setenv.sh file with following lines :
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
6. Restart tomcat and see the desired result:
Download the appropriate APR based tomcat native library for your operating system so that Apache tomcat server can take some advantage of the feature of your OS which is not included by default in tomcat. For windows it will be a .dll file.
I too got the warning while starting the server and you don't have to worry about this if you are testing or developing. This is meant to be on production purposes.
After putting the tcnative-1.dll file inside the bin folder of Apache Tomcat 7 following are the output in the stderr file,
Apr 07, 2015 1:14:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
Apr 07, 2015 1:14:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 07, 2015 1:14:14 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
Apr 07, 2015 1:14:14 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-127.0.0.1"]
I resolve this (On Eclipse IDE) by delete my old server and create the same again. This error is because you don't proper terminate Tomcat server and close Eclipse.