Berikut cara mudah install dan setup Apache/Httpd dan Mysql+PHP di Linux Ubuntu.

Install PHP

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install -y php7.2

Install juga tambahan berikut ini

$ sudo apt install php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mcrypt

Install Apache2/Httpd

$ sudo apt install apache2 libapache2-mod-php7.2

Install MySQL

$ sudo apt install mysql-server php-mysql

Install PHPMyadmin

$ sudo apt install phpmyadmin

Restart service Apache dan Mysql

$ sudo systemctl restart apache2.service 
$ sudo systemctl restart mysql.service

Allow port 80 (HTTP) di sisi Firewall

Jika menggunakan Firewall Iptables :

$ sudo iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

Jika menggunakan Firewall UFW :

$ sudo ufw allow 80/tcp

Selesai ! Silahkan akses di browser menggunakan alamat http://localhost atau IP server/PC kamu.

 


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *