ubuntu 安装tenginx

首先要检查Linux环境中有没有安装Apache 因为Apache和Nginx同样占领了80 端口,如果同时开启会发生冲突。所以安装了Apache的可以先改变其默认端口。我没有安装Apache 所以可以直接安装tenginx步骤:apt-get install libpcre3 libpcre3-devapt-get install openssl libssl-devapt-get i...
摘要由CSDN通过智能技术生成

首先要检查Linux环境中有没有安装Apache 因为Apache和Nginx同样占领了80 端口,如果同时开启会发生冲突。所以安装了Apache的可以先改变其默认端口。
我没有安装Apache 所以可以直接安装tenginx
步骤:
apt-get install libpcre3 libpcre3-dev
apt-get install openssl libssl-dev
apt-get install gcc g++ make
将tenginx安装包传入root文件夹下并解压
然后 ./configure
top 查看进程
make
make install
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
vim /etc/init.d/nginx

将以下内容配置到文件中
#! /bin/sh

BEGIN INIT INFO

Provides: nginx

Required-Start: $remote_fs $syslog

Required-Stop: $remote_fs $syslog

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: nginx init.d dash script for Ubuntu or other *nix.

Description: nginx init.d dash script for Ubuntu or other *nix.

END INIT INFO

#------------------------------------------------------------------------------

nginx - this Debian Almquist shell (dash) script, starts and stops the nginx

daemon for Ubuntu and other *nix releases.

description: Nginx is an HTTP(S) server, HTTP(S) reverse \

proxy and IMAP/POP3 proxy server. This \

script will manage the initiation of the \

server and it’s process state.

processname: nginx

config: /usr/local/nginx/conf/nginx.conf

pidfile: /usr/local/nginx/logs/nginx.pid

Provides: nginx

Author: Jason Giedymin

<jason.giedymin AT gmail.com>.

Version: 3.7.0 30-JAN-2014 jason.giedymin AT gmail.com

Notes: nginx init.d dash script for Ubuntu.

Tested with: Ubuntu 13.10, nginx-1.5.9

This script’s project home is:

http://github.com/JasonGiedymin/nginx-init-ubuntu

#------------------------------------------------------------------------------

MIT X11 License

#------------------------------------------------------------------------------

Copyright © 2008-2013 Jason Giedymin, http://jasongiedymin.com

Permission is hereby granted, free of charge, to any person obtaining

a copy of this software and associated documentation files (the

“Software”), to deal in the Software without restriction, including

without limitation the rights to use, copy, modify, merge, publish,

distribute, sublicense, and/or sell copies of the Software, and to

permit persons to whom the Software is furnished to do so, subject to

the following conditions:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值