In order to install PHP, issue this command in Terminal: $ sudo apt install php libapache2-mod-php php-mysql PHP also connects with the Apache server to hand over the processed information for displaying over the web. In this, we will install PHP to connect with the MariaDB database and retrieve the required information. To leave the console, execute the below command in Terminal: exit To view the database “test” that you have created in the previous step, execute the below command in Terminal: SHOW DATABASES Now enter the password for this user (in our case, it was “tintin”). Now try logging in to the MariaDB console using the new user credentials you have set in the previous step. Now reload the privileges using the below command: FLUSH PRIVILEGES ![]() We have created a user ‘tin’ with password ‘tintin’. Execute the below command to do so: GRANT ALL ON test.* TO 'localhost' IDENTIFIED BY 'tintin' WITH GRANT OPTION Now create a user along with a password and give it full permission to the “ test” database. You can do so using this command in Terminal: $ sudo mariadb Now connect to MariaDB console as a root user. Then for all the next questions, hit y and then Enter to answer yes and accept the default values. Then it will ask you to set the root password, again hit N, and then Enter. When you are asked to provide the password for root, hit n. You will be presented with a few questions to configure some options for MariaDB. Use the below command in Terminal to execute the script: $ sudo mysql_secure_installation Now execute the security script to implement some security features. Execute the below command in Terminal to install MariaDB database: $ sudo apt install mariadb-server Now, we will install the MariaDB database that will be used to store data for our site. Now to check if Apache is working and can serve web pages, try to open Apache’s default webpage in your web browser: Replace the ip-address with the IP address of your own system.Īlternatively, you can also access Apache’s default webpage using the curl command in your Terminal: $ curl Step 2 - Installing MariaDB To verify if the rule has been added successfully, execute the below command in Terminal: $ sudo ufw status To enable the “WWW Full” profile, execute the below command in Terminal: $ sudo ufw allow in "WWW Full" To view information about the “WWW Full” profile, execute the below command in Terminal: $ sudo ufw app info "WWW Full" We will enable the “ WWW Full” profile for Apache that will allow the traffic on both port 80(HTTP) and port 443(HTTPS). ![]() To view the list of all application profiles, issue the below command in Terminal: $ sudo ufw app list The Debian system comes with different profiles for Apache which can be used to adjust the firewall settings. Now if a firewall is enabled on your system, you will need to allow Apache port through it. Here is the command to verify the status of the Apache service: $ sudo systemctl status apache2 Once the installation is completed, the Apache service will start running automatically. Then to install Apache, issue this command: $ sudo apt install apache2 Pre-requisitesįirst, update the apt index using the below command in Terminal: $ sudo apt update In this post, we will demonstrate how to install Linux, Apache, MariaDB, and PHP (LAMP) Stack on Debian 10. Usually, the Lamp stack uses MySQL as a database server, however, for Debian systems MariaDB is now the default MySQL server. It uses Linux as the OS, Apache as a web server to serve web content over simple URLs, MariaDB as a database server to store websites and applications data, and PHP as the scripting language to serve dynamic content. LAMP (stands for Linux, Apache, MariaDB, PHP) is a collection of open-source software that is used to create dynamic websites and web-based applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |