最近自己手动装了个linux系统。需要安装nginx。把流程记录下
1、从官网下载安装包上传
2、进入目录输入命令 tar -zxvf ngix压缩包 解压
3、解压后进入到根目录下运行“./configure”命令进行初始化配置。如提示 the HTTP rewrite module requires the PCRE library 则需要安装pcre
4、安装玩pcre后再次鱼腥“./configure”命令会生成启动路径
5、运行make install
6、切换到步骤4的nginx目录下。运行./nginx启动
7、可能出现错误“while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory”。我也不知道啥玩意
百度说好像是缺少什么lib文件。运行一下命令就好了
32位:
1 | #查看lib库 |
2 | # ls /lib/ |grep pcre |
3 | libpcre.so.0 |
4 | libpcre.so.0.0.1 |
5 | #添加软连接 |
6 | # ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1 |
1 | #查看lib库 |
2 | # ls /lib64/ |grep pcre |
3 | libpcre.so. 0 |
4 | libpcre.so. 0.0 . 1 |
5 | #添加软连接 |
6 | # ln -s /lib64/libpcre.so. 0.0 . 1 /lib64/libpcre.so. 1 |
进入到 /etc/sysconfig目录下。使用vi命令编辑iptables文件。新增一行80端口即可(复制22那行改成80)
9、配置完毕后,运行命令 service iptables restart 重启
10、访问ok
参考网址:
http://www.linuxidc.com/Linux/2015-03/114988.htm
http://blog.csdn.net/zhangsify/article/details/54234029
http://blog.csdn.net/white__cat/article/details/37923087