PHP套模板做网站,陕西江川建设有限公司公司网站,企业营销型网站概念,采购管理系统的功能有哪些1、官网下载安装包
官网#xff1a;http://nginx.org/en/download.html
选择适合Linux的版本#xff0c;这里选择最新的版本#xff0c;下载到本地后上传到服务器或者centos下直接wget命令下载。 切换到/usr/local目录#xff0c;下载软件包
# cd /usr/local
# wget htt…1、官网下载安装包
官网http://nginx.org/en/download.html
选择适合Linux的版本这里选择最新的版本下载到本地后上传到服务器或者centos下直接wget命令下载。 切换到/usr/local目录下载软件包
# cd /usr/local
# wget http://nginx.org/download/nginx-1.11.5.tar.gz
2、安装nginx
先执行以下命令安装nginx依赖库,如果缺少依赖库可能会安装失败。
# yum install gcc-c pcre pcre-devel zlib zlib-devel openssl openssl-devel
解压安装包
# tar -zxvf nginx-1.11.5.tar.gz
nginx被解压到了/usr/local/nginx-1.11.5 目录下不要把压缩包解压到/usr/local/nginx目录下或者将解压后的目录重命名为nginx因为nginx会默认安装到/usr/local/nginx目录下切换到nginx-1.11.5/目录执行# ./configure
# cd /usr/local/nginx-1.11.5/
# ./configure
该操作会检测当前系统环境以确保能成功安装nginx执行该操作后可能会出现以下几种提示 checking for OS Linux 3.10.0-123.el7.x86_64 x86_64checking for C compiler ... not found./configure: error: C compiler cc is not found如果出现以上错误提示信息执行yum install gcc-c安装gcc./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using --with-pcrepath option.如果出现上面提示表示缺少PCRE库./configure: error: the HTTP gzip module requires the zlib library.You can either disable the module by using --without-http_gzip_moduleoption, or install the zlib library into the system, or build the zlib librarystatically from the source with nginx by using --with-zlibpath option.如果出现以上提示表示缺少zlib库 如果没有出现./configure: error提示表示当前环境可以安装nginx执行make和make install编译nginx。
# make
# make install
没有出错的话表示nginx已经成功安装完成默认安装位置为/usr/local/nginx,之前的/usr/local/nginx-1.11.5/可以删除掉了。
如果出现cp: conf/koi-win and /usr/local/nginx/conf/koi-win are the same file可能是你把安装包解压到了/usr/local/nginx目录解决办法是将该目录重命名为其他名称后再执行make,make install.
3、配置nginx开机启动
切换到/lib/systemd/system/目录创建nginx.service文件vim nginx.service
# cd /lib/systemd/system/
# vim nginx.service
文件内容如下
[Unit]
Descriptionnginx
Afternetwork.target[Service]
Typeforking
ExecStart/usr/local/nginx/sbin/nginx
ExecReload/usr/local/nginx/sbin/nginx reload
ExecStop/usr/local/nginx/sbin/nginx quit
PrivateTmptrue[Install]
WantedBymulti-user.target
退出并保存文件执行systemctl enable nginx.service使nginx开机启动
systemctl start nginx.service 启动nginx
systemctl stop nginx.service 结束nginx
systemctl restart nginx.service 重启nginx
4、验证是否安装成功
输入http://服务器IP/ 如果能看到nginx的界面就表示安装成功了