位置: 编程技术 - 正文

Ubuntu下安装nginx的步骤分享(ubuntu下安装win10)

编辑:rootadmin
1)、下载   sudo wget 2)、解压   sudo tar -xzvf nginx-1.2.2.tar.gz 3)、进入相关目录进行以下操作 复制代码代码如下: ./configure make sudo make install   如果你运气好的话,一切ok,不过...........哈哈。Ubuntu默认的策略是什么库都不装,依赖的库都需要自已手工安装搞定。 一般都会出错的,那么我们来看看可能出现的问题。 4)、常见问题解决办法   缺少pcre library ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.    解决方法:下载安装pcre-8.解决问题,解压后对pcre进行如下操作 复制代码代码如下: sudo wget sudo tar -xzvf pcre-8..tar.gz cd /usr/local/src/pcre-8. ./configure make sudo make install   运气好一次通过,运气不好,make pcre时会出错 缺少gcc-c++和libtool,也就是c++编译包 复制代码代码如下: libtool: compile: unrecognized option `-DHAVE_CONFIG_H' libtool: compile: Try `libtool --help' for more information. make[1]: *** [pcrecpp.lo] Error 1 make[1]: Leaving directory `/usr/local/src//pcre-8.' make: *** [all] Error 2root@wolfdog-virtual-machine:~/work/pcre-8.$ libtool -help -DHAVE_CONFIG_H The program 'libtool' is currently not installed. You can install it by typing: sudo apt-get install libtool 解决方法:需要先安装libtool和gcc-c++ ?sudo apt-get install libtool sudo apt-get install gcc-c++   大爷啊~~~这时候可能又会报错啊,坑爹啊~~~   缺少openssl库 复制代码代码如下: ./configure: error: the HTTP cache module requires md5 functions from OpenSSL library. You can either disable the module by using --without-http-cache option, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-http_ssl_module --with-openssl=<path> options. 缺少zlib库 复制代码代码如下: ./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.    解决办法:少什么就安装什么呗。 sudo apt-get install openssl libssl-dev libperl-dev 4)、解决了以上问题,编译nginx就没啥问题了。下面安装。(附加安装插件的方法)   先下载插件并解压 复制代码代码如下: sudo wget -O echo-nginx-module.tar.gz sudo wget -O memc-nginx-module.tar.gz sudo tar -xzvf echo-nginx-module.tar.gz sudo tar -xzvf memc-nginx-module.tar.gz   进入nginx目录cd nginx-1.2.2/,执行以下命令 复制代码代码如下: ./configure --user=www-data --group=www-data --with-debug --with-http_gzip_static_module --with-http_ssl_module --with-pcre=../pcre-8./ --with-http_perl_module --with-perl=/usr/bin/perl --with-http_stub_status_module --with-http_realip_module --prefix=/usr/local/nginx --add-module=../agentzh-echo-nginx-module-/ --add-module=../agentzh-memc-nginx-module-/ 注:前面一段是一些编译参数,后面add-module是添加模块 make -j2 make install 大爷的,又可能报错。没有nginx,logs目录访问权限 复制代码代码如下: [alert]: could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (: Permission denied) // :: [emerg] #0: mkdir() "/usr/local/nginx/client_body_temp" failed (: Permission denied)    解决办法: 复制代码代码如下: sudo chmod a+rwx -R logs sudo chmod a+rwx -R /usr/local/nginx    现在,差不多没问题了。 可以进入/usr/local/nginx/sbin/执行以下命令看是否成功:   nginx -v 5)、nginx自启动 编辑启动脚本: 复制代码代码如下: sudo vim /etc/init.d/nginx 复制代码代码如下: #! /bin/bash # # nginx Start up the nginx server daemon # # chkconfig: # Description: starts and stops the nginx web server # ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: starts and stops the nginx web server ### END INIT INFO # To install: # copy this file to /etc/init.d/nginx # shell> chkconfig --add nginx (RedHat) # shell> update-rc.d -f nginx defaults (debian) # To uninstall: # shell> chkconfig --del nginx (RedHat) # shell> update-rc.d -f nginx remove PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nginx DAEMON=/usr/local/nginx/sbin/$NAME CONFIGFILE=/usr/local/nginx/conf/$NAME.conf PIDFILE=/var/local/nginx/logs/$NAME.pid ULIMIT= set -e [ -x "$DAEMON" ] || exit 0 do_start() { echo "Starting $NAME ..." ulimit -SHn $ULIMIT $DAEMON -c $CONFIGFILE } do_stop() { echo "Shutting down $NAME ..." kill 'cat $PIDFILE' } do_reload() { echo "Reloading $NAME ..." kill -HUP 'cat $PIDFILE' } case "$1" in start) [ ! -f "$PIDFILE" ] && do_start || echo "nginx already running" echo -e ".ndone" ;; stop) [ -f "$PIDFILE" ] && do_stop || echo "nginx not running" echo -e ".ndone" ;; restart) [ -f "$PIDFILE" ] && do_stop || echo "nginx not running" do_start echo -e ".ndone" ;; reload) [ -f "$PIDFILE" ] && do_reload || echo "nginx not running" echo -e ".ndone" ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|reload}" >&2 exit 1 ;; esac exit 0 红色部分,根据自己的路径修改。 6)、常用命令 重启nginx:service nginx restart 启动:service nginx start 关闭:service nginx stop 7)、linux常用命令 tar(z-用 gzip 对存档压缩或解压;x-从存档展开文件;v-详细显示处理的文件;f-指定存档或设备) tar –zxvf nginx-0.8..tar.gz ip查看 ifconfig 编译 make 安装编译好的源码包 make install 编辑文件 sudo gedit /etc/profile 修改根限:chmod说明(u:与文件属主拥有一样的权限[a:所有人];+:增加权限;rwx:可读可写可执行) -R:递归所有目录和文件 sudo chmod a+rwx -R logs 检查是库是否安装成功 dpkg --list|grep openssl 下载安装库 sudo apt-get install libtool 检查服务启动是否正常 ps -ef|grep 查找openssl安装路径 whereis openssl 更新源 sudo apt-get update 更新已安装的包 sudo apt-get upgrade

