Attempting to upgrade to Zend Server 6.0.1 - zend-server

I am currently running Zend Server 5.6.0 (PHP 5.3) on a Red Hat Enterprise Linux Server release 6.4 (Santiago)
I am looking to upgrade to Zend Server 6.0.1 but whether I try it automatically (through the install_zs file) or manually (editing the /etc/yum.repos.d/zend.repo) I get the same message.
# yum update
...
Error: Package: zend-server-php-5.3-6.0.1-662.x86_64 (Zend)
Requires: /usr/sbin/semanage
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I am reluctant to use --skip-broken as I feel it would cause issues.
I will point out that SELinux is installed on the server, but is disabled. I verified this by editing the /etc/selinux/config file.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
The file /usr/sbin/semanage does not exist. The digging around I've done to find out why has led me to install SELinux, however it is installed and of the latest version.
Has anyone else had this problem?

It looks like upgrading zend-server-php requires SELinux installed and working, probably because of changing selinux rules after upgrading.
Try following steps:
set premisibe mode of selinux, (SELINUX=premissive)
let the type targeted (SELINUXTYPE=targeted)
enable selinux (SELINUX=enabled)
reboot
upgrade your system
switch the SELinux off, if you do not want to use it

Following on from my comment on the previous post it seems SELinux isn't as simple as turning it back on
After following these instructions I still received the same error, so I attempted to install semanage, however I could not replicate the process.
I ended up putting a support ticket in to the hosting company who managed to install semanage.
Zend Server 6.0.1 now installed!

Related

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

imagemagick segmentation fault after apache graceful restart

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

How to install mod_cloudflare for easyapache 4

I am trying to install mod_cloudflare for Apache using easyapache 4 on cPanel Server. I am running CentOS 7.2.
I have installed mod_cloudflare for EasyApache4 following the instructions under Option 2 here. After running the installer it said "Done. Please restart EasyApache 4". I then went into WHM -> EasyApache 4 and tried to find the server module, but it is not to be found. I clicked the "run system update" button and tried again, to no avail. Is there an easyapache service that needs to be restarted via the command line?
I am not a hosting provider so I have not tried the Cloudflare plugin for CPanel.
* Edit 4/9/2019 *
Changing accepted answer to EasyCo's, as the original solution no longer works.
Figured I'd throw my solution into the mix using Centos 6.9 with WHM/cPanel.
bash <(curl -s https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/installer.sh)
wget https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/mod_cloudflare.c
yum install ea-apache24-devel
apxs -a -i -c mod_cloudflare.c
rm /etc/apache2/conf.modules.d/mod_cloudflare.conf
service httpd restart
What's happening?
We're using the cPanel installer.sh as suggested by Cloudflare but the compiled mod_cloudflare.so throws an error if you then run service httpd restart. Lets fix this.
Download the source mod_cloudflare file.
Ensure we have the correct EasyApache4 developer tools to build the mod_cloudflare module.
Build and install extension module.
Remove the new mod_cloudfare.conf file since we prefer the one that was generated and installed in step 1.
Restart apache.
Note: The mod_cloudflare module will not show in EasyApache4. You can see it's enabled by running httpd -M | grep cloudflare and you should see something like cloudflare_module (shared).
References:
https://www.cloudflare.com/technical-resources/
https://community.cloudflare.com/t/help-installing-mod-cloudflare/1747/12
http://www.marathon-studios.com/blog/issues-installing-mod_cloudflare-on-centos-7/
https://forums.cpanel.net/threads/install-httpd-devel.594631/#post-2405975
I found a solution that worked perfectly.
This github project installs the module and adds it into EasyApache so that future rebuilds keep the module active. This was the only solution I found that actually works for EasyApache 4. Everything else seems to be for EasyApache 3.
CloudFlare was not much help with this either, as they had suggested I contact my hosting provider for assistance.
I know this is a bit old now, but it's the first answer that shows up in google.
The official cloudflare answer does work, it just doesn't show up in the EA4 list of modules. However it is installed and working.
Just for others like me that reached here recently, mod_cloudflare module is deprecated and there is a native module for apache [mod_remoteip]. I can see it in EasyApache (apache module section). Also There is a manual here to install & config :
https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs
with this module you can see Client IP through
$_SERVER['REMOTE_ADDR']
And there is no need to
$_SERVER['HTTP_CF_CONNECTING_IP']
Instructions for installing mod_cloudflare on cPanel with EasyApache4 can be found here:
https://support.cloudflare.com/hc/en-us/articles/206175737-How-do-I-restore-original-visitor-IP-with-EasyApache-cPanel-
bash <(curl -s https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/installer.sh)

Apache version 2.2 and security vulnerabilities

A penetration test has recently identified that one of our RHEL(6.7) servers running Apache 2.2.15 is vulnerable on a number of points and needs to be updated to the latest version 2.4. I have run yum update and it says that there are no packages marked for update. I understand that I will need to download the updates manually. There are a few questions I have around the requirement to upgrade Apache.
I am up to date on the 2.2 version tree. Does this mean that any security patches made to version 2.4 will be back patched to version 2.2.X as well?
I am running PHP (version 5.3.3) and MySQL (version 5.1.73) - will these be affected by upgrading the Apache version (Google tells me that there is no problem on both fronts - but I thought I'd ask before I started down this route).
If you experts tell me that I have no other choice but to upgrade, then I'm planning on using the instruction set here: https://unix.stackexchange.com/questions/138899/centos-install-using-yum-apache-2-4
Thank you in advance for your advice.
You could download the 2.4 source code from the Apache site and compile it. There's a setting which will configure for RedHat:
--enable-layout=RedHat
This setting will configure the paths for executables, configuration files, libraries etc in one go.
The following should be a reasonable starting point for a configuration line:
sh ./configure --enable-layout=RedHat --enable-mods-shared=all
then perform a make and make install
Do the same with a newer version of PHP (5.3.29 is available in the "old downloads" section, but try a newer version. Check the changes first though) and your problems should be lessened. Finally, MySQL or MariaDB is available for download and compilation too
Obviously, try all of this on a test machine first and back everything up. Your test machine should be as close as possible to your production machine. If you use something like VirtualBox to try it, you can take a snapshot at each point of the process and rollback if something goes wrong

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.