最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Nginx服務(wù)LNMP之WordPress部署流程步驟

 更新時(shí)間:2022年03月19日 16:07:01   作者:、重明  
這篇文章主要為大家介紹了Nginx服務(wù)LNMP之WordPress部署流程步驟,本實(shí)驗(yàn)意在部署過程,使用單機(jī)版部署,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步早日升職加薪

實(shí)驗(yàn)環(huán)境

實(shí)驗(yàn)環(huán)境:

[root@lnmp ~]# uname -r
2.6.32-754.el6.x86_64
[root@lnmp ~]# cat /etc/redhat-release 
CentOS release 6.10 (Final)
[root@lnmp ~]# cat /etc/hosts
192.168.1.30 lnmp
172.16.1.30 lnmp

軟件版本:

NGINX:nginx-1.12.2.tar.gz
MYSQL:mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz
PHP:php-5.5.3.tar.gz
libiconv:libiconv-1.16.tar.gz
wordpress:wordpress-4.7.3-zh_CN.tar.gz

安裝Nginx服務(wù)

Nginx服務(wù)部署過程:

請(qǐng)參考:小白也可以完成的0基礎(chǔ)部署Nginx服務(wù)

安裝Mysql數(shù)據(jù)庫(kù)

下載二進(jìn)制MySQL包:

[root@lnmp tools]# wget -q https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.6/mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz

解壓MySQL包:

[root@lnmp tools]# tar xf mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz -C /app/

創(chuàng)建MySQL用戶及授權(quán):

[root@lnmp tools]# cd /app/
[root@lnmp app]# ln -s mysql-5.6.47-linux-glibc2.12-x86_64/ /app/mysql
[root@lnmp tools]# useradd mysql -s /sbin/nologin -M
[root@lnmp mysql]# chown mysql.mysql /app/mysql/data/

初始化MySQL:

第一遍初始化報(bào)錯(cuò),然后我把data目錄下東西干掉后就好了。什么原理?

[root@lnmp mysql]# bin/mysqld --user=mysql --datadir=/app/mysql/data --basedir=/app/mysql

制作MySQL啟動(dòng)腳本:

[root@lnmp data]# cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld 
cp:是否覆蓋"/etc/init.d/mysqld"? y
[root@lnmp mysql]# sed -ri 's#/usr/local#/app#g' /etc/init.d/mysqld /app/mysql/bin/mysqld_safe 

創(chuàng)建配置文件:

[root@lnmp mysql]# cp /app/mysql/support-files/my-default.cnf /etc/my.cnf 
cp:是否覆蓋"/etc/my.cnf"? y

啟動(dòng)MySQL:

[root@lnmp mysql]# /etc/init.d/mysqld restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL. SUCCESS! 
[root@lnmp mysql]# netstat -utpln | grep mysqld
tcp        0      0 :::3306                     :::*                        LISTEN      17796/mysqld      

設(shè)置環(huán)境變量:

[root@lnmp mysql]# echo 'export PATH=/app/mysql/bin:$PATH' >>/etc/profile
[root@lnmp mysql]# source /etc/profile

登錄數(shù)據(jù)庫(kù):

因?yàn)槌跏济艽a為空,所以登錄后要修改密碼

[root@lnmp mysql]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.47 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 
[root@lnmp mysql]# mysqladmin -u root password '123123'
Warning: Using a password on the command line interface can be insecure.
[root@lnmp mysql]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.47 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 

安裝PHP

下載PHP包及l(fā)iblconv包:

[root@lnmp ~]# cd /server/tools/
[root@lnmp tools]# wget https://museum.php.net/php5/php-5.5.3.tar.gz
[root@lnmp tools]# wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz

安裝依賴包:

[root@lnmp tools]# yum -y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel
[root@lnmp tools]# yum -y install libiconv-devel freetype-devel libpng-devel gd-devel
[root@lnmp tools]# yum -y install libcurl-devel libxslt-devel
[root@lnmp tools]# yum -y install libmcrypt-devel mhash mcrypt

編譯安裝語言轉(zhuǎn)換工具:

[root@lnmp tools]# tar xf libiconv-1.16.tar.gz 
[root@lnmp tools]# cd libiconv-1.16
[root@lnmp libiconv-1.16]# ./configure --prefix=/usr/local/libiconv
[root@lnmp libiconv-1.16]# make && make install

解壓PHP包進(jìn)行預(yù)編譯:

[root@lnmp libiconv-1.16]# cd /server/tools/
[root@lnmp tools]# tar xf php-5.5.3.tar.gz 
[root@lnmp tools]# cd php-5.5.3
[root@lnmp php-5.5.3]# mkdir -p /app/php-5.5.3
[root@lnmp php-5.5.3]# ./configure --prefix=/app/php-5.5.3 --with-mysql --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --enable-short-tags --enable-static --with-xsl --with-fpm-user=www --with-fpm-group=www --enable-ftp --enable-opcache=no
[root@lnmp php-5.5.3]# echo $?
0

