Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install LEMP on Fedora 30 Server

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install LEMP on Fedora 30 Server, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.

How to install LEMP on Fedora 30 Server. Representative of LEMP:

L-> Linux

E-> Nginx

M-> Maria DB

P-> PHP

I assume that Fedora 30 is already installed on your computer system.

LEMP is a powerful collection of software settings installed on a Linux server to help build websites using popular development platforms, LEMP is a variant of LAMP, where it is not Apache, but uses EngineX (Nginx), and uses MariaDB instead of MySQL. This getting started guide is a collection of works for installing separate guides for Nginx, Maria DB, and PHP.

Install Nginx, PHP 7.3, and PHP-FPM on Fedora 30 Server

Let's see how to install Nginx and PHP and PHP FPM on Fedora 30 Server.

Step 1) switch to root user

The first step in installing Nginx on the system is to switch to the root user. Use the following command:

Root@linuxtechi ~] $sudo-I [sudo] password for pkumar: [root@linuxtechi ~] # step 2) install Nginx, PHP 7.3 and PHP FPM using the dnf command

Install Nginx using the following dnf command:

[root@linuxtechi ~] # dnf install nginx php php-fpm php-common-y step 3) install additional PHP module

PHP default installation only comes with basic modules and the most needed modules, if you need additional modules, such as PHP support for GD, XML, command line interface, Zend OPCache features, etc., you can always choose your software package and install everything at once. View the following example command:

[root@linuxtechi ~] # sudo dnf install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml-y step 4) start & enable Nginx and PHP-fpm services

Use the following command to start and enable the Nginx service:

[root@linuxtechi] # systemctl start nginx & & systemctl enable nginxCreated symlink / etc/systemd/system/multi-user.target.wants/nginx.service → / usr/lib/systemd/system/nginx.service. [root@linuxtechi ~] #

Use the following command to start and enable the PHP-FPM service:

[root@linuxtechi ~] # systemctl start php-fpm & & systemctl enable php-fpmCreated symlink / etc/systemd/system/multi-user.target.wants/php-fpm.service → / usr/lib/systemd/system/php-fpm.service. [root@linuxtechi ~] # step 5) verify Nginx (Web service) and PHP installation

Note: if the operating system firewall is enabled and running on your Fedora 30 system, use the following command to permit ports 80 and 443:

[root@linuxtechi] # firewall-cmd-- permanent-- add-service=httpsuccess [root@linuxtechi ~] # [root@linuxtechi ~] # firewall-cmd-- permanent-- add-service=httpssuccess [root@linuxtechi ~] # firewall-cmd-- reloadsuccess [root@linuxtechi ~] #

Open a web browser and enter the following URL: http://.

Test-Page-HTTP-Server-Fedora-30

The above screen confirms that Nginx has been successfully installed.

Now, let's verify the PHP installation and create a test php page (info.php) using the following command:

[root@linuxtechi ~] # echo "" > / usr/share/nginx/html/info.php [root@linuxtechi ~] #

Enter the following URL, http:///info.php in the web browser

Php-info-page-fedora30

The above page verifies that PHP 7.3.5 has been successfully installed. Now, let's install the MariaDB database server.

Install MariaDB on Fedora 30

MariaDB is an excellent alternative to MySQL databases because it works very similar to MySQL and is compatible with MySQL. Let's take a look at the steps to install MariaDB on Fedora 30 Server.

Step 1) switch to root user

The first step in installing MariaDB on your system is to switch to the root user, or you can use a local user with root privileges. Use the following command:

[root@linuxtechi ~] # sudo-I [root@linuxtechi ~] # step 2) install the latest version of MariaDB using the dnf command

Use the following command on Fedora 30 Server to install MariaDB:

[root@linuxtechi ~] # dnf install mariadb-server-y step 3) enable and enable the MariaDB service

After successfully installing MariaDB in step 2, the next step is to turn on the MariaDB service. Use the following command:

[root@linuxtechi ~] # systemctl start mariadb.service; systemctl enable mariadb.service step 4) protect the installed MariaDB

When we install the MariaDB server, anonymous users are also created in the database because there is no root password by default. Therefore, to protect the installed MariaDB, run the following mysql_secure_installation command:

[root@linuxtechi ~] # mysql_secure_installation

Next you will be asked some questions and answer only the questions shown below:

Secure-MariaDB-Installation-Part1

Secure-MariaDB-Installation-Part2

Step 5) Test the MariaDB installation

After you install, you can always test whether MariaDB is successfully installed on Fedora 30 Server. Use the following command:

[root@linuxtechi ~] # mysql-u root-pEnter password:

Next, you will be prompted for a password. Enter the password you set during the protection of the installed MariaDB, and then you can see the MariaDB Welcome screen.

Welcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 17Server version: 10.3.12-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement. MariaDB [(none)] > Thank you for reading this article carefully. I hope the article "how to install LEMP on Fedora 30 Server" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report