博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
4.26 Alias 4.27-29 php编译安装 4.30 编译安装Nginx
阅读量:6836 次
发布时间:2019-06-26

本文共 24784 字,大约阅读时间需要 82 分钟。

hot3.png

4.26 Alias

Alias别名:

一条命令的另外一个名字,你可以理解为外号。举例:	网卡配置文件路径很长,每次敲这个命令都要花很长时间,可以做一个别名:	alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'vi ~/.bashrc  //针对当前用户的,换一个用户就不好使了vi /etc/bashrc //针对所有用户,不仅仅是当前用户。	在这个文件最后面增加:alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'

 

4.27-29 php编译安装

下载PHP

cd /usr/local/srcwget http://cn2.php.net/distributions/php-7.3.0.tar.bz2

解压

tar jxvf php-7.3.0.tar.bz2

编译

cd php-7.3.0编译参数:./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-opensslmakemake install

配置文件:

cd /usr/local/php-fpm/cp php-fpm.conf.default php-fpm.confcd /usr/local/src/php-7.3.0cp php.ini-development  /usr/local/php-fpm/etc/php.inicd /usr/local/php-fpm/etc/php-fpm.d/cp www.conf.default www.conf

启动脚本:

cd /usr/local/src/php-7.3.0cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpmchkconfig --add php-fpmchkconfig php-fpm onchmod 755 /etc/init.d/php-fpm

补充:

vi 里面在一般模式下,按dd可以删除行(剪切),5dd(剪切5行),光标挪到要粘贴的位置,按p。操作错误之后,想要撤销,可以按u,反着撤销按 ctrl r; 一般模式下按gg可以把光标定位到首行,按G可以定位到末行; 按yy复制,5yy复制5行;显示行号,在一般模式里输入:set nu; 定位到指定的行:一般模式下直接按数字G,如10G

编译安装一个软件包的步骤:

./configure  ; make; make install grep -i 忽略大小写

错误1:

checking for cc... nochecking for gcc... no解决: yum install -y gcc

错误2:

error: libxml2 not found解决:yum install -y libxml2-devel

错误3:

error: Cannot find OpenSSL's解决:yum install -y openssl-devel

错误4:

error: cURL version 7.15.5 or later is required 解决:yum install -y libcurl-devel

错误5:

configure: error: jpeglib.h not found解决:yum install -y libjpeg-turbo-devel

错误6:

configure: error: png.h not found解决:yum install -y libpng-devel

错误7:

configure: error: freetype-config not found.解决: yum install -y freetype-devel

错误8:

configure: error: wrong mysql library version or lib not found解决:下载一个低版本的MySQL/Mariadbwget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gztar jxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gzmv mysql-5.6.39-linux-glibc2.12-x86_64 /usr/local/mysql5.6改编译参数./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.7 --with-mysqli=/usr/local/mysql5.7/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.7 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl

错误9:

ERROR: [pool www] cannot get uid for user 'php-fpm'解决:useradd  php-fpm

补充:

diff 查看两个文件的差异的,如 diff 1.txt 2.txt

 

4.30 编译安装Nginx

官网:

官方文档:

下载:

wget http://nginx.org/download/nginx-1.14.2.tar.gz

解压:

tar zxvf nginx-1.14.2.tar.gzcd nginx-1.14.2

编译:

./configure --prefix=/usr/local/nginx --with-http_ssl_modulemake && make install

启动:

/usr/local/nginx/sbin/nginx
  • © 2019 GitHub, Inc.

 

代码:

