Re: El Capitan Apache Seg Fault
Re: El Capitan Apache Seg Fault
- Subject: Re: El Capitan Apache Seg Fault
- From: Jeff Schmitz <email@hidden>
- Date: Fri, 27 Nov 2015 12:55:51 -0600
Thanks to help from Patrick Middleton I did get up and running on El Capitan. Below is a fairly long synopsis of my journey, warts and all. Hopefully it can help someone else out:
My notes on upgrading from Lion to El Capitan on a remote server:
The first issue I hit was I lost contact to my server since the upgrade changed my network settings to use DHCP instead of my static IP. I had to call a technician and had him reset my network settings to use the proper static IP so I could remote access to the box again.
Once I got access again my first questions was whether to install the new Server app. In the end I didn’t need to, and I was worried doing so may write over the existing macports apache setup when it installed its web sharing services.
Once logged in I saw that my existing WebObjects installation had been deleted, i.e. there was no longer a /System/Library/WebObjects directory.
Next I decided to use the directions here: https://wiki.wocommunity.org/pages/viewpage.action?pageId=1049031
NEXT QUESTION: How do I decide which WebObjects installer to use? WebObjects WOCommunity resources or the apple installer?
First try, try the Apple Installer.
NEXT QUESTION: At https://wiki.wocommunity.org/pages/viewpage.action?pageId=1049031
It says: Make sure you install "WebObjectsRuntime.pkg" which is in the "Packages" directory of the .dmg.
Is this in addition to the main webobjects pkg, or do you only install the runtime.
I went ahead and installed just the runtime. Funny that El Capitan says the publisher of this software can not be trusted.
It also gave this warning saying the package is incompatible with this version of OS X and mail fail to install.
I went ahead and said to install anyway got a fatal error. So… I tried the WOInstaller route. I downloaded and did java -jar WOInstaller.jar and found out I didn’t have a java version installed. I guess ElCapitan deleted the one I had on.
Off to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to get the latest jdk.
Thinking maybe the apple installer failed because of no java I tried it again but it failed the same way.
On to trying the WOCommunity installer. It requires an alternate installation directory to be specified. I used /opt and specified version 5.4.3:
sudo java -jar WOInstaller.jar 5.4.3 /opt
Everything went well, and since I installed in /opt, maybe next time I upgrade Mac OS, webobjects won’t get stomped on by Apple.
Now with webobjects installed, I was able to bring up the previously installed (under Lion) java monitor and wotaskd via localhost. The apps even started up. However, I was unable to reach them via http due to apache segmentation faults when trying to serve any webobjects app.
Next I decided to update the macports apache with the following commands:
sudo port -d selfupdate
sudo port upgrade outdated
No luck, still getting segmentation faults.
After some research I’d seen a few things about MPM worker vs prefork that says to run with MPM prefork. When I did a httpd -V I got:
Server version: Apache/2.2.31 (Unix)
Server built: Nov 25 2015 11:47:12
Server's Module Magic Number: 20051115:40
Server loaded: APR 1.5.2, APR-Util 1.5.4
Compiled using: APR 1.5.2, APR-Util 1.5.4
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP…
So looks like I was running prefork.
Next… Going back over some other similar list emails I noticed someone was using apache 2.4 and a new mod_Webobjects adaptor. What! Great, time to find it and install it and update apache and see what happens.
I found this page on how to upgrade macports apache to 2.4:
http://apple.stackexchange.com/questions/130481/how-to-upgrade-apache-2-2-to-2-4-in-macosx-mavericks
https://httpd.apache.org/docs/2.4/upgrading.html
From the above links I tried the command:
sudo port -vsc install apache24-devel
rebooted the machine just to make sure and then printed out the version info:
netbrackets1:~ netbrackets$ httpd -V
Server version: Apache/2.4.17 (Unix)
Server built: Nov 25 2015 22:03:31
Server's Module Magic Number: 20120211:51
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/local"
-D SUEXEC_BIN="/opt/local/bin/suexec"
-D DEFAULT_PIDLOG="var/run/apache2/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="etc/apache2/httpd.conf"
Everything looks good, still prefork, but version is now 2.4.17. Note:
-D SERVER_CONFIG_FILE=“etc/apache2/httpd.conf"
Thinking this was referencing a file at /etc/apache2/httpd.conf, which I had and that had previously been updated to add the webobjects stuff, I thought great. However, now when I went to localhost, instead of serving the /Library/WebServer/Documents/index.html page, it was serving a page that just said “It works!”. I went to httpd.conf above and DocumentRoot was /Library/WebServer/Documents. Huh?
Turns out that since “etc/apache2/httpd.conf” didn’t have the leading /, it was a relative path, with the base path being “/opt/local”, so the actual config file it was using was:
/opt/local/etc/apache2/httpd.conf
This one cost me several hours as I played with the other conf file to try and get it to change DocumentRoot. anyway, I finally figured it out and moved on.
So… I was still getting segmentation faults when serving webobjects apps. At this point I posted a question to the list, and Patrick Middleton was kind enough to help out. Here’s some out takes from a question and answer session I had to try and figure things out:
———————————-
Patrick: Why are you not using the system-supplied Apache 2.4.x?
Me: I had seen where web sharing was no longer included with the straight El Capitan, so assumed since I hadn’t bought the server app that it wasn’t included. I had previously been using macports to avoid the Mac OS updates wiping out all the webobjects http config stuff and using /Library/Server/Web… with every upgrade, so I kept using that.
Patrick: What modules is your Apache loading that were not built via MacPorts when building 2.2.31
Me: I’m not sure how to answer that. I’m guessing one of them would be the webobjects module which I re-downloaded from:
http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.2/macosx/10.6/mod_WebObjects.so
Also, I used the below two commands to update the macports modules:
sudo port -d selfupdate
sudo port upgrade outdated
And finally, I just stumbled on this:
https://github.com/wocommunity/wonder/tree/master/Utilities/Adaptors/Apache2.4
Perhaps I need to follow these directions and build mod_webobjects from scratch? Except they are from 2006 so I’m a little wary...
—————————————
Patrick referenced a different conversation in the email list that contained more help.
From that conversation I got a link to the apache2.4 compatible binary:
https://www.dropbox.com/s/zxdbp1wbfx4uyuc/mod_WebObjects.so?dl=0
After updating the adaptor the segmentation faults were gone but I was getting a “You don’t have permission to access … on this server” error.
The fix for this was to update the httpd.conf file as noted below.
After updating the correct httpd.conf file as summarized below, things started working. Although the webobjects adaptor binary seems to be working for me, Patrick strongly recommended that I build it myself, so be warned:
————————————————
SUMMARY OF CONFIG FILE CHANGES NEEDED AFTER:
UPDATING FROM LION TO EL CAPITAN
DOWNLOADING THE ABOVE WEBOBJECTS ADAPTOR MODULE
USING MACPORTS APACHE 2.4
HAVING INSTALLED WEBOBJECTS INTO /opt/System/Library/WebObjects
Apache 2.4 Version info:
-D SERVER_CONFIG_FILE=“etc/apache2/httpd.conf"
NOTICE THAT etc IS RELATIVE (PATH DOESN’T START WITH /). This equates to full path of /opt/local/etc/apache2/httpd.conf!!!!
In this httpd.conf, need to update per existing 2.2 httpd.conf except change /System/Library/WebObjects references to /opt/System/Library/WebObjects since the Wonder installer installed webobjects there, which should make it safe from future Mac OS updates.
Need to make same changes in the referenced:
/opt/System/Library/WebObjects/Adaptors/Apache2.2/apache.conf
e.g. LoadModule WebObjects_module /opt/System/Library/WebObjects/Adaptors/Apache2.2/mod_WebObjects.so
Had to update the httpd.conf with following:
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options FollowSymLinks
AllowOverride None
# Order deny,allow
# Deny from all
</Directory>
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"
<Directory “/Library/WebServer/CGI-Executables">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
——————————————-
> On Nov 25, 2015, at 6:50 PM, Jeff Schmitz <email@hidden> wrote:
>
> Hello List,
> I’m in the process of upgrading a server to El Capitan and apache is giving me the below segmentation fault whenever I try to bring up a page on my application:
>
> [Tue Nov 24 23:19:32 2015] [notice] child pid 97433 exit signal Segmentation fault (11)
>
> I’ve seen a few things about MPM worker vs prefork that says to run with MPM prefork. When I do a httpd -V I get:
>
>
> Server version: Apache/2.2.31 (Unix)
> Server built: Nov 25 2015 11:47:12
> Server's Module Magic Number: 20051115:40
> Server loaded: APR 1.5.2, APR-Util 1.5.4
> Compiled using: APR 1.5.2, APR-Util 1.5.4
> Architecture: 64-bit
> Server MPM: Prefork
> threaded: no
> forked: yes (variable process count)
> Server compiled with....
> -D APACHE_MPM_DIR="server/mpm/prefork"
> -D APR_HAS_SENDFILE
> -D APR_HAS_MMAP…
>
> So I think i am running prefork, and I couldn’t find anything in httpd.conf that looks like it overrides the default.
>
> Note that I’m currently running a version of Apache installed by MacPorts.
>
> Is there anything else that might cause this?
>
> Also I was wondering is there any reason to buy the El Capitan Server application if I’m only using this machine for deployment?
>
> Thanks!
> Jeff
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden