imagemagick segmentation fault after apache graceful restart - apache

We are using ImageMagick via imagick to generate a file containing many SVG files in it. The script tries to make them fit as much as possible in order to avoid large empty spaces so it is kind of a heavy task.
Everything went OK until we decided to install netdata on the server to monitor it, we can't say netdata is the cause of this 100% but we're pretty sure this started after installing it.
Now after every apache graceful restart we're getting segmentation fault errors but ONLY when trying to generate a file with "multi color" SVGs, everything works ok when generating a file with "plain color" SVGs.
The problem disappears if we restart apache (sudo service httpd restart).
Our theory is that restarting apache grafecully leaves an apache child thread hanging and crashes when trying to use it or something.
We tried reinstalling ImageMagick and imagick but nothing changed, we stopped netdata since we noticed this and tried to debug using gbd (it ended up slowing apache and making it difficult to restart it) and we could not find anything useful. I'm thinking in update libgomp (installed version is 4.8.5 4.el7 and with yum info I've seen the version 4.8.5 28.el7) but I'm not sure if it can cause problems in other parts of the system
Not sure if this is related to this site but any of you have seen anything like this?
Thanks
Server specifications:
CentOS 7.0.1406
Apache/2.4.6 (CentOS)
PHP/5.6.26
ImageMagick 6.7.8-9 2016-06-16 Q16
imagick 3.4.3

Related

Ubuntu on WSL doesn't launch

