Nginx安装
来源:互联网 发布:网络信息安全漫画 编辑:程序博客网 时间:2024/06/15 21:10
准备工作:
1:一台linux服务器or虚拟机
2:jdk安装包
3:tomcat
4:nginx安装包
安装步骤:
1:将jdk,nginx,tomcat上传到服务器
2:安装配置jdk(略)
3:安装nginx
1)解压nginx压缩包 tar -zxvf nginx-1.6.2.tar.gz
2)安装依赖库
yum install pcre yum install pcre-devel
yum install zlib yum install zlib-devel
3)cd 到解压的nginx目录执行配置命令
./configure --prefix=/usr/local/nginx
注意最后是否报error错误。./configure: error: the HTTP rewrite module requires the PCRE library. .....缺少 PCRE lib
执行:yum -y install pcre-devel openssl openssl-devel
4)make && make install
5)进入到nginx/sbin启动./nginx -c /usr/local/nginx/conf/nginx.conf
6)验证nginx是否启动成功 访问http://ip:80 看是否key正常打开nginx的首页
7)如果正常那么恭喜你nginx安装成功了
4:nginx配置简单的tomcat
1)解压tomcat,不需要修改配置,直接启动使用8080端口
2)找的nginx/conf/nginx.conf文件修改配置信息如下:
server {
listen 80;
server_name localhost:80;
location{
proxy_pass http://localhost:8080;
}
}
3)修改完配置文件需要判别下修改的是否正确
执行 /usr/local/nginx/sbin/nginx -t
4)保存,重启nginx
/usr/nginx/sbin/nginx -s reload
5)访问http://ip:80 观察到可以访问到首页omcat
- nginx笔记:nginx安装
- Nginx-----源码安装nginx
- 【nginx】nginx的安装
- 安装Nginx
- nginx安装
- 安装 nginx
- 安装nginx
- 安装 Nginx
- nginx安装
- Nginx安装
- 安装Nginx
- 安装nginx
- nginx安装
- 安装nginx
- Nginx安装
- nginx安装
- nginx安装
- nginx 安装
- leapmotion驱动安装
- 新手基础(二)Head First Java练习:public class Mix4
- 根据指定的学科, 取出点击量前三的
- 535. Encode and Decode TinyURL
- 【队列】之链式存储结构
- Nginx安装
- springboot零侵入配置mybatis插件
- 洛谷 P1731 生日蛋糕
- 使用Http访问网络并且使用正则获取需要用到的图片链接
- [Hackerrank题目选做] Kundu and Tree 组合数学
- 欢迎使用CSDN-markdown编辑器
- uwp开发之Windows.Data.Json解析json
- 计算机组成原理——输入输出系统
- 设计模式->结构型模式->享元模式