当前位置: 首页 > news >正文

网站建设 律师网站制作网络推广关键词排名

网站建设 律师,网站制作网络推广关键词排名,汽车配件加工网,崇安区网站建设价格目录 1、源码编译安装nginx 2、分别编写基于RHEL6和RHEL7的脚本。 2.1 RHEL6的nginx系统服务脚本 2.2 RHEL7的nginx系统服务脚本 1、源码编译安装nginx 1.首先关闭防火墙和selinux [rootnode13 ~]# systemctl stop firewalld [rootnode13 ~]# setenforce 0 2.准备环境node13 ~]# systemctl stop firewalld [rootnode13 ~]# setenforce 0 2.准备环境C和C的编译环境 [rootnode13 ~]# yum install -y gcc gcc-c make 3.下载nginx安装包或者使用wget直接上传 链接http://nginx.org/download/ 4.解压安装包 [rootnode13 ~]# tar xf nginx-1.22.0.tar.gz -C /usr/local/src/ [rootnode13 ~]# cd /usr/local/src/nginx-1.22.0/ 5.安装依赖项配置nginx [rootnode13 nginx-1.22.0]# yum install -y pcre-devel zlib-devel [rootnode13 nginx-1.22.0]# ./configure --prefix/usr/local/nginx 6.进行编译安装 [rootnode13 nginx-1.22.0]# make [rootnode13 nginx-1.22.0]# make install 2、分别编写基于RHEL6和RHEL7的脚本。 2.1 RHEL6的nginx系统服务脚本 【1】编写系统服务脚本/etc/init.d/nginx [rootnode13 ~]# vim /etc/init.d/nginx        # 主要修改以下两句 nginx${NGINX-/usr/local/nginx/sbin/nginx} conffile${CONFFILE-/usr/local/nginx/conf/nginx.conf} #!/bin/sh # # nginx Startup script for nginx # # chkconfig: - 85 15 # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # description: nginx is an HTTP and reverse proxy server # ### BEGIN INIT INFO # Provides: nginx # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop nginx ### END INIT INFO# Source function library. . /etc/rc.d/init.d/functionsif [ -L $0 ]; theninitscript/bin/readlink -f $0 elseinitscript$0 fisysconfig/bin/basename $initscriptif [ -f /etc/sysconfig/$sysconfig ]; then. /etc/sysconfig/$sysconfig finginx${NGINX-/usr/local/nginx/sbin/nginx} prog/bin/basename $nginx conffile${CONFFILE-/usr/local/nginx/conf/nginx.conf} lockfile${LOCKFILE-/var/lock/subsys/nginx} pidfile${PIDFILE-/var/run/nginx.pid} SLEEPMSEC${SLEEPMSEC-200000} UPGRADEWAITLOOPS${UPGRADEWAITLOOPS-5} RETVAL0start() {echo -n $Starting $prog: daemon --pidfile${pidfile} ${nginx} -c ${conffile}RETVAL$?echo[ $RETVAL 0 ] touch ${lockfile}return $RETVAL }stop() {echo -n $Stopping $prog: killproc -p ${pidfile} ${prog}RETVAL$?echo[ $RETVAL 0 ] rm -f ${lockfile} ${pidfile} }reload() {echo -n $Reloading $prog: killproc -p ${pidfile} ${prog} -HUPRETVAL$?echo }upgrade() {oldbinpidfile${pidfile}.oldbinconfigtest -q || returnecho -n $Starting new master $prog: killproc -p ${pidfile} ${prog} -USR2echofor i in /usr/bin/seq $UPGRADEWAITLOOPS; do/bin/usleep $SLEEPMSECif [ -f ${oldbinpidfile} -a -f ${pidfile} ]; thenecho -n $Graceful shutdown of old $prog: killproc -p ${oldbinpidfile} ${prog} -QUITRETVAL$?echoreturnfidoneecho $Upgrade failed!RETVAL1 }configtest() {if [ $# -ne 0 ] ; thencase $1 in-q)FLAG$1;;*);;esacshiftfi${nginx} -t -c ${conffile} $FLAGRETVAL$?return $RETVAL }rh_status() {status -p ${pidfile} -b ${nginx} ${nginx} }# See how we were called. case $1 instart)rh_status /dev/null 21 exit 0start;;stop)stop;;status)rh_statusRETVAL$?;;restart)configtest -q || exit $RETVALstopstart;;upgrade)rh_status /dev/null 21 || exit 0upgrade;;condrestart|try-restart)if rh_status /dev/null 21; thenstopstartfi;;force-reload|reload)reload;;configtest)configtest;;*)echo $Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}RETVAL2 esacexit $RETVAL 【2】修改配置文件/usr/local/nginx/conf/nginx.conf # 找到配置以下pid: pid        /var/run/nginx.pid; 【3】增加执行权限 [rootnode13 init.d]# chmod x nginx 【4】添加系统服务设置开机自启动 [rootnode13 init.d]# chkconfig --add nginx  [rootnode13 init.d]# chkconfig nginx on [rootnode13 init.d]# chkconfig --list nginx        # 查看服务列表 Note: This output shows SysV services only and does not include native       systemd services. SysV configuration data might be overridden by native       systemd configuration.       If you want to list systemd services use systemctl list-unit-files.       To see services enabled on particular target use       systemctl list-dependencies [target]. nginx              0:off    1:off    2:on    3:on    4:on    5:on    6:off 【5】测试脚本     [rootnode13 init.d]# service nginx start  Starting nginx (via systemctl):                            [  OK  ] [rootnode13 init.d]# netstat -lnupt | grep 80 tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7026/nginx: master   在浏览器上输入自己的IP地址看是否可以访问到nginx首页 [rootnode13 init.d]# service nginx stop        # 停止服务看能否停止 Stopping nginx (via systemctl):                            [  OK  ] [rootnode13 init.d]# netstat -lnupt | grep 80        # 查看端口 再次访问浏览器就访问不到了 2.2 RHEL7的nginx系统服务脚本 【1】编写系统服务脚本/usr/lib/systemd/system/nginx.service [Unit] DescriptionThe nginx HTTP and reverse proxy server Afternetwork-online.target remote-fs.target nss-lookup.target Wantsnetwork-online.target[Service] Typeforking PIDFile/run/nginx.pid ExecStartPre/usr/bin/rm -f /run/nginx.pid ExecStartPre/usr/local/nginx/sbin/nginx -t ExecStart/usr/local/nginx/sbin/nginx ExecReload/usr/sbin/nginx -s reload KillSignalSIGQUIT TimeoutStopSec5 KillModeprocess PrivateTmptrue[Install] WantedBymulti-user.target 【2】修改配置文件/usr/local/nginx/conf/nginx.conf # 找到配置以下pid: pid        /var/run/nginx.pid; 【3】增加执行权限 [rootnode13 system]# chmod x nginx.service 【4】测试脚本 [rootnode13 system]# systemctl daemon-reload  [rootnode13 system]# systemctl start nginx [rootnode13 system]# netstat -lnupt | grep 80 tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      17196/nginx: master [rootnode13 system]# systemctl stop nginx         [rootnode13 system]# netstat -lnupt | grep 80
http://www.pierceye.com/news/842054/

