1.安装准备依赖lib库
yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
安装Nginx
2.安装之前,检查一下是否已经安装有nginx
find -name nginx
如果系统已经安装了nginx,那么就先卸载
yum remove nginx
yum安装nginx
3.新建
/etc/yum.repos.d/nginx.repo
添加以下,以centos7为例
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/rhel/7/$basearch/
gpgcheck=0
enabled=1
rpm –import http://nginx.org/keys/nginx_signing.key

yum install nginx
/bin/systemctl status nginx.service

4.配置:

安装后,NGINX的网站目录位于:
/usr/share/nginx/html
NGINX的配置文件位于:
/etc/nginx/ nginx.conf

nginx -t 测试配置文件
nginx -v 查看相关版本

1.按照官方手册,在centos中加个源

vi /etc/yum.repos.d/mongodb-org-3.2.repo 加入以下内容

[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

保存之后 用yum安装

Read More →

1.安装nodejs编译环境

yum -y install gcc make gcc-c++ openssl-devel wget
2.下载以及解压node
wget https://nodejs.org/dist/v4.4.2/node-v4.4.2.tar.gz
tar -zxvf node-v4.4.2.tar.gz
cd node-v4.4.2

3.编译以及安装
.configure
make && make install

4.查看安装的版本
node -v

会出现 v4.4.2

一、centos联网  cd /etc/sysconfig/network-scripts/

ls一下 可以看到有个ifcfg-eno16777736  当然centos7以前的好像是ifcfg-eth0  文件

vi ifcfg-eno16777736  只需要修改其中一项把no改成yes

ONBOOT=yes#开机启动

然后重启  shutdown -r now  你的centos就可以联网了,接下来我们把其设为静态IP

Read More →

环境 32位centos nginx1.6 nodejs4.4.0

1.安装nodejs
2.安装nodejs的部署神器 pm2 (npm install -g pm2)[注意用root账号全局安装]
3.利用nginx部署nodejs项目【这里用的是反向代理。nginx配置如下demo】
upstream nginx.shangzh.com {
server localhost:8000;
}
server
{
listen 80;
server_name shangzh.com;

location / {
proxy_pass http://nginx.x.shangzh.com;
}

}
Read More →