====== Beacon Production Server ======
Beacon production is where the public visits beacontechnology.com
The hostname is also chost.beacontechnology.com
The old hostname was cpanel.beacontechnology.com however this change was necessary due to cpanel no longer allowing users to change their hostname to cpanel.
Links
* https://cpanel.beacontechnology.com/whm
* https://cpanel.beacontechnology.com/cpanel
* https://beacontechnology.com
===== Setup =====
To create a new chost.beacontechnology.com server follow these steps:
- Set up a fresh Alma 8 minimal.
- yum install -y screen
- run ''screen''
- Inside screen, update the server with: ''yum update -y; sync; sleep 1; reboot''
- Make sure the box has a valid hostname like chost.beacontechnology.com Run ''hostname'' to print the hostname. To change the hostname run: ''nmcli general hostname chost.beacontechnology.com''
- Disable NetworkManager by following this guide: [[https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-disable-network-manager/|Click Here]]
- Install cPanel by following this guide: [[https://docs.cpanel.net/installation-guide/install/|Click Here]]
- Transfer the .tar.gz file somewhere to the box
- Go to this [[wiki:cpbackuprestore|article]] to see your restore options
- Update DNS if you have a different IP
==== Additional Setup ====
=== Install ImageMagick ===
When reinstalling, you may get an error when running one of the admin scripts:
Fatal error: Uncaught Error: Class 'Imagick' not found in /home/beacontechnology/public_html/admin/resize.php:64 Stack trace: #0 {main} thrown in /home/beacontechnology/public_html/admin/resize.php on line 64
https://support.cpanel.net/hc/en-us/articles/360037048673-How-to-Install-ImageMagick-for-EA-PHP-and-ALT-PHP
dnf config-manager --set-enabled epel
dnf install ImageMagick ImageMagick-devel -y
find /opt/cpanel/ -iname pecl | grep bin
for each, run this command
/opt/cpanel/ea-php74/root/usr/bin/pecl install imagick
/opt/cpanel/ea-php80/root/usr/bin/pecl install imagick
Don't forget to start php-fpm
/scripts/restartsrv_apache_php_fpm
=== Session Files ===
There are some other things to take into consideration.
The website generates tons of session files and never cleans them up.
To fix this, you can use a cron job to clean them up
# cat /etc/cron.daily/clean_sessions.sh
#!/bin/bash
find /home/beacontechnology/public_html/session -type f -mtime 5 -delete
The above has been implemented in a cron job owned by root that runs twice daily. It removes sessions after 10 days. Using -delete would fail due to the large number of arguments (too many files). Piping the results to rm did the job.
/home/beacontechnology/clean_sessions
find /home/beacontechnology/www/session/ -name '*' -type f -mtime +10 | head -10000 | xargs rm
find /home/beaconmicro/www/session/ -name '*' -type f -mtime +10 | head -10000 | xargs rm
=== AWstats ===
By default WHM does not allow users to update stats anytime they want. To restore the Update Now button in awstats
go to: Server Configuration / Tweak Settings
enable: Allow users to update Awstats from cPanel
To manually run an update from script:
''/scripts/runweblogs $USER''