相关文章:

  • 重庆关键词优化咸阳seo培训
  • 专业网站建设分类标准嘉兴网络项目建站公司
  • 做婚礼网站的公司简介网页打不开怎么办页面无法显示
  • 怎么套用模板做网站白嫖二级域名
  • 网站如何进行备案建立平台的步骤
  • 济南免费网站建设网站用什么软件编写
  • 网站如何注册微信公众平台 类型站长要维护网站
  • 美食类网站模板有的网站为什么打不开怎么回事
  • 平面设计网站导航1万元可以注册公司吗
  • 做网站接口多少钱怎样做旅游网站
  • dw制作旅游网站教程天津市区县档案部门网站建设指导意见
  • 关于网站建设的大学pinthis wordpress
  • 济宁 做网站企业做外贸网站常用术语
  • 国内优秀的设计网站推荐网页设计工作室赚钱吗
  • 商汇通网站广州白云学校网站建设
  • 茶叶企业建设网站php网站开发基础
  • 深圳网站建设 猴王网络地方信息网站源码
  • 微网站后台内容设置erp系统定制
  • 图片点击切换网站模板网站开发 北京外包公司
  • 网站正在建设中 免费东莞手机网站设计公司
  • 旅游网站开发成本包括企业管理控制系统
  • 青浦做网站中美最新局势分析
  • 高端网站建设公司哪家公司好有关网站开发的知识
  • 西宁做网站_君博示范cpa做电影网站侵权吗
  • 云梦网站开发什么是网络营销市场营销学
  • 六安建六安建设网站徐州招标信息网
  • 公司做一个网站内容如何设计方案效果图网址
  • 环保部网站建设项目验收方案软件界面设计工具都有什么
  • 外贸 静态网站 怎么做微信红包建设网站
  • 南京网站优化哪家好卖文具的网站建设