首页IT科技centos安装MySQL数据库(Centos安装Nginx)

centos安装MySQL数据库(Centos安装Nginx)

时间2025-06-20 17:26:57分类IT科技浏览3842
导读:1、下载Nginx安装包 快速下载:wgethttp://nginx.org/download/nginx-1.18.0.tar.gz...

1            、下载Nginx安装包

快速下载:wgethttp://nginx.org/download/nginx-1.18.0.tar.gz

官网下载:http://nginx.org/en/download.html

2                 、安装相关依赖

安装或更新gcc-c++ 依赖

yum -y install gcc gcc-c++ autoconf automake make

否则在安装过程中会报错如下:

./configure: error: C compiler cc is not found

安装或更新pcre      、openssl

yum -y install pcre-devel

yum -y install openssl openssl-devel

否则在安装过程中会报错如下:

./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-pcre=<path> option.

安装或更新常用解压或打包工具

yum install -y zip unzip

3            、解压Nginx安装包

# 解压到当前目录 tar zxvf nginx-1.18.0.tar.gz

4                 、配置安装运行目录

# 进入nginx解压目录下 cd /usr/local/nginx/nginx-1.18.0 # 配置安装运行命令 ./configure --prefix=/usr/local/nginx/nginx

5      、执行编译安装

make && make install

6      、启动Nginx

# 进入到运行目录 cd /usr/local/nginx/nginx # 启动Nginx并指定配置文件 -t 测试配置文件是否正确 ./sbin/nginx -s stop -c conf/nginx.conf # 停止Nginx -s quit(等待进程处理完毕进行关闭) ./sbin/nginx -s stop # 重启 ./sbin/nginx -s reload

默认监听80端口           ,访问测试即可

http://IP/

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
香港vps租用国内(香港服务器租用如何选择带宽)