- 浏览: 245779 次
- 性别:
- 来自: 成都
文章分类
- 全部博客 (144)
- J2EE (19)
- 数据库 (9)
- 操作系统 (8)
- 编程综合 (3)
- 软件工程 (2)
- 互联网 (12)
- 云计算 (16)
- C++编程 (1)
- Python (8)
- Ruby (23)
- iPhone (14)
- Android (3)
- Symbian (1)
- 手机开发 (3)
- 版本管理 (2)
- Linux (10)
- Lighttpd (3)
- 应用服务器 (5)
- HTML5 (2)
- VMware (1)
- PHP (11)
- Apache (0)
- Nginx (0)
- ASP.NET (1)
- ASP (2)
- Javascript (2)
- Flex (1)
- 无线组网 (1)
- CSS (1)
最新评论
-
kpcbk:
你好,这个破解版好像数据超过25条就显示不出来了,是不是破解有 ...
Flex中使用fusioncharts破解版配置 -
zay1007:
as 文件有错啊
Flex中使用fusioncharts破解版配置 -
aruis:
很不错,今天正好用到了。氧吧那里下载的as文件报错。你这里的就 ...
Flex中使用fusioncharts破解版配置 -
李晓进:
安装后之后点了扫描之后解码不出信息来呀????????O(∩_ ...
条码扫描二维码扫描——ZXing android 源码简化 -
kittychina:
很好,继续!
PHP开源CMS-Drupal做视频站点(第1版)
This guide can be used in the case we need to run Nginx on Amazon due to a bug that affects the EPEL package repository and maybe some other repository.
That’s why I leave this “Step by Step” to compile and build the RPM for CentOS and RHEL. It is functional in Amazon EC2 instances.
The first thing you need to do is to install the “checkinstall” to generate the RPM.
If you’re going to do it on a 32bit system just do the following:
yum install checkinstall
To do that we have to have the RPMforge Repository in our system.
If we have a 64 bits system we are going to need to download the checkinstall 32bits RPM using the following link, and install it:
wget http://packages.sw.be/checkinstall/checkinstall-1.6.0-3.el5.rf.i386.rpm rpm -Uvh checkinstall-1.6.0-3.el5.rf.i386.rpm
Then install the needed RPM packages to compile Nginx:
yum install rpm-devel rpm-build openssl-devel zlib-devel pcre pcre-devel gcc make
Now we have to download the Nginx code and generate the RPM:
mkdir -p /root/src cd /root/src wget http://nginx.org/download/nginx-0.8.54.tar.gz tar xzf nginx-0.8.54.tar.gz cd nginx-0.8.54
We are now ready to compile and generate the RPM:
./configure --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/ --prefix=/usr/share/nginx --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid make checkinstall --fstrans=no
We need to follow the steps asked by checkinstall and then install the generated RPM.
Finally we have to copy and paste in a file to add to “init.d” and then be able to run it as any service.
By the end of this “Step by Step” there is an example of how to do it.
As a last step we only have to start it like a normal service.
vim /etc/init.d/nginx # Paste here the example named "Example to start service" /etc/init.d/nginx start
I hope this to be usefull for you. If we want to use, for example, PHP 5.2 we can download PHP and Nginx compatible with Amazon Kernel(Xen Kernel) from the CentosALT Repository.
Example to start service.
#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/etc/nginx/nginx.conf" [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest_q || configtest || return 6 stop start } reload() { configtest_q || configtest || return 6 echo -n $"Reloading $prog: " killproc $nginx -HUP echo } configtest() { $nginx -t -c $NGINX_CONF_FILE } configtest_q() { configtest >/dev/null 2>&1 } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } # Upgrade the binary with no downtime. upgrade() { local pidfile="/var/run/${prog}.pid" local oldbin_pidfile="${pidfile}.oldbin" configtest_q || configtest || return 6 echo -n $"Staring new master $prog: " killproc $nginx -USR2 retval=$? echo sleep 1 if [[ -f ${oldbin_pidfile} && -f ${pidfile} ]]; then echo -n $"Graceful shutdown of old $prog: " killproc -p ${oldbin_pidfile} -QUIT retval=$? echo return 0 else echo $"Something bad happened, manual intervention required, maybe restart?" return 1 fi } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; force-reload|upgrade) rh_status_q || exit 7 upgrade ;; reload) rh_status_q || exit 7 $1 ;; status|status_q) rh_$1 ;; condrestart|try-restart) rh_status_q || exit 7 restart ;; *) echo $"Usage: $0 {start|stop|reload|configtest|status|force-reload|upgrade|restart}" exit 2 esac
Source: Netman Blog
Tags: amazon apache centos checkinstall config ec2 EPEL nginx rhel rpmforge Server
发表评论
-
VMware ESX/ESXi Server 功能初探及效能測試
2011-08-12 10:07 2042經過前一篇 VMware Server 的效能測試之後,馬 ... -
在Amazon EC2 Amazon Linux上安装Mysql Nginx REE Rails Passenger
2011-08-08 17:10 2208第一步:Amazon Linux默认安装ruby,所以要移除原 ... -
开发进阶:如何提高云中应用程序的可靠性
2011-07-21 09:50 1178摘要: 本文主要探究如何通过采用一个负载均衡器和永久性磁 ... -
Amazon EC2 使用操作筆記(使用Elasticfox) (转)
2011-07-21 09:47 1759From http://blog.longwin.com. ... -
将您的 Linux 应用程序迁移到 Amazon 云,第 4 部分: 征服管理挑战
2011-07-20 17:55 1257避免您发展过程中的难题 Sean A. Walbe ... -
将您的 Linux 应用程序迁移到 Amazon 云,第 3 部分: 实现可扩展性
2011-07-20 17:51 1039简单地实现更大流量支持 Sean A. Walbe ... -
将您的 Linux 应用程序迁移到 Amazon 云,第 2 部分: 提高应用程序可靠性
2011-07-20 17:47 1053如何提高您迁移的 Linux 应用程序的可靠性 S ... -
将您的 Linux 应用程序迁移到 Amazon 云,第 1 部分: 初始迁移
2011-07-20 15:37 4如何将您的应用程序迁 ... -
Automaticlly install mysql ree rails on Amazon EC2 Amazon Linux
2011-07-20 15:00 925yum remove -y ruby yum install ... -
[收藏]云计算:亚马逊网络服务(AWS)探秘
2011-06-08 09:47 1438从贮存到支付,云计算的领导者(亚马逊)提供了一系列的低价 ... -
将您的 Linux 应用程序迁移到 Amazon 云,第 1 部分: 初始迁移
2011-05-19 16:56 1168如何将您的应用程序迁移到云中 Sean A. Wa ... -
[AmazonEC2] 在instance上安装apache+php+mysql+phpmyadmin
2011-05-18 16:58 13311.用putty链接instance,以root身份运行并进入 ... -
Amazon的aws服务使用笔记
2011-05-12 12:19 3178注明:其实不用下列那么麻烦,SecureCRT的新版本是 ... -
Amazon AWS EC2免费一年的云VPS申请教程3
2011-05-12 10:33 2340点击Select,进入向导第二步: 实例数,默认为1,f ... -
Amazon AWS EC2免费一年的云VPS申请教程2
2011-05-12 10:25 4793填写信用卡信息 Amazon EC2一般的付费模式是On D ... -
Amazon AWS EC2免费一年的云VPS申请教程1
2011-05-12 10:24 3174本文适用对象 您希望建立自己的英特网漫游隧道 您有一张可以 ...
相关推荐
How To Install nginx on CentOS 6 with yum
install nginx for windows.pdf
nginx-autoinstall, 在Debian和Ubuntu上,使用定制模块从源代码编译 Nginx 自动安装通过optionnal模块编译和安装 Nginx 。 兼容性x86,x64,arm*Debian 8和更高版本Ubuntu 16.04和更高版本特性最新的主线或者稳定...
nginx独立安装部署,替换配置文件即可用,解决依赖问题。
Nginx 的源代码使用 2-clause BSD-like license。 Nginx 是一个很强大的高性能Web和反向代理服务,它具有很多非常优越的特性: 在连接高并发的情况下,Nginx是Apache服务不错的替代品:Nginx在美国是做虚拟主机生意...
Nginx一键安装 install-nginx.sh nginx-1.21.1.tar.gz
内容概要:该安装包为1.22.1版本的 nginx 源码包...2.使用命令配置环境变量:export PATH=$PATH:/usr/local/nginx/sbin 3.使用命令测试是否配置成功:nginx -v 资源亲测可用,整理不易,还请各位大佬简单打赏一下。
Nginx注册成windows服务,以后重启不需要再手动启动Nginx了
centos7.9yum装nginx1.20.1关于stream模块失效的报错,如unknown directive “stream” in /etc/nginx/nginx.conf(非编译安装)
yum install -y nginx systemctl start nginx.service ln -s /usr/lib/systemd/system/nginx.service systemctl enable nginx.service nginx -t -c /etc/nginx/nginx.conf 直接修改vim /etc/selinux/config找到...
multi-install-nginx.sh
shell脚本全自动下载源码安装各个nginx版本,创建虚拟主机。自动更新国内yum源(行epel,remi源)
Ansible批量安装nginx
window nginx-1.18.0 WinSW.exe install nginx start nginx.exe -s stop
lnmp安装(nginx mysql php )
nginx-1.18安装步骤 附件上传至服务器/opt/nginx cd /opt/nginx tar zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure make make install tar zxvf pcre-8.40.tar.gz cd pcre-8.40 ./configure make make ...
linux 下安装和配置nginx服务器。
在完全无互联网连接的情况下,离线安装nginx。 nginx版本号:nginx-1.20.1-2.el7.x86_64 食用方法: 1.解压 2.进入解压目录 3.rpm安装全部 4.安装完成
linux下nginx离线安装rpm依赖包 ,gcc-c++-4.8.5、install_nginx_rpm_rely、install_nginx_rpm_rely、zip-3.0-11.el7.x86_64、nginx-1.17.3.tar.gz
nginx 离线安装包nginx 离线安装包