I had a rough time with RHEL8, as libapreq2 is no longer supported and must be compiled from source. (this is the package for Apache2::Request & ::Cookie)
I would recommend installing cpanminus for managing CPAN modules, that way you won't need the CPAN shell.
I also installed perlbrew in order to get a version of perl compiled (other than RHEL default) that was able to make it through the installation of the necessary Apache2 modules.
what ended up working for me, I'm sure it's not the only way:
perlbrew install-multiple 5.20.3 --both=thread CFLAGS='-m64 -mtune=nocona' ./Configure -des -A -Dusethreads ccflags=-fPIC
When configuring perl, this next part was especially important. When asked:
Any special flags to pass to cc to create a dynamically loaded library?
[-shared -O2 -L/usr/local/lib -fstack-protector] -shared -O2 -L/usr/local/lib -fstack-protector -fPIC
RHEL was an ordeal for me, so if you keep track of what works for you, it'd be nice to compare notes.
Other notes I left for myself:
Edit site.conf - Specify perlbrew location of lwp-request:
Specify texlive locations for latex, pdflatex, and diving
Other SELinux things to note:
semanage fcontext -a -t httpd_sys_content_t '/opt/webwork(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/opt/webwork/courses(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/opt/webwork/webwork2/htdocs/tmp(/.*)?'
setsebool -P httpd_can_sendmail 1
setsebool -P httpd_can_network_connect on
restorecon -vFR /opt