当前位置: 首页 > Linux

小白在Linux的阿里云服务器上安装nginx,温馨提示

时间:2023-04-06 06:15:43 Linux

1。阿里云有免费服务器,带一台回家。2.重置实例密码,然后重新链接。3、安装nginx所需的基础库://yuminstallnginx环境yum-yinstallmakezlibzlib-develgcc-c++libtoolopensslopenssl-develpcrepcre-devel4、下载nginx:(自己找地方)wgethttp://nginx.org/download/nginx-1.22.1.tar.gz5。解压:tar-zxvfnginx-1.22.1.tar.gz6。全部使用默认安装:./configuremake&&makeinstall执行完成后nginx运行文件会安装到/usr/local/nginx下。7、修改安全组规则:8、默认启动:./sbin/nginx#热加载配置文件./sbin/nginx-sreload其他常用命令:#查看nginx进程ps-ef|grepnginx#终止进程sudokill-9pidGzip错误:nginx:[emerg]unknowndirective“gzip_static”in/usr/local/nginx/conf/nginx.conf:46cd/usr/local/src/nginx-1.22.1./configure--prefix=/usr/local/nginx--with-http_gzip_static_modulemakemakeinstall#重启nginx