防報(bào)錯(cuò)處理:

[root@lnmp php-5.5.3]# ln -s /app/mysql/lib/libmysqlclient.so.18 /usr/lib64/
[root@lnmp php-5.5.3]# touch ext/phar/phar.phar

編譯安裝PHP:

[root@lnmp php-5.5.3]# make && make install
[root@lnmp php-5.5.3]# echo $?
0
[root@lnmp php-5.5.3]# cp php.ini-production /app/php-5.5.3/lib/
[root@lnmp php-5.5.3]# ln -s /app/php-5.5.3/ /app/php
[root@lnmp php-5.5.3]# cd /app/php/etc/
[root@lnmp etc]# ll
總用量 28
-rw-r--r-- 1 root root  1152 8月  25 06:39 pear.conf
-rw-r--r-- 1 root root 21846 8月  25 06:39 php-fpm.conf.default
[root@lnmp etc]# cp php-fpm.conf.default php-fpm.conf
[root@lnmp etc]# vim php-fpm.conf
listen = 172.16.1.30:9000

啟動(dòng)PHP:

[root@lnmp etc]# useradd -s /sbin/nologin -M www
[root@lnmp etc]# /app/php/sbin/php-fpm
[root@lnmp etc]# netstat -utpln | grep php
tcp        0      0 172.16.1.30:9000            0.0.0.0:*                   LISTEN      39741/php-fpm         

修改Nginx配置文件

[root@lnmp etc]# cd /app/nginx/conf/
[root@lnmp conf]# cp nginx.conf nginx.conf.bak
[root@lnmp conf]# grep -Ev "#|^$" nginx.conf.default >nginx.conf
[root@lnmp conf]# vim nginx.conf
[root@lnmp conf]# cat nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  192.168.1.30;
        location / {
            root   html/www;
            index  index.html index.htm index.php;
            location ~* .*\.(php|php5)?$ {
                   fastcgi_pass 172.16.1.30:9000;
                   fastcgi_index index.php;
                   include fastcgi.conf;
             }     
	}	
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
[root@lnmp conf]# /app/nginx/sbin/nginx -t
nginx: the configuration file /app/nginx-1.12.2//conf/nginx.conf syntax is ok
nginx: configuration file /app/nginx-1.12.2//conf/nginx.conf test is successful

重新啟動(dòng)Nginx服務(wù):

[root@lnmp etc]# /app/nginx/sbin/nginx -s reload

測(cè)試:

[root@lnmp etc]# cd /app/nginx/html/
[root@lnmp html]# ls
50x.html  index.html
[root@lnmp html]# vim test_php.php
[root@lnmp html]# cat test_php.php 
<?php
phpinfo();
?>
網(wǎng)頁訪問:192.168.1.30/test_php.php出現(xiàn)php頁面,代表正常

部署WordPress個(gè)人博客

下載安裝包:

[root@lnmp tools]# wget https://cn.wordpress.org/wordpress-4.7.3-zh_CN.tar.gz
[root@lnmp tools]# tar xf wordpress-4.7.3-zh_CN.tar.gz

部署站點(diǎn):

[root@lnmp tools]# mkdir -p /app/nginx/html/www
[root@lnmp tools]# mv wordpress/* /app/nginx/html/www
[root@lnmp tools]# chown -R www.www /app/nginx/html/www/

創(chuàng)建數(shù)據(jù)庫(kù)信息:

[root@lnmp tools]# mysql -uroot -p123123
mysql> create database wordpress;
Query OK, 1 row affected (0.01 sec)
mysql> grant all on wordpress.* to 'wordpress'@'localhost' identified by '123123';
Query OK, 0 rows affected (0.04 sec)

登錄網(wǎng)站配置網(wǎng)站:

http://ip/wp-admin

在這里插入圖片描述

主機(jī)默認(rèn)localhost。截錯(cuò)了

在這里插入圖片描述

在這里插入圖片描述

在這里插入圖片描述

到這里基本就部署好了,里面的一些詳細(xì)配置就不說了。。。

