بسم الله
Bismillah
Langkah-langkah ini bisa juga di aplikasikan di server/vps, karena intinya sama saja jika kita memakai linux untuk operasional sehari-sehari. Saya bagi jadi dua jenis linux base (Debian sama RHEL)
Debian Family
Install GIT
sudo apt install git -y
git config --global user.name "Fitri Ariyanto"
git config --global user.email [email protected]
Install CURL
sudo apt install curl -y
Install PostgreSQL
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update && sudo apt upgrade -y
sudo apt install postgresql-14 -y
Untuk instalasi versi tertentu, silahkan diganti nomor versinya. Dalam sesi ini, versi yang digunakan postgresql-14
Postgresql without sudo
sudo -u postgres psql
ALTER USER postgres with password 'postgres';
sudo nano /etc/postgresql/12/main/pg_hba.conf
Kemudian ganti peer
dengan md5
, begini contohnya
local all postgres peer <- hapus dan ganti menjadi md5
Jadinya seperti ini
local all postgres md5
Simpan dan keluar editor
exit
sudo service postgresql restart
psql -U postgres
atau bisa menggunakan systemctl
sudo systemctl restart postgresql
psql -U postgres
Install PHP
sudo apt install software-properties-common apt-transport-https curl -y
curl -sSL https://packages.sury.org/php/README.txt | sudo bash -x
Ganti phpx.x dengan versi php yang ingin di install
sudo apt install php7.4-{curl,mbstring,fpm,pgsql,mysql,gd,zip,xml,bcmath,json} -y
sudo apt install php8.0-{curl,mbstring,fpm,pgsql,mysql,gd,zip,xml,bcmath} -y
Ini diperlukan untuk di install apabila menggunakan APACHE
untuk webservernya
sudo apt install libapache2-mod-php7.4 -y
Install Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Install mariadb
Ganti nn
dengan versi mariadb yang ingin di install
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.nn"
sudo apt-get install mariadb-server mariadb-client mariadb-backup -y
Mariadb tanpa sudo
& password
ketika masuk melalui terminal atau editor
sudo mysql -u root
SELECT User,Host FROM mysql.user;
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
sudo nano /etc/mysql/mysql.conf.d/mysqld.conf
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
sudo systemctl restart mariadb
Install Apache
sudo a2enmod rewrite
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/somehost.conf
sudo nano /etc/apache2/sites-available/somehost.conf
<VirtualHost *:80>
ServerAdmin admin@somehost.com
DocumentRoot /var/www/html/MyProject/public
ServerName NamaDomain.com
<Directory /var/www/html/MyProject/public>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo ln -s /etc/apache2/sites-available/aes.com.conf /etc/apache2/sites-enabled/
sudo a2ensite somehost.conf
sudo apachectl configtest
sudo a2enmod rewrite
sudo service apache2 restart
Install NGINX
Untuk repositori nginx terbaru bisa di lihat di halaman nginx.com, buat dengan menggunakan text editor. Sesuaikan dengan distro linux dan codename linux yang dipakai
sudo sh -c 'echo "deb https://nginx.org/packages/ $(lsb_release -cs) nginx \ndeb-src https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" > /etc/apt/sources.list.d/nginx.list'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABF5BD827BD9BF62
sudo apt update && sudo apt upgrade -y
sudo apt install nginx
Install NodeJS
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
sudo apt install -y nodejs
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
sudo apt install -y nodejs
Another Applications
Install Tweak ElementaryOS
sudo add-apt-repository ppa:philip.scott/elementary-tweaks
sudo apt update
sudo apt install elementary-tweaks
sudo add-apt-repository --remove ppa:philip.scott/elementary-tweaks
Install inkscape with PPA
sudo add-apt-repository universe
sudo add-apt-repository ppa:inkscape.dev/stable
sudo apt-get update
sudo apt install inkscape
sudo add-apt-repository --remove ppa:inkscape.dev/stable
RHEL Family
Intinya sama dengan command di keluarga debian, cuma ganti aplikasi manager nya saja. Keluarga Debian pakai apt
kalau keluarga RedHat pakai yum
atau dnf
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php74
sudo yum update
sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
php -v
الحمد لله
Linked references:
- https://tecadmin.net/install-php7-on-centos7/
- https://computingforgeeks.com/how-to-install-php-on-ubuntu/
- https://www.tecmint.com/install-php-on-centos-8/
- https://www.linuxcapable.com/how-to-install-php-7-4-on-debian-11-bullseye/#Install_Required_Packages
- https://www.postgresql.org/download/linux/ubuntu/
- https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
- https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
- https://github.com/nodesource/distributions/blob/master/README.md