Should you grow tired of waiting on the people at cPanel to figure this whole Apache 2 thing out and, decide in the mean time you will update to Edge; You are about to go for a ride around the Internet, My Friend.
Getting cPanel to cooperate with Apache 2 is a choir in itself but; Getting Apache2 to work with Ruby on Rails is another ride around the Information Super Highway.
Using easyapache after updating to Edge was only successful for me until after I reinstalled CentOS on the VPS; Along with a fresh installation of cPanel. I opted this easy way out after I had spent hours with easyapache trying to install Apache 2 for whatever reason it wanted to try interpreting the settings from my old httpd.conf to the new httpd.conf. It either didn’t like the modules or it didn’t like the configuration or every single time I tried there was something not going right.
After reinstalling my VPS and cPanel running easyapache from Edge was a success the first time. However, this was a false hope. Upon trying to install Ruby on Rails using FastCGI with Apache 2 I didn’t find much documentation or, enough to keep me from seeing the alternative to mod_fastcgi. The alternative I came across was Mongrel which required Apache to rely on mod_proxy to control this traffic accordingly.
Apache does not include this module by default and, cPanel doesn’t give you the option to include mod_proxy as a shared module when using easyapache.
My suggestion is; You should run easyapache with the minimum amount of inclusions from easyapache to ensure the transition will not have hiccups. Once you have gotten Apache 2 working via easyapache; Download the same version of httpd from the Apache Web Site and mirror the options which easyapache made during your initial Apache 2 setup and include mod_proxy as a shared module (--enable-mods-shared="") Using apxs to compile the module didn’t seem to get the job done.
Some of the modules can’t be included during Apache’s build so I had to use apxs for some of the modules required by Mongrel. Below is what I used to recompile Apache.
# ./configure --prefix=/usr/local/apache2_2 --sysconfdir=/usr/local/apache/conf --enable-so --enable-dav --enable-dav-fs --enable-dav-lock --enable-suexec --with-suexec-logfile=/usr/local/apache/logs/suexec_log --with-suexec-caller=nobody --with-suexec-uidmin=100 --with-suexec-gidmin=100 --with-suexec-docroot=/ --with-suexec-userdir=public_html --enable-logio --enable-ssl --enable-rewrite --with-ssl=/usr --enable-unique-id --enable-deflate --enable-auth-anon --enable-headers --enable-mods-shared="proxy proxy_http proxy_connect headers deflate"
You will need to use apxs to install both proxy_balancer_module and proxy_http_module. Which requires downloading this file and including the location of libxml2 when you compile it.
# ./apxs -c -I/usr/include/libxml2 -i mod_proxy_html.c
Check /usr/local/apache/conf/httpd.conf to make sure if the module was loaded and it included libxml2. Here is a sample of what it should look like.
LoadFile /usr/lib64/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
You will also need to use apxs for proxy_balancer.
# ./apxs -i -a -c mod_proxy_balancer.c
Now restart Apache if there aren’t any errors, Start working on Mongrel. I will include instructions for that tomorrow.
Technorati Tags: cPanel - Apache - Ruby - Rails - Tutorial - Howto