I have installed Ubuntu 18.04 for windows subsystem for linux on windows 10, after enabling WSL in Powershell (instructions here: https://learn.microsoft.com/en-us/windows/wsl/install-win10).
I've done this before on a desktop but now I'm doing it on a laptop. I had no issues with the previous installation but this time around ubuntu will not launch. I get the ubuntu console popping up briefly before disappearing.
Also trying to run bash.exe from the command line fails silently (doesn't hang, just exits with no message), which may be related.
I'm struggling to figure this out as I have no idea where any error messages might be logged. Does anyone know how I can investigate further why this is happening?
Setup is a windows 10 Pro, os build 17134.376, everything up to date.
I'm struggling to figure this out as I have no idea where any error messages might be logged. Does anyone know how I can investigate further why this is happening?
Check with wslconfig.exe /l all registered distros, try to deregister the one you have problem with ( e.g. wslconfig.exe /u Ubuntu [^1]) and run the ubuntu.exe in your distro once again. Just a wild guess, it might be also a problem, if you have more than one copy of the linux distribution in you home directory.
[^1]: Warning: deregistering will delete all the associated files!

Issue when trying to run passenger on Apache

I am getting this issue when running
httpd -t
httpd: Syntax error on line 545 of /private/etc/apache2/httpd.conf: Syntax error on line 1 of /private/etc/apache2/other/passenger.conf: Cannot load /Users/sbaidon/.rvm/gems/ruby-2.2.5/gems/passenger-5.3.5/b
uildout/apache2/mod_passenger.so into server: dlopen(/Users/sbaidon/.rvm/gems/ruby-2.2.5/gems/passenger-5.3.5/buildout/apache2/mod_passenger.so, 10): no suitable image found. Did find:\n\t/Users/sbaidon/.rv
m/gems/ruby-2.2.5/gems/passenger-5.3.5/buildout/apache2/mod_passenger.so: code signature in (/Users/sbaidon/.rvm/gems/ruby-2.2.5/gems/passenger-5.3.5/buildout/apache2/mod_passenger.so) not valid for use in p
rocess using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.\n\t/Users/sbaidon/.rvm/gems/ruby-2.2.5/gems/passenger-5.3.5/buildout/apache2/mod_passen
ger.so: stat() failed with errno=22
Passenger installation is just fine.
I ran into this too: the issue is that the built-in httpd that comes with macOS Mojave has Library Validation turned on, which means any modules it loads must be properly signed. Unfortunately, mod_passenger.so is not signed, so loading fails. Actually, a lot of people are having this problem with loading Apache modules on macOS Mojave (especially during the beta), some example references:
https://github.com/GrahamDumpleton/mod_wsgi/issues/357
https://github.com/phpredis/phpredis/issues/1406
I believe it's possible to set up a plist somewhere to give an entitlement to httpd to disable library validation (com.apple.security.cs.disable-library-validation) as described at https://developer.apple.com/documentation/security/com_apple_security_cs_disable-library-validation. For instance, here's a recent WebKit patch where they add it to allow plugin loading: https://bugs.webkit.org/show_bug.cgi?id=183252. Similarly, here's the Mozilla people talking about how they need to enable this (and other) properties: https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=1470597.
Unfortunately, I don't do macOS development (I just do development on macOS) and I have absolutely no idea how to apply it to the built-in Apache, I'm sorry.
At this point I'm kind of sick of every major macOS update nerfing all my httpd settings and generally being a pain (it's infrequent but it's still annoying), so I'm doing what I should have done years ago: stop using the built-in httpd that comes with OS/X and just use Homebrew httpd.
Here's some instructions I found regarding setting up Homebrew httpd (and disabling the built-in macOS httpd), it's pretty straightforward and you don't have to follow all of the directions about multiple PHP versions etc: https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions
If someone can figure out how to disable Library Validation in the built-in httpd, or if there is some way to provide signing on mod_passenger.so (seems unlikely since both the Homebrew and gem passenger need to be buildable from source), you don't need to junk the built-in httpd. But I personally think the best solution is to move away from it entirely and use the Homebrew version instead.
For anyone having this issue or any issue with library validation in macOS Mojave, I found an incredibly easy fix to disable it. https://github.com/mologie/macos-disable-library-validation
This is fixed in macOS 10.14.4

XAMPP Can't Start Apache After Upgrading to PHP7.1.17 "Attempting to start Apache service..."

I have XAMPP installed on Windows 7 virtual machine. My old PHP version was 7.0.9 with Apache 2.4
I needed to upgrade the PHP version to 7.1.x and I set out reading about how to best to this. In end, I settled with the simple plan:
Stop Apache service
Downloaded new PHP version from official php website. For PHP 7 the 7.1.17 version was listed. I downloaded the thread safe version, as my Apache has thread safety enabled.
I extracted the contents of the downloaded archive to a folder.
I copied and replaced all files in the appropriate folders from C:/Server/php with the new php version files from the extracted archive.
I attempted to start Apache from the XAMPP control panel and the server will not start.
The message "Attempting to start Apache service..." just hangs and nothing happens.
The last entry in the error.log file in C:\Server\apache\logs shows the event when the server was stopped and that's it.
When I check the php version from CLI with the command php -v, the console returns installed php version 7.1.17
I tried different suggestions I read from similar questions, like changing ServerName localhost:80 to ServerName localhost:8080 and copying php7apache2.dll to apache/bin ( as suggested here: Upgrading PHP in XAMPP for Windows? ), alas the issue is not fixed and Apache does not start.
Of course, I also restarted the virtual machine, all the same.
At this point, I'm dumbfounded. Don't know what to do.
I need to get Apache running with php 7.1, as it is required by Magento 2.2.4. I do not want to reinstall XAMPP, as this will be a lenghty process with a lot of risk for more things to go wrong.
Any help is much appreciated!
Alright, so after checking Windows Logs > Application in Event Viewer I saw the error ".. the Apache service named is not a valid win32 application". I downloaded the x86 version of PHP from official website PHP for Windows
Then copied and replaced files as described above, and Apache started successfully.
To see if your Apache version is x64 or x86 open command prompt and cd to your Apache bin directory, in my case C:/Server/apache/bin , then run:
file httpd

Ubuntu 16.04 Apache2 PHP7.0 doesn't interpret php commands

I searched the web and found that many people have issues with php7 on Ubuntu 16.04 but I have a slightly different experience.
Problem in short: I upgraded from 12.04 to (first to 14.04) 16.04 and now everything works except Apache2 with PHP7.
The problem: When I create php file like
Hello
<?
echo " World!";
?>
and access it through the browser, the browser renders the "Hello" but not the "World". So basically Apache knows that it's a php file (otherwise the file would be downloaded instead of shown) but doesnt interpret it.
Oh and it doesn't show the php code either (this is what's different in my problem compared to other asked questions).
I had PHP7 installed from a different ppa (ondrej) before but that also didn't work. I completely removed all the packages and PPAs from my sources and now I have only my Ubuntu sources left, I also completely purged all php and apache related packages, including any config under /etc/apache2 and /etc/php. This includes:
php*
php7.0*
libapache2-mod-php7.0
libapache2-mod-php
apache2*
I even removed the apt cache with apt-get clean and apt-get autoclean.
After I purged everything I reinstalled apache and php via
apt install apache2 libapache2-mod-php7.0 php7.0
I checked the mods enabled, php7.0 is enabled, restarted apache, even restarted the whole machine just to be sure but I can't get it to work.
Please don't tell me to reinstall Ubuntu because I want to understand what the problem is instead of just taking the easy way out, also everything else runs fine and I really, really don't want to reinstall all other software again since this is my development machine.
Is there any config file I have overlooked? I mean I completely purged the packages and the configs. /etc/apache2 and /etc/php were properly deleted after the purge.
Oh and also strange: Since the Update I cannot access files without the file extension. Before http://localhost/info would bring me to http://localhost/info.php automatically. Any hints?

Apache Web Development on Cygwin

I'm trying to get an Apache server running on my Cygwin setup to follow the Java Ranch Cattle Drive tutorials online (basically, to learn Java EE web page development that uses a MySQL back end.)
I used the Cygwin Setup program to install httpd (which is how I installed most other dev tools I use on cygwin) and it says install complete, yet when I run 'httpd' it cannot find the command. It also appears the expected install directory (/usr/local/apache...) doesn't exist.
Does anyone have any experience using this setup, and if so, you could walk me through the initial steps of getting the server up and running and getting a browser to display the server's default page?
To keep answers focused, I didn't want to discus the drawbacks of running Apache on a Windows system - this is just for learning purposes. Thanks in advance.
Looking at the Cygwin Package Listing for httpd, you can see that the executable is installed under /usr/sbin.
So, if /usr/sbin is not on your PATH (it isn't on mine, not by default anyhow), you would actually run:
/usr/sbin/httpd
And btw, if you would like to list the files installed for a certain package, you can use cygcheck:
cygcheck -l httpd
cygrunsrv -I Apache -p /usr/sbin/httpd -a "-X"
This will solve the problem. This assumes you already have cyrunsrv set up. The reason httpd fails with cygrunsrv if you leave out the -X is that the process disconnects from the terminal and cygrunsrv considers that a failure. The -X option for httpd is the debug or terminal mode.
I couldn't find any detailed information on how to get Apache working on Cygwin, so here it is if someone's interested:
Install the httpd-* and httpd-mod_* packages you need. Note that the packages named "Apache" are deprecated. You need the ones named "httpd" (which are actually Apache).
Install cygrunsrv (normally this is a default Cygwin package)
Run /usr/bin/cygserver-config as admin. This is needed because Apache requires an IPC server running.
Open services.msc, then go to the CYGWIN Cygserver. Right-click on it and start it. If you don't do this, you'll probably get errors like "AH00023: Couldn't create the proxy mutex".
Finally, start Apache by running /usr/sbin/apachectl restart
Config is in /etc/httpd/.
Some information about running Apache on Cygwin:
http://httpd.apache.org/docs/1.3/cygwin.html
http://www.issociate.de/board/goto/895433/apache2_does_not_start_in_cygwin.html
http://www.cygwin.com/ml/cygwin-apps/2005-02/msg00085.html
Personally, I would recommend installing WAMPServer or other WAMP stack and do it that way. There is no difference, except that you'll need to control Apache through Windows commands [net start, net stop], not Cygwin's ones.