如何建设网站网站建设安全技术
如何建设网站,网站建设安全技术,wordpress 目录权限设置,程序员开发网Nginx 安装
下载 nginx
下载地址#xff1a;http://nginx.org/en/download.html 将下载好的压缩包拷贝到根目录下
通过xshell如果出现 bash: rz: 未找到命令 #xff0c;需要先运行下面的命令
yum -y install lrzsz安装
解压到当前目录
tar -zxvf nginx-1.22.1.tar.gz安…Nginx 安装
下载 nginx
下载地址http://nginx.org/en/download.html 将下载好的压缩包拷贝到根目录下
通过xshell如果出现 bash: rz: 未找到命令 需要先运行下面的命令
yum -y install lrzsz安装
解压到当前目录
tar -zxvf nginx-1.22.1.tar.gz安装依赖 yum install -y gcc
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel编译安装 cd /root/nginx-1.22.1
./configure --prefix/usr/local/nginx
make
make install启动
进入安装好的目录 /usr/local/nginx/sbin
./nginx 启动
./nginx -s stop 快速停止
./nginx -s quit 优雅关闭在退出前完成已经接受的连接请求
./nginx -s reload 重新加载配置防火墙设置
关闭防火墙
systemctl stop firewalld禁止开机启动
systemctl disable firewalld重启防火墙
systemctl start firewalld放行端口
firewall-cmd --zonepublic --add-port80/tcp --permanent安装完成服务
创建服务脚本
vi /usr/lib/systemd/system/nginx.service文件内容
[Unit]
Descriptionnginx - web server
Afternetwork.target remote-fs.target nss-lookup.target
[Service]
Typeforking
PIDFile/usr/local/nginx/logs/nginx.pid
ExecStartPre/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload/usr/local/nginx/sbin/nginx -s reload
ExecStop/usr/local/nginx/sbin/nginx -s stop
ExecQuit/usr/local/nginx/sbin/nginx -s quit
PrivateTmptrue
[Install]
WantedBymulti-user.target重新加载系统服务
systemctl daemon-reload启动
systemctl start nginx开机启动
systemctl enable nginx访问通过CentOS的IP地址即可访问
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/89590.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!