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

Centos7.3 builds LNMP and deploys wordpress site

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Centos7.3 builds LNMP and deploys wordpress site

I. Topology diagram

2. Preparatory work:

1. Three independent hosts (virtual machines)

Nginx:10.0.0.11

Php-fpm:10.0.0.2

Mariadb:10.0.0.13

Prepare yum environment (recommend Aliyun yum source, please search it by Baidu)

two。 Related software package preparation

10.0.0.11 (nginx)

Yum install nginx-y

10.0.0.2 (php-fpm)

Yum install php-fpm php-mysql php-mbstring php-mcrypt php-xcache-y

10.0.0.13 (mariadb)

Yum install mariadb-server-y

Third, construction steps

1.nginx host operation

1. Installation

Yum install nginx-y

two。 Configure nginx to support reverse proxy php-fpm

Vi / etc/nginx/conf.d/huwho.conf server {listen 80; server_name www.huwho.com; # web site domain name index index.php index.html index.htm; # defines a web site for nginx and places the web static resource location / {root / web/www; index index.html index.htm index.php } # define a web status page location / status {stub_status;} # pass the PHP scripts to FastCGI server listening on 10.0.0.2 stub_status; 9000 # reverse proxy php, place the web dynamic resource location ~ *\ .php$ {root / web/www/php # php's site root directory fastcgi_pass 10.0.0.2 fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME 9000; # fastcgi's address fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME / fastcgi}}

3. Create the appropriate directory

Mkdir / web/www/-pv echo nginx web test > > / web/www/

4. Start the nginx service and test

Systemctl start nginx

2.php-fpm host operation

1. Installation

Yum install php-fpm php-mysql php-mbstring php-mcrypt php-xcache-y

2.php-fpm profile modification

Modify three locations in the diagram

Vi / etc/php-fpm.d/www.conf

3. Start the php-fpm service

Systemctl start php-fpm [root@localhost ~] # ss-tlnState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *: 111 *: * LISTEN 0 5 192.168.122.1 virtual 53 *: * LISTEN 0128 *: 22 *: * LISTEN 0128 127.0.0. 1RV 631 *: * LISTEN 0 100 127.0.0.1 LISTEN 25 *: * LISTEN 0 128 10.0.0.2 9000 *: * LISTEN 0 128 : 111l:: * LISTEN 0128: 22 : * LISTEN 0 128:: 1 631:: * LISTEN 0 100 1:25:: *

4. Create a dynamic resource directory and an index.php file for testing

Mkdir / web/www/php-pvcd / web/www/phpvi index.phpwelcome to www.huwho.com website.

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

Database

Wechat

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

12
Report