Installation Guide for Various Tools and Services
1. Install Tools
-
Install CROC
curl https://getcroc.schollz.com | bash
-
Install Net Tools
sudo apt install net-tools
-
Download Adminer
wget https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php -O miner.php
-
Set Timezone and Hostname
sudo timedatectl set-timezone Asia/Kolkata sudo timedatectl set-timezone UTC sudo hostnamectl set-hostname abc.com # also update the hostfile /etc/hosts with the new hostname mapped to 127.0.0.1
-
Update and Upgrade System
sudo apt update -y sudo apt upgrade -y
-
Install PHP 8.2
sudo apt install software-properties-common -y sudo add-apt-repository ppa:ondrej/php sudo apt update -y sudo apt install php8.2 -y sudo apt update -y
-
Install PHP-FPM and Extensions
sudo apt-get install -y php8.2-fpm php8.2-cli php8.2-common php8.2-json php8.2-opcache php8.2-mysql php8.2-mbstring php8.2-xml php8.2-gd php8.2-curl
-
Set Default PHP Version
sudo update-alternatives --set php /usr/bin/php7.2
-
Increase PHP Upload Limit
sudo nano /etc/php/8.2/fpm/php.ini sudo nano /etc/php/8.2/cli/php.ini # Set upload_max_filesize = 50M post_max_size = 50M sudo systemctl restart php8.2-fpm
-
Install MySQL and Set Up
sudo apt install mysql-server -y sudo mysql_secure_installation mysql -u root -p # Create users and databases CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin@12345'; CREATE USER 'minikube'@'localhost' IDENTIFIED BY 'admin@123'; GRANT ALL PRIVILEGES ON *.* TO 'minikube'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; CREATE DATABASE <abc>;
-
Install Node.js, npm, and nvm
sudo apt install nodejs -y sudo apt install npm -y curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash source ~/.bashrc nvm install <desired_version> nvm use <desired_version> nvm alias default 18 npm install -g yarn npm install -g pm2
-
Install Composer
sudo apt install composer -y # Check PHP extensions used in the project composer check-platform-reqs composer show -p
-
Install and Configure Nginx
sudo apt remove apache2 -y sudo systemctl stop apache2 sudo systemctl disable apache2 sudo apt install nginx -y sudo systemctl enable nginx sudo systemctl start nginx sudo systemctl status nginx
-
Install SSL with Certbot
sudo snap install --classic certbot
-
Install GitLab Runner
sudo apt update -y sudo apt install -y curl curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash sudo apt-get install gitlab-runner sudo gitlab-runner -version sudo gitlab-runner status sudo gitlab-runner start sudo gitlab-runner enable sudo gitlab-runner verify echo "gitlab-runner ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers echo "gitlab-runner ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/sudoers
-
Reload System Changes
sudo reboot
2. Amazon Linux 2 Setup for PHP 8.2
-
Install PHP 8.2
sudo yum update -y sudo yum install httpd php php-cli php-common php-mysqlnd -y sudo amazon-linux-extras install epel -y sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm -y sudo yum-config-manager --enable remi-php82 sudo yum install php php-cli php-common php-mysqlnd -y
-
Configure PHP 8.2
sudo nano /etc/php.ini echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
-
Install Apache and PHP-FPM
sudo yum install httpd mod_proxy_fcgi -y sudo systemctl enable httpd sudo systemctl start httpd sudo nano /etc/httpd/conf.d/php-fpm.conf # Add: <FilesMatch \.php$> SetHandler "proxy:unix:/run/php/php-fpm.sock|fcgi://localhost" </FilesMatch> sudo systemctl restart httpd
-
Verify PHP Installation
php -v
3. Install Latest Docker-Compose
- Install Docker-Compose
mkdir -p ~/.docker/cli-plugins/ curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose chmod +x ~/.docker/cli-plugins/docker-compose sudo docker compose version
4. Run Application in Background
- Run Script in Background
nohup ./run.sh > /dev/null 2>&1 &
5. Install GitHub Action Runner
- Download and Configure GitHub Action Runner
mkdir actions-runner && cd actions-runner curl -o actions-runner-linux-x64-2.314.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.314.1/actions-runner-linux-x64-2.314.1.tar.gz echo "6c726aa75b423c1137b5 actions-runner-linux-x64-2.314.1.tar.gz" | shasum -a 256 -c tar xzf ./actions-runner-linux-x64-2.314.1.tar.gz ./config.sh --url https://github.com/a/run-2shared --token ./run.sh