Skip to content

Instantly share code, notes, and snippets.

@dinhquochan
Created May 20, 2024 04:48
Show Gist options
  • Save dinhquochan/419819df8e3261a80fe800eda71e3b42 to your computer and use it in GitHub Desktop.
Save dinhquochan/419819df8e3261a80fe800eda71e3b42 to your computer and use it in GitHub Desktop.
Botble x Centminmod on RocketLinux 8

RockyLinux 8 with Centminmod

Install basic tools & update system

yum -y update
yum -y install epel-release screen zip unzip git curl wget vim

Turn off selinux

grubby --update-kernel ALL --args selinux=0
grep '^GRUB_CMDLINE_LINUX=' /etc/default/grub
shutdown -r now

Install fail2ban

yum -y install fail2ban
systemctl start fail2ban
systemctl enable fail2ban

Install centminmod (PHP 8.2)

screen -S cminstall -h 2000000
curl -4sL https://centminmod.com/installer-el8x-82.sh -o installer-el8x-82.sh; bash installer-el8x-82.sh

Install PHP Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/bin --filename=composer
php -r "unlink('composer-setup.php');"

Create Git Personal Token (PAT) (Or using SSH keys)

  1. Go to GitHub -> Settings -> Personal Access Tokens

  2. Check access All Repositories with Read only "Contents"

Will using this token for pull the latest source codes from GitHub.

Setup git credential

git config --global credential.helper store
sudo -u nginx git config --global credential.helper store

Setup Let's Encrypt for CloudFlare

vim /etc/centminmod/custom_config.inc

Add three lines:

CF_DNSAPI_GLOBAL='y'
CF_Token="<Your CloudFlare Token>"
CF_Account_ID="<Your CloudFlare Account Id"

Setup 1 site

  1. Using ./centmin.sh add virtual domain

  2. Update nginx config

In /usr/local/nginx/conf/conf.d/example.archielite.com.ssl.conf

-#try_files \$uri \$uri/ /index.php?q=\$uri&\$args;
+try_files $uri $uri/ /index.php?$query_string;
  1. Setup Let's Encrypt
/usr/local/src/centminmod/addons/acmetool.sh issue example.archielite.com lived
  1. Cloning source in to /home/nginx/example.archielite.com

Using GitHub PAT (above) login, with any username.

sudo -u nginx git clone https://github.com/archielite/example.git
rm -rf example.archielite.com/public
cp -r example.archielite.com/* example
rm -rf example.archielite.com
mv example example.archielite.com
  1. Create database
CREATE USER example@'%' IDENTIFIED by 'secret';
CREATE DATABASE example;
GRANT ALL PRIVILEGES ON example.* TO example@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
  1. Update .env

  2. Run

sudo -u nginx composer install
sudi -u nginx php artisan migrate:fresh --seed
sudo -u nginx php artisan cms:license:activate --buyer=<license_name> --purchase_code=<license_code>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment