Server, Linux, Ubuntu

Configurasi Dasar Ubuntu Server

1. Update repository

 

$ sudo apt-get update

  

2. Install apache

 

$ sudo apt-get install apache2

 

2.b Install apache

 

$ sudo apt-get install nginx

 

3. Install PHP 7.4

 

$ sudo add-apt-repository ppa:ondrej/php

 

$ sudo apt-get update

 

$ sudo apt-get install php7.4

 

$ sudo apt-get install php7.4-fpm php7.4-cli php7.4-mysql php7.4-gd php7.4-imagick php7.4-tidy php7.4-xmlrpc php7.4-mbstring php7.4-xml php7.4-zip

 

3.b Install PHP 8.0

 

$ sudo add-apt-repository ppa:ondrej/php

 

$ sudo apt-get update

 

$ sudo apt-get install php8.0

 

$ sudo apt-get install php8.0-fpm php8.0-cli php8.0-mysql php8.0-gd php8.0-imagick php8.0-tidy php8.0-xmlrpc php8.0-mbstring php8.0-xml php8.0-zip

 

$ sudo systemctl enable php8.0-fpm

 

$ sudo systemctl restart nginx

 

4. Install MySQL

 

$ sudo apt install mysql-server

 

$ sudo mysql_secure_installation

 

5. Install Firewall

 

$ sudo apt install ufw

 

$ sudo ufw allow 80

 

$ sudo ufw allow 443

 

$ sudo ufw allow 22

 

$ sudo ufw allow 3306

 

$ sudo ufw enable

 

$ sudo ufw status numbered

 

6. Enable .htaccess

 

$ sudo nano /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
 
. . .

<Directory /var/www/html>

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Require all granted

</Directory>

    . . .

</VirtualHost>

$ sudo a2enmod rewrite

 

$ sudo service apache2 restart

 

7. Install NodeJS 14

 

curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs

 

Contact

Get in Touch