Wednesday, November 13, 2024
Apache Arch linux Mariadb MySQL PHP

Cara Install LAMP Stack di Arch Linux

“Cara Install LAMP Stack di Arch Linux”

Pengantar

Secara teknis, tumpukan LAMP terdiri dari modul Linux, Apache, MySQL, dan PHP. Lingkungan tumpukan LAMP sangat ideal untuk pengembang perangkat lunak web yang ingin merasakan bagaimana aplikasi web mereka cenderung berperilaku di lingkungan yang dihosting server/produksi.

Cara Install LAMP Stack dengan PhpMyAdmin di Arch Linux

 sudo pacman -Syu
  • Install Apache
sudo pacman -Syu apache
  • Restart Service
sudo systemctl start httpd 
sudo systemctl enable httpd
sudo systemctl status httpd
 sudo pacman -S php php-apache
sudo pacman -S mysql
  • Restart service
sudo systemctl start mysqld 
sudo systemctl enable mysqld
sudo systemctl status mysqld
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
masuk ke root user 

#sudo su

delete file

# cd /var/lib/mysql
# rm -r *

Jalankan command

# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  • Restart service lagi
$ sudo systemctl start mysqld 
$ sudo systemctl enable mysqld
$ sudo systemctl status mysqld
$ sudo mysql_secure_installation
$ mysql -u root -p
  • Config Apache
$ sudo nano /etc/httpd/conf/httpd.conf
- Uncommand

LoadModule mpm_prefork_ 

- tambahkan script di paling bawah

LoadModule php_module modules/libphp.so
AddHandler php-script php
Include conf/extra/php_module.conf
  • Restart apache
$ sudo systemctl restart httpd 
  • testing apache
$ sudo nano /srv/http/index.html

<!DOCTYPE html>
<html>

<head>
  <title>Welcome</title>
</head>

<body>

  <h1>Welcome to LinuxShellTips</h1>
   <p>Linux Command Line Tips, Tricks, Hacks, Tutorials, and Ideas in Blog</p>

</body>
</html>
http://localhost
Or
http://IP-Address
  • Test php
$ sudo nano /srv/http/test.php

<?php
phpinfo()
?>

- akses browser

http://localhost/test.php
Or
http://IP-Address/test.php

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Install LAMP Stack di Arch Linux. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

(Visited 151 times, 1 visits today)

Similar Posts

One thought on “Cara Install LAMP Stack di Arch Linux

Comments are closed.