upgrading apache 2.2 to 2.4 maually because easyapache won't help
I have a server with an old WHM/Cpanel setup and left the server that way for over 10 years. There has been NO hacks against it whatsoever despite thousands of people accessing websites on it.
Today, I need to make a change because I want to adopt TLS 1.3 security just incase TLS 1.2 decides to be obsolete by the time someone answers this post.
So I tried the migrate_ea3_to_ea4 but some files couldn't be downloaded so I did a revert.
Then I used Easyapache 3 to upgrade my apache and that even did not work, however according to the logs it looks like some tarballs were downloaded.
This is my output log when running Easy Apache 3:
!!
Environment State Snapshot (Before RawENV)[ACCEPT_ENCODING]
gzip, deflate, br[CMDLINE]
/usr/local/cpanel/whostmgr/docroot/cgi/easyapache.pl[CONTENT_LENGTH]
[CONTENT_TYPE]
[CPANEL]
active[Cpanel::Form::Param::last_new]
Cpanel::Form::Param=HASH(0x1c86fe0)[DOCUMENT_ROOT]
/usr/local/cpanel/base[GATEWAY_INTERFACE]
CGI/1.1[HTTP_ACCEPT]
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[HTTP_ACCEPT_CHARSET]
[HTTP_ACCEPT_ENCODING]
gzip, deflate, br[HTTP_ACCEPT_LANGUAGE]
en-US,en;q=0.5[HTTP_COOKIE]
CC=eAHzTawICLA1NDCwBgARZQLQ; whostmgrrelogin=no; langedit=; lang=; login_theme=mobile[HTTP_HOST]
(withheld)
[HTTP_REFERER]
[HTTP_STATUS]
200[HTTP_TRANSFER_ENCODING]
[HTTP_USER_AGENT]
(withheld)[IGNORE_WIN32_LOCALE]
1[MALLOC_ARENA_MAX]
1[OPENSSL_NO_DEFAULT_ZLIB]
1[PATH]
(withheld)[QUERY_STRING]
build=1&verbose=1&conf_levels=0&last_seen=6&move_broken_local_templates=1&skip-cpanelsync=1&do_not_revert_on_conf_failure=1&do_not_revert_on_test_failure=1&archive_backup=0&reset_httpd_config_to_default=0[REAL_DBOWNER]
[REDIRECT_STATUS]
1[REMOTE_ADDR]
(withheld)[REMOTE_DBOWNER]
[REMOTE_HOST]
(withheld)[REMOTE_PORT]
(withheld)[REMOTE_USER]
(withheld)[REQUEST_METHOD]
GET[REQUEST_URI]
/cpsess4326023210/cgi/easyapache.pl?build=1&verbose=1&conf_levels=0&last_seen=6&move_broken_local_templates=1&skip-cpanelsync=1&do_not_revert_on_conf_failure=1&do_not_revert_on_test_failure=1&archive_backup=0&reset_httpd_config_to_default=0[SCRIPT_FILENAME]
/usr/local/cpanel/whostmgr/docroot/cgi/easyapache.pl[SCRIPT_NAME]
/cpsess4326023210/cgi/easyapache.pl[SCRIPT_URI]
/cpsess4326023210/cgi/easyapache.pl[SERVER_ADDR]
(withheld)
[SERVER_NAME]
(withheld)[SERVER_PORT]
2086[SERVER_PROTOCOL]
HTTP/1.1[SERVER_SOFTWARE]
cpsrvd 11.52.2.5[SUBID]
[TERM]
linux[TRANSFER_ENCODING]
[TZ]
America/Toronto[UPLINK]
[cp_security_token]
/cpsess4326023210!!
!! Local template detected: /var/cpanel/templates/apache2/main.local !!
!! Local template detected: /var/cpanel/templates/apache2/vhost.local !!
[2024-08-09 14:02:19 -0400] info [apache_conf_distiller] Missing owner for domain server.clubcatcher.com, force lookup to root
[2024-08-09 14:02:19 -0400] warn [apache_conf_distiller] Unable to determine domain 64.15.69.254 ownership. Attempting lookup on domain 15.69.254 (manually added domain). at /usr/local/cpanel/bin/apache_conf_distiller line 1345.
ApacheConfDistiller::run("--update") called at /usr/local/cpanel/bin/apache_conf_distiller line 1990
[2024-08-09 14:02:19 -0400] warn [apache_conf_distiller] Unable to determine domain 64.15.69.254 ownership. Setting user to 'nobody'. at /usr/local/cpanel/bin/apache_conf_distiller line 1350.
ApacheConfDistiller::run("--update") called at /usr/local/cpanel/bin/apache_conf_distiller line 1990
Distilled successfully
!! Executing custom hook '/usr/local/cpanel/scripts/preeasyapache' !!
!! Done executing '/usr/local/cpanel/scripts/preeasyapache' !!
!! Verbose logfile is at '/usr/local/cpanel/logs/easy/apache/build.1723226538' !!
!!
Output from '/bin/sh -c "ulimit -a"':
core file size (blocks, -c) 1048576
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 255897
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 255897
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
!!
!! Creating backup of working apache in '/usr/local/apache.backup'. !!
!! Symlink encountered (/usr/local/apache/etc), preserving target (conf)... !!
!! Backup of working apache complete. !!!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /home/cpeasyapache/src/targz.yaml
!! End: Silent httpupdate request !!Checking that all tarballs are present and up to date.
!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/Apache/PHPAsUser.pm.tar.gz' !!!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/Apache/PHPAsUser.pm.tar.gz
!! End: Silent httpupdate request !!!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/Apache/2_4.pm.tar.gz' !!
!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/Apache/2_4.pm.tar.gz
!! End: Silent httpupdate request !!!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/ModRuid2.pm.tar.gz' !!
!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/ModRuid2.pm.tar.gz
!! End: Silent httpupdate request !!!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/ModSec.pm.tar.gz' !!
!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/ModSec.pm.tar.gz
!! End: Silent httpupdate request !!!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/PHP5/6_39.pm.tar.gz' !!
!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/PHP5/6_39.pm.tar.gz
!! End: Silent httpupdate request !!!! Downloading '/var/cpanel/perl/easy/Cpanel/Easy/PHP5/6_39.pm.patch.tar.gz' !!
!! Start: Silent httpupdate request !!
!! File downloaded from 185.125.185.32 and written to /var/cpanel/perl/easy/Cpanel/Easy/PHP5/6_39.pm.patch.tar.gz
!! End: Silent httpupdate request !!Checking that all packages are present and up to date.
!! Trying to auto repair package system !!
!! Package system can not be repaired automatically !!
!! Please visit http://go.cpanel.net/eaerror for help with this error. !!
!! Restoring original working apache !!
!! Executing '/usr/local/cpanel/scripts/initsslhttpd' !!
!! Restarting 'httpd' ... !!
!! 'httpd' restart complete. !!
Building global cache for cpanel...Done
!! Executing '/usr/local/cpanel/scripts/initfpsuexec' !!
!! Executing '/usr/local/cpanel/scripts/initsslhttpd' !!
!! Executing '/usr/local/cpanel/scripts/fixmailman' !!
!! Executing '/usr/local/cpanel/scripts/update_apachectl' !!
!! Verbose logfile is at '/usr/local/cpanel/logs/easy/apache/build.1723226538' !!
From that log I noticed that it was downloading this file which seems to be apache 2.4. Apache 2.4 is the very thing I need.
/var/cpanel/perl/easy/Cpanel/Easy/Apache/2_4.pm.tar.gz
Is there a way I can manually install that Apache and modify some backend scripts of WHM/Cpanel so that it still works?
Remember, the ONLY change I wish to make to my server is to make the apache version from 2.2 to 2.4 without WHM/Cpanel coughing in my face and without me having to ditch the entire server and reinstall a whole bunch of stuff.
If this is not doable then is there a way I can keep the old WHM/Cpanel without always paying a monthly license for it?
-
I think I found items that are a clue in my server but I don't know the best way to execute it.
So I examined the gz package locally and it contains files and 2 folders. looking at the httpd-2.4 folder in that package, it suggests its the entire apache 2.4 distribution as source. Normally I would run ./configure, make and make install to do that, but what made me hesitant is the cppatch folder containing what I believe patches required to make the package work with cpanel.
Then I find and downloaded the file 2_4.pm which upon inspection suggests to me this is the installer as a perl script I should run to have apache updated.
Am I right with my theory? if so, how do I execute such a script from a commandline?
0 -
Hey there! There is no supported way to get Apache 2.4 working on a server that old. The packages likely no longer exist from the repositories themselves. I'm not able to recommend anything on my end as any changes to that system could cause everything to stop working, with no easy way to fix the sites.
I can only recommend you migrate to a newer system as soon a possible.
0 -
It's been a really, really long time since working with EA3, but I think your going to be stuck. Everything in EA4 is delivered via RPM's. If your running that old of a server it's prob. CentOS V6 and there won't be any packages for that OS (even if you could get the script to work). Its prob. time to bite the bullet and migrate to a new server.
0 -
Earlier when I tried upgrading EA3 to EA4 and reverted because I couldn't upgrade, I noticed PHP was missing, so I managed to reinstall that by extracting 6_39.pm.tar.gz (that your script downloaded) and running .configure, make and make install.
I think I can pull off upgrading apache the same way but its a matter of changing a few configuration files, running the patch files somehow because they're probably system command and minor modifications to other files (namely cpanel templates that end in .default and/or .local for apache).
I understand I may be spending at least an hour to set everything up while potentially causing rolling HTTP server blackouts because to me, changing a whole system hardware, software, and file structure JUST to upgrade apache (when I did it fine on the same system years before when easy apache was working) is just an overkill.
Also, upgrading an actual server may be a more expensive process as it involves taking the existing server offline and replacing everything with newer hardware and new systems cost more money, something that's hard to come by.
0
Please sign in to leave a comment.
Comments
4 comments