推荐整理分享Ubuntu下安装nginx的步骤分享(ubuntu下安装win10),希望有所帮助,仅作参考,欢迎阅读内容。

Ubuntu下安装nginx的步骤分享(ubuntu下安装win10)

文章相关热门搜索词:ubuntu下安装yosys,ubuntu下安装pycharm教程,ubuntu下安装visual studio,ubuntu下安装windows,ubuntu下安装虚拟机,ubuntu下安装visual studio,ubuntu下安装pycharm教程,ubuntu下安装win10,内容如对您有帮助,希望把文章链接给更多的朋友!

Windows和Ubuntu时间不一致的问题的解决方法 在Windows中把时间设置正确了过后,回到在Ubuntu后系统的时间又不一样了,在Ubuntu中把时间设置正确后进入Windows后,时间又不一致了。出现这种情况的原

Ubuntu下实现分区的永久挂载的方法 大家都知道在Linux下可以随意的把分区挂载到一个空文件夹中,使用命令mount驱动器名文件夹名即可,但是这个操作需要root权限,而且每次开机之后都要

Ubuntu下基于格式化命令 格式化U盘的方法 但是有一种情况就比较揪心,就是当分区出现问题而不能识别的时候,这时在Win下要专业的工具才能格式化,而在Ubuntu下可以借助命令模式强行格式化

标签: ubuntu下安装win10

本文链接地址:https://www.jiuchutong.com/biancheng/356428.html 转载请保留说明!

上一篇:在Ubuntu里使用Windows的无线网卡驱动程序的方法教程(win ubuntu)

下一篇:Windows和Ubuntu时间不一致的问题的解决方法(ubuntu和windows哪个流畅)

  • 所得税报表的营业成本
  • 房屋租赁如何开增值税专用发票
  • 增值税应纳税额的计算
  • 预期信用损失影响坏账准备吗
  • 收到项目投资款账务处理
  • 公司车辆卖给个人怎么处理账务
  • 各种收入与应纳税额的比例
  • 事业单位预收账款属于什么科目
  • 以前的货款用银行账户吗
  • 自产自销免税物品包括哪些
  • 交易性金融资产的交易费用计入哪里
  • 办企业房权证费用多少
  • 持有债券到期收到现金属于什么活动
  • 个人所得税申报退税的条件
  • 建筑业企业包括哪些企业
  • 小规模纳税人自开专票
  • 危险废物处理原则
  • 销售已使用过的固定资产增值税
  • 出租房产业务企业所得税如何处理?
  • 生产成本属于什么会计要素
  • 采购发票主要包括什么可以根据什么单据流转生成
  • 通过拍卖取得的车牌号,过期了怎么办
  • 应收账款转营业外收入怎么写申请
  • mac双系统删除window后怎么重新恢复
  • u盘转移到另一个u盘
  • 软件开发并销售怎么做
  • 跨年度暂估成本入账冲回如何会计分录
  • 上个月转出的进项税,下个月申报
  • 图解 http
  • windows11永久解决蓝屏
  • 从劳务市场雇人受伤了怎么办?
  • phpserialize
  • 在php中,字符串有哪些表示形式
  • 债务担保可以税前抵扣吗
  • 个人转让公司限额多少
  • 偷税行为五年后被发现要接受行政处罚吗?
  • php常用数组函数有哪些
  • 原材料按实际成本核算需设置的科目包括
  • html里面有什么
  • vue权限管理面试题
  • html前端开发教程
  • 借款利息记入短期借款吗
  • 税控维护费可以抵企业所得税吗
  • 现代服务业加计抵减最新政策2022
  • sqlserver存储过程声明变量
  • 职工教育经费税收金额怎么算
  • 股权转让所得如何申报个税
  • 什么是ad域服务
  • 物业费分解
  • 应收账款的账龄怎么分析
  • 金税四期上线后对保险
  • 小规模企业免税收入会计分录
  • 会计中应收账款属于什么科目
  • 政府扶持资金怎么做账
  • 代理运费增值税税率
  • 购买土地的入账价值包括什么
  • 收到销项负数发票怎么做分录
  • 车辆使用费包括油费吗
  • 管理费用一般包含研发费用吗
  • 银行流水账单怎么删
  • Win10预览版怎么变回正式版
  • xp系统如何做
  • windows10已激活
  • host文件没有
  • window预览
  • windows8有几个模式
  • Linux编译内核无法启动
  • 四个版本的雪国开头翻译
  • android 实例
  • cocos onload
  • js数据的基本类型有哪些
  • jQuery展示表格点击变色、全选、删除
  • js的匿名函数
  • python中的字典与列表属于什么类型
  • android保存文件到本地
  • shell脚本实际运用
  • jQuery插件封装时如要实现链式编程,需要
  • 2022款进口途锐
  • 政府主管部门对企业检查要求
  • 河南工商年检网上申报APP
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设