How to install lamp stackIn this article
The Lamp Stack is a combination of Apache httpd server, MySQL database and php language. The lamp stack is usually used by web developers to build web applications, websites and portals using PHP language and MySQL as backend database. Installing the lamp stack involves installing all of the above components. MariaDB is an open source fork of MySQL database and can be used as a drop-in replacement of mysql. MariaDB is what is supported in AryaLinux.
Use the following command to install the lamp stack.
alps updatescripts alps install php apache mariadb
On running the above command, during the installation of net-snmp, you would be prompted to press enter several times, hit the enter key a number of times when prompted to accept the default values. You might also be prompted to hit the enter key again to accept default for other packages, you need to hit enter in those cases as well. You would also be prompted to enter a new password for mariadb. After the installation completes, start the mariadb server by running the following command:
sudo systemctl start mysqld
Once installed, there is very little configuration you have to actually do to make the lamp stack work. Here are few things you need to keep in mind:
- Owing to its similarity to BLFS, the root directory in AryaLinux is /srv/www instead of /var/www/html like in most distros.
- Once the installation process completes, look for LoadModule php7_module in /etc/httpd/httpd.conf and make sure that the line does not start with a # symbol. Once the change is made save the file.
- Search for DirectoryIndex index.html in /etc/httpd/httpd.conf and change that to DirectoryIndex index.php index.html. Once again once the change is made save the file.
sudo sed -i 's@DirectoryIndex index.html@DirectoryIndex index.php index.html@g' \ /etc/httpd/httpd.conf