AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Lamp php1/8/2024 The acronym LAMP was coined by Michael Kunze in the December 1998 issue of Computertechnik, a German computing magazine, as he demonstrated that a bundle of free and open-source software "could be a feasible alternative to expensive commercial packages". The components of the LAMP stack are present in the software repositories of most Linux distributions. PHP, Perl, or Python programming language.MySQL for the relational database management system.Įach letter in the acronym stands for one of its four open-source building blocks: However, LAMP now refers to a generic software stack model and its components are largely interchangeable. LAMP ( Linux, Apache, MySQL, PHP/ Perl/ Python) is an acronym denoting one of the most common software stacks for many of the web's most popular applications. To finish and for the security of the server, we must delete the info.php file.Acronym for a common web hosting solutionĪ high-level overview of LAMP's building blocks and overall system environment Now if you refresh the page info.php in the browser, you will find that Server API changed from Apache 2.0 Handler to FPM / FastCGI, which means that the Apache web server will pass the requests from PHP to PHP-FPM. Then we must restart apache: sudo systemctl restart apache2 The next step will be enable config file /etc/apache2/conf-available/: We continue enabling proxy_fcgi and setenvif module: To do it, we will have to disable the Apache PHP7.4 module: This is generally fine, but in some cases we must execute PHP code with PHP-FPM. In the above steps, the Apache PHP7.4 module is used to handle the PHP code. With the PHP Apache module and with PHP-FPM. We are going to find two ways to run PHP code with the Apache web server. If you are using a local machine, type 127.0.0.1/info.php o localhos / info.php. Once the file is saved, now in the address bar of the browser we will have to write ip-address / info.php. Inside the file we are going to paste the following PHP code: To test the PHP scripts with the Apache server, we need to create an info.php file in the root directory: sudo vim /var/www/html/info.php We can check PHP version with the command: Now we will have to activate Apache php7.4 module and restart Apache web server. Sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline For this we are going to write the following command to install PHP7.4 and some common PHP modules: Install PHP7.4Īt the time of writing this article, PHP7.4 is the latest stable version of PHP. This will remove the anonymous user, disable remote root login, and remove the test database.ĭefault, the MaraiDB package in Ubuntu uses unix_socket to authenticate user login. Now, we can press Intro to answer all the remaining questions. Then enter your root password for the MariaDB server. When you ask us to enter the MariaDB root password, pulsa Intro since the root password is not set yet. Now run the post-install security script: sudo mysql_secure_installation If it is not running, we will start it by writing: sudo systemctl start mariadbįor allow MariaDB to start automatically at boot time, we must execute: sudo systemctl enable mariadb We will can check your status with the command: Sudo apt install mariadb-server mariadb-clientĪfter it is installed, the MariaDB server should run automatically. Write the following command to to install MariaDB on Ubuntu 20.04: MariaDB is a direct replacement for MySQL. We will achieve this by writing: sudo chown www-data:www-data /var/www/html/ -R Install the MariaDB database server Now we need set www-data ( Apache user) as the owner of the web root. If you are using the firewall UFW, execute the command to open TCP port 80: sudo ufw allow http If you are using the iptables firewall, you must run the following command to open TCP port 80: sudo iptables -I INPUT -p tcp -dport 80 -j ACCEPT If the connection is refused or does not complete, we may have a firewall preventing incoming requests to TCP port 80. If you are installing LAMP on a local Ubuntu 20.04 machine, type 127.0.0.1 or localhost in the address bar browser. You should see the start web page, which means that the Apache web server is running correctly. Now type the public IP address of the Ubuntu 20.04 server in the address bar of the browser.
0 Comments
Read More
Leave a Reply. |