‘linux’ Archive

Compilation Fun

30 March 2008 21:53

Building a new server today with a CLAMP installation. ColdFusion, Linux, Apache, MySQL and PHP.

Server in question was a RHES4 server. Going to install the following apps:

  • ColdFusion 7.0.2 (CU3)
  • apache 2.2.8
  • MySQL 5.0.51a
  • PHP 5.2.5

Suppose to be a quick job, but, oh no.

First up the server already had a MySQL 4.1 RPM installed which was causing some issues. When trying to do a straight update it failed.

rpm -Uvh MySQL-server-community-5.0.51a-0.rhel4

You can’t remove it with rpm -e either. After some Google love discovered that it’s some issues with compatibility. So off to the MySQL site again to wget the shared-compat RPM.

rpm -Uvh MySQL-shared-compat-community-5.0.51a-0.rhel4

Now the server will upgrade just fine. Next up get the client libraries and headers installed (we’ll need them for the PHP compile later).

rpm -Uvh MySQL-devel-community-5.0.51a-0.rhel4 \
rpm -Uvh MySQL-client-community-5.0.51a-0.rhel4

I’ll skip the crap about getting it running for now. Next up is apache.

Pretty easy compile this one, probably don’t need rewrite and deflate separate but did it anyway.

./configure \
--prefix=/usr/local/apache2 \
--enable-mods-shared=most \
--enable-rewrite \
make install

Quick check that it runs and then onto PHP.

./configure \
--prefix=/usr/local/apache2/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr \
--with-config-file-path=/usr/local/apache2/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
make clean;
make install

The key stage is the make clean. For some odd reason if you don’t make clean first you get an error like the following, the make clean will stop this happening.

httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: zend_ini_string

ColdFusion should be easy, will probably need to recompile the connector again but hey… that’s the fun, I think.

Filed: Technology // Tagged: , // No Comments

mod_gzip is your friend

25 January 2007 13:15

To save bandwidth on one off the servers I look after I decided to implement mod_gzip.

The server in questions is running RedHat ES3, apache 1.3.37, Coldfusion 7.0.2 and has the cPanel/WHM control panel.

First off was to get mod_gzip compiled, now this can be done manually, download a pre compiled one or in my case just go into WHM and rebuild apache with the mod_gzip box checked. The version it puts in is

As I’d already got Coldfusion running on this webserver the resulting httpd.conf file it creates became invalid so I had to move a few things about. To cut to the chase the order in which modules load is crucial with Coldfusion due to the was the mod_gzip and mod_jrun modules work intercepting requests. The following is my httpd.conf (abbriviated) with the relevant sections.

LoadModule ...
LoadModule jrun_module /usr/local/coldfusionmx7/runtime/lib/wsconfig/1/mod_jrun.so
<IfModule mod_jrun.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ssl false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore /usr/local/coldfusionmx7/runtime/lib/wsconfig/1/jrunserver.store
JRunConfig Bootstrap
#JRunConfig Errorurl <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600
#JRunConfig ConnectTimeout 15
#JRunConfig RecvTimeout 300
#JRunConfig SendTimeout 15
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
LoadModule gzip_module libexec/mod_gzip.so
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static No
mod_gzip_command_version '/mod_gzip_status'
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 500
mod_gzip_maximum_file_size 500000
mod_gzip_maximum_inmem_size 60000
mod_gzip_min_http 1000
mod_gzip_handle_methods GET POST
mod_gzip_item_exclude file .js$
mod_gzip_item_exclude file .css$
mod_gzip_item_exclude file .swf$
mod_gzip_item_exclude mime ^image/
mod_gzip_item_include file .php$
mod_gzip_item_include file .cfm$
mod_gzip_item_include file .jsp$
mod_gzip_item_exclude file .pdf$
mod_gzip_item_include file .fic$
mod_gzip_item_include file .html$
mod_gzip_item_include file .htm$
mod_gzip_item_include mime ^text/html
mod_gzip_item_include mime ^text/plain
mod_gzip_item_include mime ^text/xml
#mod_gzip_item_include mime ^application/force_download$
#mod_gzip_item_include mime ^application/pdf$
mod_gzip_item_include handler type-coldfusion
mod_gzip_item_include handler jrun-handler
mod_gzip_dechunk Yes
#then the logging directives
LogFormat "%h %l %u %t "%V %r" %<s %b mod_gzip: %{mod_gzip_result}n In:%{mo
d_gzip_input_size}n -< Out:%{mod_gzip_output_size}n = %{mod_gzip_compression_rat
io}n pct." common_with_mod_gzip_info2
CustomLog "logs/mod_gzip.log" common_with_mod_gzip_info2
mod_gzip_add_header_count Yes
mod_gzip_send_vary On
AddType type-coldfusion .fic
AddModule ...
AddModule mod_jrun.c
AddModule mod_gzip.c

In my test case I had a page show as 18224 bytes originally which compressed down to 3956 bytes a saving of 14268 bytes or 79%! To test the compression I was using the port80software.com compression check. You can also see this site’s report.

More Information (stuff I read):

Filed: Technology // Tagged: , , , , // No Comments

Recompile Apache 1.3.x connector

31 October 2006 19:21

If you’re running Apache 1.3.x and Coldfusion 7 you might have had errors when starting apache about needing to compile it using DEAPI.

[warn] Loaded DSO /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun.so uses
plain Apache 1.3 API, this module might crash under EAPI!
(please recompile it with -DEAPI).

The original Adobe technote 18748 worked with CF6 as I’ve followed it before, but, with CF7 once compile and you try and start apache you get a crazy hex error, like this:

Cannot load /opt/coldfusionmx7/runtime/servers/lib/wsconfig/1/mod_jrun.so into
server: /opt/coldfusionmx7/runtime/servers/lib/wsconfig/1/mod_jrun.so: undefined symbol: hexstrtol

A quick google found this site with a script on how to do it. Now one note on the guide is he’s building a mod_jrun20.so file for apache 2, quick vi to change them all to mod_jrun.so and you’re all good.

So, big thanks to that guy for posting his script. Mine is included below for reference.

export CFMX=/opt/coldfusionmx7
export APACHE_PATH=/usr/local/apache
#CFMX connector path eg $CFMX/runtime/lib/wsconfig/1
export CFMX_CONNECTOR=$CFMX/lib/wsconfig/1
#stop apache
$APACHE_BIN/apachectl stop
${APACHE_BIN}/apxs -c -Wc,-w -n jrun -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun.c
jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c
jrun_utils.c jrun_mutex.c jrun_proxy.c jrun_ssl.c
${APACHE_BIN}/apxs -i -n jrun -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun.la
strip $CFMX_CONNECTOR/mod_jrun.so

Mine did error saying:

apxs:Error: file mod_jrun.la is not a DSO

but it all works.

Filed: Technology // Tagged: , , , // No Comments

ColdFusion MX 7 Linux Install Errors

25 October 2006 11:14

Came across this the other day on a new server I was building.

$ ./coldfusion-702-lin.bin

Preparing to install…

Extracting the JRE from the installer archive…

Unpacking the JRE…

Extracting the installation resources from the installer archive…

Configuring the installer for this system’s environment…

Launching installer…

./coldfusion-702-lin.bin: line 2317: /tmp/install.dir.31481/Linux/resource/jre/bin/java: Permission denied

./coldfusion-702-lin.bin: line 2317: /tmp/install.dir.31481/Linux/resource/jre/bin/java: Success

The workaround is set the IATEMPDIR variable
mkdir /opt/IATEMPDIR

Taken from LiveDocs

Filed: Technology // Tagged: , // No Comments

Coldfusion 6.1 Linux Hotspot Crashes

13 January 2006 22:12

Had another hotspot crash on a Linux server again today after months of not having any. Doing a bit of googling and finding myself back on Steven Erat’s very useful blog I found a user comment saying that in Sun’s JRE 1.4.2_10 they seem to have fixed the problem. As a result I’ve updated it along with a couple of hotfixes to CF and all seems well.

You can get the JRE from Sun’s Java site.

Filed: Technology // Tagged: , , , // No Comments

eximstats failed

13 January 2006 22:11

If you’ve got a Linux box running Cpanel/WHM and you’ve updated recently you may now have eximstats failed and also noticed some DBD::MySQL errors in the process. Quick fix which worked for me is:

/scripts/realperlinstaller –force DBD::mysql
/etc/init.d/chkservd restart

Filed: Technology // Tagged: // No Comments

Twitter   •   About   •   Contact
©2017 Ian Winter. All Rights Reserved.   •   Powered by WordPress   •   Hosted at Memset