[root@test01 ~]# cd /usr/local/src[root@test01 src]# lsmariadb-10.3.12-linux-x86_64.tar.gz[root@test01 src]# wget http://cn2.php.net/distributions/php-7.3.1.tar.bz2--2019-01-25 22:31:11--  http://cn2.php.net/distributions/php-7.3.1.tar.bz2正在解析主机 cn2.php.net (cn2.php.net)... 36.51.255.144正在连接 cn2.php.net (cn2.php.net)|36.51.255.144|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:14812823 (14M) [application/octet-stream]正在保存至: “php-7.3.1.tar.bz2”100%[===============================================>] 14,812,823   484KB/s 用时 52s    2019-01-25 22:32:04 (276 KB/s) - 已保存 “php-7.3.1.tar.bz2” [14812823/14812823])[root@test01 src]# lsmariadb-10.3.12-linux-x86_64.tar.gz  php-7.3.1.tar.bz2[root@test01 src]# lsmariadb-10.3.12-linux-x86_64.tar.gz  php-7.3.1.tar.bz2[root@test01 src]# tar jxvf php-7.3.1.tar.bz2            提示没有安装bzip2tar (child): bzip2:无法 exec: 没有那个文件或目录tar (child): Error is not recoverable: exiting nowtar: Child returned status 2tar: Error is not recoverable: exiting now[root@test01 src]# yum install -y bzip2 |less           安装一下[root@test01 src]# tar jxf php-7.3.1.tar.bz2 [root@test01 src]# lsmariadb-10.3.12-linux-x86_64.tar.gz  php-7.3.1  php-7.3.1.tar.bz2[root@test01 src]# [root@test01 src]# cd php-7.3.1[root@test01 php-7.3.1]# lsacinclude.m4      ltmain.sh                     README.RELEASE_PROCESSaclocal.m4        main                          README.SELF-CONTAINED-EXTENSIONSappveyor          makedist                      README.STREAMSbuild             Makefile.frag                 README.SUBMITTING_PATCHbuildconf         Makefile.gcov                 README.TESTINGbuildconf.bat     Makefile.global               README.UNIX-BUILD-SYSTEMCODING_STANDARDS  missing                       README.WIN32-BUILD-SYSTEMconfig.guess      mkinstalldirs                 run-tests.phpconfig.sub        NEWS                          sapiconfigure         pear                          scriptsconfigure.ac      php7.spec.in                  server-tests-config.phpCONTRIBUTING.md   php.gif                       server-tests.phpCREDITS           php.ini-development           snapshotext               php.ini-production            stamp-h.inEXTENSIONS        README.EXT_SKEL               testsfooter            README.GIT-RULES              travisgenerated_lists   README.input_filter           TSRMgenfiles          README.MAILINGLIST_RULES      UPGRADINGheader            README.md                     UPGRADING.INTERNALSINSTALL           README.NEW-OUTPUT-API         vcscleaninstall-sh        README.PARAMETER_PARSING_API  win32LICENSE           README.REDIST.BINS            Zend[root@test01 php-7.3.1]# [root@test01 php-7.3.1]# ./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-opensslconfigure: WARNING: unrecognized options: --with-mysql, --with-mcrypt, --enable-gd-native-ttfchecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for a sed that does not truncate output... /usr/bin/sedchecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for cc... nochecking for gcc... noconfigure: error: in `/usr/local/src/php-7.3.1':configure: error: no acceptable C compiler found in $PATHSee `config.log' for more details错误1:缺少gcc这个包[root@test01 php-7.3.1]#yum install -y gcc安装一下错误2:缺少libxm12包configure: error: libxml2 not found. Please check your libxml2 installation.[root@test01 php-7.3.1]# yum list |grep libxml2     搜索一下libxml2.x86_64                              2.9.1-6.el7_2.3            @anacondalibxml2-python.x86_64                       2.9.1-6.el7_2.3            @base    libxml2.i686                                2.9.1-6.el7_2.3            base     libxml2-devel.i686                          2.9.1-6.el7_2.3            base     libxml2-devel.x86_64                        2.9.1-6.el7_2.3            base     libxml2-static.i686                         2.9.1-6.el7_2.3            base     libxml2-static.x86_64                       2.9.1-6.el7_2.3            base    [root@test01 php-7.3.1]# echo $?1[root@test01 php-7.3.1]# yum install -y libxml2-devel 安装一下错误3:缺少Opensslconfigure: error: Cannot find OpenSSL's 
[root@test01 php-7.3.1]# yum list |grep -i openssl grep匹配搜索-i忽略大小写 openssl.x86_64 1:1.0.1e-60.el7 @anacondaopenssl-libs.x86_64 1:1.0.1e-60.el7 @anacondaapr-util-openssl.x86_64 1.5.2-6.el7 base openssl.x86_64 1:1.0.2k-16.el7 base openssl-devel.i686 1:1.0.2k-16.el7 base openssl-devel.x86_64 1:1.0.2k-16.el7 base openssl-libs.i686 1:1.0.2k-16.el7 base openssl-libs.x86_64 1:1.0.2k-16.el7 base openssl-perl.x86_64 1:1.0.2k-16.el7 base openssl-static.i686 1:1.0.2k-16.el7 base openssl-static.x86_64 1:1.0.2k-16.el7 base openssl098e.i686 0.9.8e-29.el7.centos.3 base openssl098e.x86_64 0.9.8e-29.el7.centos.3 base perl-Crypt-OpenSSL-Bignum.x86_64 0.04-18.el7 base perl-Crypt-OpenSSL-RSA.x86_64 0.28-7.el7 base perl-Crypt-OpenSSL-Random.x86_64 0.04-21.el7 base pyOpenSSL.x86_64 0.13.1-4.el7 base pyOpenSSL-doc.noarch 0.13.1-4.el7 base xmlsec1-openssl.i686 1.2.20-7.el7_4 base xmlsec1-openssl.x86_64 1.2.20-7.el7_4 base xmlsec1-openssl-devel.i686 1.2.20-7.el7_4 base xmlsec1-openssl-devel.x86_64 1.2.20-7.el7_4 base [root@test01 php-7.3.1]# yum install -y openssl-devel 安装一下错误4: error: cURL version 7.15.5 or later is required to compile php with cURL support[root@test01 php-7.3.1]# yum list |grep -i curlcurl.x86_64 7.29.0-51.el7 @base libcurl.x86_64 7.29.0-51.el7 @base python-pycurl.x86_64 7.19.0-19.el7 @anacondalibcurl.i686 7.29.0-51.el7 base libcurl-devel.i686 7.29.0-51.el7 base libcurl-devel.x86_64 7.29.0-51.el7 base perl-WWW-Curl.x86_64 4.15-13.el7 base [root@test01 php-7.3.1]# yum install -y libcurl-devel 安装一下错误5:error: jpeglib.h not found.[root@test01 php-7.3.1]# yum list |grep -i jpeglibjpeg-turbo.x86_64 1.2.90-5.el7 @anacondalibjpeg-turbo.i686 1.2.90-6.el7 base libjpeg-turbo.x86_64 1.2.90-6.el7 base libjpeg-turbo-devel.i686 1.2.90-6.el7 base libjpeg-turbo-devel.x86_64 1.2.90-6.el7 base libjpeg-turbo-static.i686 1.2.90-6.el7 base libjpeg-turbo-static.x86_64 1.2.90-6.el7 base libjpeg-turbo-utils.x86_64 1.2.90-6.el7 base openjpeg.x86_64 1.5.1-18.el7 base openjpeg-devel.i686 1.5.1-18.el7 base openjpeg-devel.x86_64 1.5.1-18.el7 base openjpeg-libs.i686 1.5.1-18.el7 base openjpeg-libs.x86_64 1.5.1-18.el7 base turbojpeg.i686 1.2.90-6.el7 base turbojpeg.x86_64 1.2.90-6.el7 base turbojpeg-devel.i686 1.2.90-6.el7 base turbojpeg-devel.x86_64 1.2.90-6.el7 base [root@test01 php-7.3.1]# yum install -y libjpeg-turbo-devel错误6:error: png.h not found.[root@test01 php-7.3.1]# yum list |grep pnglibpng.x86_64 2:1.5.13-7.el7_2 @anacondalibpng.i686 2:1.5.13-7.el7_2 base libpng-devel.i686 2:1.5.13-7.el7_2 base libpng-devel.x86_64 2:1.5.13-7.el7_2 base libpng-static.i686 2:1.5.13-7.el7_2 base libpng-static.x86_64 2:1.5.13-7.el7_2 base libpng12.i686 1.2.50-10.el7 base libpng12.x86_64 1.2.50-10.el7 base libpng12-devel.i686 1.2.50-10.el7 base libpng12-devel.x86_64 1.2.50-10.el7 base optipng.x86_64 0.7.4-4.el7 base pngcrush.x86_64 1.7.59-4.el7 base pngnq.x86_64 1.1-9.el7 base texlive-dvipng.noarch 2:svn26689.1.14-43.el7 base texlive-dvipng-bin.x86_64 2:svn26509.0-43.20130427_r30134.el7texlive-dvipng-doc.noarch 2:svn26689.1.14-43.el7 base[root@test01 php-7.3.1]# yum list |grep png|grep devel 可以连续grep匹配多次libpng-devel.i686 2:1.5.13-7.el7_2 base libpng-devel.x86_64 2:1.5.13-7.el7_2 base libpng12-devel.i686 1.2.50-10.el7 base libpng12-devel.x86_64 1.2.50-10.el7 base [root@test01 php-7.3.1]# yum install -y libpng-devel错误7:error: freetype-config not found.,[root@test01 php-7.3.1]# yum list |grep freetypefreetype.x86_64 2.4.11-12.el7 @anacondafreetype.i686 2.8-12.el7 base freetype.x86_64 2.8-12.el7 base freetype-demos.x86_64 2.8-12.el7 base freetype-devel.i686 2.8-12.el7 base freetype-devel.x86_64 2.8-12.el7 base [root@test01 php-7.3.1]# yum install -y freetype-devel错误8:error: wrong mysql library version or lib not found. Check config.log for more information. 提示mysql版本不匹配下载一个低版本的mysql/mariadb也可以去掉编译中的--with-mysql=/usr/local/mysql 结果这个方法没用[root@test01 src]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz 下载一个5.7的mysql[root@test01 src]# tar zxf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz 解压不加v不显示过程[root@test01 src]# mv mysql-5.7.23-linux-glibc2.12-x86_64 /usr/local/mysql5.7[root@test01 php-7.3.1]# cd php-7.3.1[root@test01 php-7.3.1]# ./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.7 --with-mysqli=/usr/local/mysql5.7/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.7 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl改mysql的路径改成5.7configure: WARNING: unrecognized options: --with-mysql, --with-mcrypt, --enable-gd-native-ttf[root@test01 php-7.3.1]# echo $?0[root@test01 php-7.3.1]# make 把源码包变成二进制包[root@test01 php-7.3.1]# echo $?0[root@test01 php-7.3.1]# make install[root@test01 php-7.3.1]# echo $?0 如果要卸载的话。rm -rvf /usr/local/php-fpm/卸载掉,用history可以查看装了多少rpm包,也可以卸载掉这些安装的rpm包,但其实影响不大,不用去remove也没关系[root@test01 php-7.3.1]# ls /usr/local/php-fpm/bin etc include lib php sbin var[root@test01 php-7.3.1]# cd !$cd /usr/local/php-fpm/[root@test01 php-7.3.1]# ls bin etc include lib php sbin var[root@test01 php-fpm]# cd etc/[root@test01 etc]# lspear.conf php-fpm.conf.default php-fpm.d[root@test01 etc]# cp php-fpm.conf.default php-fpm.conf 拷贝生成模板配置文件,不然Php没办法启动[root@test01 etc]# lspear.conf php-fpm.conf php-fpm.conf.default php-fpm.d[root@test01 etc]# cd /usr/local/src/php-7.3.1[root@test01 php-7.3.1]# lsacinclude.m4 libtool README.NEW-OUTPUT-APIaclocal.m4 LICENSE README.PARAMETER_PARSING_APIappveyor ltmain.sh README.REDIST.BINSbuild main README.RELEASE_PROCESSbuildconf makedist README.SELF-CONTAINED-EXTENSIONSbuildconf.bat Makefile README.STREAMSCODING_STANDARDS Makefile.frag README.SUBMITTING_PATCHconfig.guess Makefile.fragments README.TESTINGconfig.log Makefile.gcov README.UNIX-BUILD-SYSTEMconfig.nice Makefile.global README.WIN32-BUILD-SYSTEMconfig.status Makefile.objects run-tests.phpconfig.sub missing sapiconfigure mkinstalldirs scriptsconfigure.ac modules server-tests-config.phpCONTRIBUTING.md NEWS server-tests.phpCREDITS pear snapshotext php7.spec stamp-h.inEXTENSIONS php7.spec.in testsfooter php.gif travisgenerated_lists php.ini-development TSRMgenfiles php.ini-production UPGRADINGheader README.EXT_SKEL UPGRADING.INTERNALSinclude README.GIT-RULES vcscleanINSTALL README.input_filter win32install-sh README.MAILINGLIST_RULES Zendlibs README.md[root@test01 php-7.3.1]# diff php.ini-development php.ini-production (左)测试及开发用配置文件,(右)生产用配置文件。比较两个配置文件有哪些地方有不同86c86< ; This is the php.ini-development INI file.---> ; This is the php.ini-production INI file.155a156,160> ; track_errors> ; Default Value: Off> ; Development Value: On> ; Production Value: Off> 455c460< error_reporting = E_ALL---> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT472c477< display_errors = On---> display_errors = Off483c488< display_startup_errors = On---> display_startup_errors = Off520c525,527< ; Store the last error/warning message in $php_errormsg (boolean).---> ; Store the last error/warning message in $php_errormsg (boolean). Setting this value> ; to On can assist in debugging and is appropriate for development servers. It should> ; however be disabled on production servers.1201c1208< mysqlnd.collect_memory_statistics = On---> mysqlnd.collect_memory_statistics = Off1580c1587< zend.assertions = 1---> zend.assertions = -11886c1893< ;opcache.huge_code_pages=0---> ;opcache.huge_code_pages=1[root@test01 php-7.3.1]# cp php.ini-development /usr/local/php-fpm/etc/php.ini把另一个模板配置文件拷贝到/usr/local/php-fpm/etc/下。一共两个配置文件,一个是服务本身的配置文件,一个是php的配置文件[root@test01 php-7.3.1]# [root@test01 php-7.3.1]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 拷贝启动脚本[root@test01 php-7.3.1]# chkconfig --add php-fpm[root@test01 php-7.3.1]# chkconfig --list注意:该输出结果只显示 SysV 服务,并不包含原生 systemd 服务。SysV 配置数据可能被原生 systemd 配置覆盖。 如果您想列出 systemd 服务,请执行 'systemctl list-unit-files'。 欲查看对特定 target 启用的服务请执行 'systemctl list-dependencies [target]'。mysqld 0:关 1:关 2:开 3:开 4:开 5:开 6:关netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关network 0:关 1:关 2:开 3:开 4:开 5:开 6:关php-fpm 0:关 1:关 2:开 3:开 4:开 5:开 6:关[root@test01 php-7.3.1]# chkconfig php-fpm on[root@test01 php-7.3.1]# chkconfig --list注意:该输出结果只显示 SysV 服务,并不包含原生 systemd 服务。SysV 配置数据可能被原生 systemd 配置覆盖。 如果您想列出 systemd 服务,请执行 'systemctl list-unit-files'。 欲查看对特定 target 启用的服务请执行 'systemctl list-dependencies [target]'。mysqld 0:关 1:关 2:开 3:开 4:开 5:开 6:关netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关network 0:关 1:关 2:开 3:开 4:开 5:开 6:关php-fpm 0:关 1:关 2:开 3:开 4:开 5:开 6:关[root@test01 php-7.3.1]# service php-fpm startUnit php-fpm.service could not be found.env: /etc/init.d/php-fpm: 权限不够[root@test01 php-7.3.1]# chmod 755 /etc/init.d/php-fpm [root@test01 php-7.3.1]# service php-fpm startUnit php-fpm.service could not be found.Starting php-fpm [26-Jan-2019 01:15:26] WARNING: Nothing matches the include pattern '/usr/local/php-fpm/etc/php-fpm.d/*.conf' from /usr/local/php-fpm/etc/php-fpm.conf at line 143.[26-Jan-2019 01:15:26] ERROR: No pool defined. at least one pool section must be specified in config file[26-Jan-2019 01:15:26] ERROR: failed to post process the configuration[26-Jan-2019 01:15:26] ERROR: FPM initialization failed failed 定义配置池子[root@test01 php-7.3.1]# vi /usr/local/php-fpm/etc/php-fpm.conf 定位到143行[1]+ 已停止 vi /usr/local/php-fpm/etc/php-fpm.conf[root@test01 php-7.3.1]# cd /usr/local/php-fpm/etc/php-fpm.d/[root@test01 php-fpm.d]# lswww.conf.default[root@test01 php-fpm.d]# cp www.conf.default www.conf[root@test01 php-fpm.d]# lswww.conf www.conf.default[root@test01 php-fpm.d]# service php-fpm startUnit php-fpm.service could not be found.Starting php-fpm [26-Jan-2019 01:23:36] ERROR: [pool www] cannot get uid for user 'php-fpm'[26-Jan-2019 01:23:36] ERROR: FPM initialization failed failed 没有php-fpm这个用户[root@test01 php-fpm.d]# useradd php-fpm[root@test01 php-fpm.d]# service php-fpm startUnit php-fpm.service could not be found.Starting php-fpm done[root@test01 php-fpm.d]# ps aux |grep php-fpmroot 52445 0.0 0.1 126348 1704 pts/1 T 01:17 0:00 vi /usr/local/php-fpm/etc/php-fpm.confroot 52482 0.0 0.6 127148 6196 ? Ss 01:26 0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)php-fpm 52483 0.0 0.6 127148 6104 ? S 01:26 0:00 php-fpm: pool wwwphp-fpm 52484 0.0 0.6 127148 6104 ? S 01:26 0:00 php-fpm: pool wwwroot 52487 0.0 0.0 112728 980 pts/1 R+ 01:27 0:00 grep --color=auto php-fpm[root@test01 php-fpm.d]# netstat -lntpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 973/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1253/master tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 52482/php-fpm: mast tcp6 0 0 :::3306 :::* LISTEN 3244/mysqld tcp6 0 0 :::22 :::* LISTEN 973/sshd tcp6 0 0 ::1:25 :::* LISTEN 1253/master 编译安装nginx[root@test01 php-fpm.d]# cd /usr/local/src/[root@test01 src]# lsmariadb-10.3.12-linux-x86_64.tar.gz php-7.3.1mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz php-7.3.1.tar.bz2[root@test01 src]# wget http://120.52.51.15/nginx.org/download/nginx-1.14.2.tar.gz--2019-01-26 01:32:39-- http://120.52.51.15/nginx.org/download/nginx-1.14.2.tar.gz正在连接 120.52.51.15:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:1015384 (992K) [application/octet-stream]正在保存至: “nginx-1.14.2.tar.gz”100%[===============================================>] 1,015,384 536KB/s 用时 1.8s 2019-01-26 01:32:41 (536 KB/s) - 已保存 “nginx-1.14.2.tar.gz” [1015384/1015384])[root@test01 src]# tar zxf nginx-1.14.2.tar.gz [root@test01 src]# cd nginx-1.14.2[root@test01 nginx-1.14.2]# lsauto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src[root@test01 nginx-1.14.2]# [root@test01 nginx-1.14.2]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module[root@test01 nginx-1.14.2]# echo $?0[root@test01 nginx-1.14.2]# make && install 意思是前面的命令成功才会运行后面的命令,如果不成功不运行。[root@test01 nginx-1.14.2]# echo $?0[root@test01 conf]# /usr/local/nginx/sbin/nginx 启动nginx 没有启动脚本不太好管理[root@test01 conf]# ps aux |grep nginxroot 55077 0.0 0.1 45844 1128 ? Ss 01:46 0:00 nginx: master process /usr/local/nginx/sbin/nginxnobody 55078 0.0 0.1 46292 1896 ? S 01:46 0:00 nginx: worker processroot 55080 0.0 0.0 112728 980 pts/1 R+ 01:46 0:00 grep --color=auto ngin[root@test01 conf]# netstat -ltnp |grep nginxtcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 55077/nginx: master [root@test01 conf]# /usr/local/nginx/sbin/nginx 配置文件路径[root@test01 conf]# vi nginx.conf

 

转载于:https://my.oschina.net/u/3708120/blog/3006139

你可能感兴趣的文章
物理删除和逻辑删除
查看>>
MFC中使用ADO的记录集
查看>>
nodejs中 require 方法的加载规则
查看>>
webpack学习笔记一:安装webpack、webpack-dev-server、内存加载js和html文件、loader处理非js文件...
查看>>
jQuery
查看>>
RH253读书笔记(2)-Lab 2 System Resource Access Controls
查看>>
miterLimit和lineJoin属性
查看>>
用手抓饭增食欲
查看>>
就算会用python画颗心,可你依然还是只单身狗
查看>>
#5 string and custom functions && regular expressions
查看>>
.net mvc 分页
查看>>
django 中静态文件项目加载问题
查看>>
评价cnblogs的用户体验
查看>>
我的Android进阶之旅------>Android疯狂连连看游戏的实现之开发游戏界面(二)
查看>>
我的Android进阶之旅------>Android利用温度传感器实现带动画效果的电子温度计
查看>>
HTML中添加音乐video embed audio
查看>>
Docker 镜像的导入和导出
查看>>
Java第二次作业
查看>>
Java面试003-前端篇
查看>>
who
查看>>