nginx下载站点搭建及其美化
nginx加载ngx-fancyindex模块一起编译 模块加载插件
先下载编译环境
yum install gcc gcc-c++ wget vim-enhanced autoconf automake openssl-devel pcre-devel unzip
1.下载nginx nginx-1.21.6.tar
美化模块 ngx-fancyindex-0.5.2.tar
美化插件 Nginx-Fancyindex-Theme-master
2分别解压到/root/目录下
3编译nginx和ngx-fancyindex
cd /root/nginx
./configure --prefix=/usr/local/nginx --add-module=../ngx-fancyindex-0.5.2/ 编译nginx到/usr/local/nginx下并加载模块
make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/
mv /root/Nginx-Fancyindex-Theme-master/fancyindex.conf /usr/local/nginx/conf/
mv /root/Nginx-Fancyindex-Theme-master/light-Theme/ /usr/local/nginx/html/Nginx-Fancyindex-Theme/dark-Theme
vim /usr/local/nginx/conf/nginx.conf 编辑配置文件将美化插件加载到nginx
location / { root html; include fancyindex.conf; }
/usr/local/nginx/fancyindex.conf 插件配置目录
rm -rf /usr/local/nginx/html/index.html 删除html文件夹下文件
4启动nginx nginx
重启nginx nginx -s reload