Hello Geek, today we are going to learn how to install the LAMP stack (Linux, Apache, MySQL, PHP) along with phpMyAdmin on Arch Linux, you can follow these steps:
- Update System:
Open a terminal and update your system’s package repositories:
sudo pacman -Syu
- Install Apache:
Install the Apache web server:
sudo pacman -S apache
- Install MySQL:
Install the MySQL database server:
sudo pacman -S mariadb
- Install PHP:
Install PHP and necessary PHP extensions:
sudo pacman -S php php-apache
- Configure Apache:
Enable the Apache service and start it:
sudo systemctl enable httpd
sudo systemctl start httpd
- Configure MySQL:
Initialize the MySQL database and start the service:
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mariadb
sudo systemctl start mariadb
Secure the MySQL installation:
sudo mysql_secure_installation
- Install phpMyAdmin:
Install phpMyAdmin and PHP extensions for MySQL support:
sudo pacman -S phpmyadmin php-mcrypt php-gd
- Configure phpMyAdmin:
Edit the Apache configuration file to include phpMyAdmin:
sudo nano /etc/httpd/conf/extra/httpd-phpmyadmin.conf
Add the following lines to the file:
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
Save the file and exit the text editor.
- Enable Required Modules:
Enable the necessary Apache modules:
sudo nano /etc/httpd/conf/httpd.conf
Uncomment or add these lines:
LoadModule php7_module modules/libphp7.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
Save the file and exit.
- Restart Apache:
Restart the Apache service to apply the changes:sudo systemctl restart httpd
- Access phpMyAdmin:
Open a web browser and navigate tohttp://localhost/phpmyadmin
. - Log in to phpMyAdmin:
Log in using your MySQL root username and password that you set during the MySQL installation.
You’ve now successfully installed the LAMP stack with phpMyAdmin on Arch Linux. Make sure to adjust settings and configurations according to your requirements and security best practices.