以上就是Nginx服務(wù)LNMP之WordPress部署流程步驟的詳細(xì)內(nèi)容,更多關(guān)于Nginx服務(wù)LNMP WordPress部署的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • 一篇文章讀懂nginx的gzip_static模塊

    一篇文章讀懂nginx的gzip_static模塊

    gzip是針對(duì)于請(qǐng)求實(shí)時(shí)進(jìn)行壓縮,cpu開銷大,gzip_static?完全可以在編譯后使用壓縮工具搞出來,下面這篇文章主要給大家介紹了如何通過一篇文章讀懂nginx的gzip_static模塊,需要的朋友可以參考下
    2022-05-05
  • keepalived監(jiān)控nginx進(jìn)程的實(shí)現(xiàn)示例

    keepalived監(jiān)控nginx進(jìn)程的實(shí)現(xiàn)示例

    本文主要介紹了keepalived監(jiān)控nginx進(jìn)程的實(shí)現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-08-08
  • 解決httpd占用80端口導(dǎo)致Nginx啟動(dòng)失敗報(bào)錯(cuò)的解決辦法

    解決httpd占用80端口導(dǎo)致Nginx啟動(dòng)失敗報(bào)錯(cuò)的解決辦法

    今天在建自己小網(wǎng)站時(shí)啟動(dòng)Nginx時(shí),發(fā)現(xiàn)其報(bào)下列錯(cuò)誤,意思是因?yàn)?0端口被占用導(dǎo)致Nginx啟動(dòng)失敗,所以本文小編給大家介紹介紹如何解決解決httpd占用80端口導(dǎo)致Nginx啟動(dòng)不成功報(bào)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    2023-11-11
  • Nginx中定義404頁面并且返回404狀態(tài)碼的正確方法

    Nginx中定義404頁面并且返回404狀態(tài)碼的正確方法

    這篇文章主要介紹了Nginx中定義404頁面并且返回404狀態(tài)碼的正確方法,本文在一次AJAX調(diào)用時(shí)發(fā)現(xiàn)了這個(gè)問題,服務(wù)器返回了一個(gè)404頁頁但沒有返回404狀態(tài)碼,需要的朋友可以參考下
    2014-08-08
  • Nginx服務(wù)器中HTTP 301跳轉(zhuǎn)到帶www的域名的方法

    Nginx服務(wù)器中HTTP 301跳轉(zhuǎn)到帶www的域名的方法

    這篇文章主要介紹了Nginx服務(wù)器中HTTP 301跳轉(zhuǎn)到帶www的域名的方法,包括從HTTPS 301提示跳轉(zhuǎn)等rewrite相關(guān)的方法,需要的朋友可以參考下
    2015-07-07
  • nginx-proxy-manager初次登錄報(bào)錯(cuò)502?bad?gateway解決

    nginx-proxy-manager初次登錄報(bào)錯(cuò)502?bad?gateway解決

    這篇文章主要給大家介紹了關(guān)于nginx-proxy-manager初次登錄報(bào)錯(cuò)502?bad?gateway的解決辦法,502?Bad?Gateway服務(wù)器作為網(wǎng)關(guān)或者代理時(shí),為了完成請(qǐng)求訪問下一個(gè)服務(wù)器,但該服務(wù)器返回了非法的應(yīng)答,需要的朋友可以參考下
    2024-04-04
  • nginx 偽靜態(tài)化rewrite規(guī)則

    nginx 偽靜態(tài)化rewrite規(guī)則

    用Nginx的朋友可以參考,加到nginx.conf相應(yīng)主機(jī)server段配置中即可!
    2009-10-10
  • 一文讀懂Ingress-Nginx的實(shí)踐

    一文讀懂Ingress-Nginx的實(shí)踐

    Ingress-Nginx是Kubernetes中管理HTTP和HTTPS流量的重要工具,本文深入探討Ingress-Nginx工作原理、配置及最佳實(shí)踐,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-11-11
  • nginx中的proxy_redirect的使用案例詳解

    nginx中的proxy_redirect的使用案例詳解

    proxy_redirect 該指令用來修改被代理服務(wù)器返回的響應(yīng)頭中的Location頭域和“refresh”頭域,這篇文章主要介紹了nginx中的proxy_redirect的使用案例詳解,需要的朋友可以參考下
    2024-06-06
  • 詳解前端到底可以用nginx做什么

    詳解前端到底可以用nginx做什么

    Nginx因?yàn)樗姆€(wěn)定性、豐富的模塊庫(kù)、靈活的配置和低系統(tǒng)資源的消耗而聞名,下面這篇文章主要給大家介紹了關(guān)于前端到底可以用nginx做什么的相關(guān)資料,需要的朋友可以參考下
    2022-02-02

最新評(píng)論

当涂县| 郯城县| 东明县| 西宁市| 历史| 神池县| 讷河市| 绥江县| 浮山县| 陇西县| 马鞍山市| 孟津县| 黄骅市| 平遥县| 扎兰屯市| 马边| 扬中市| 凤阳县| 化德县| 雷州市| 铁岭市| 丘北县| 武鸣县| 大化| 海南省| 海林市| 大石桥市| 洱源县| 正镶白旗| 信丰县| 宣恩县| 黔东| 阿拉尔市| 海安县| 沈阳市| 新津县| 历史| 衡山县| 得荣县| 黎城县| 上饶县|