Nginx 搭建可道云网盘

目录

1.安装php-fpm

2. 建站点根目录与配置

2.1 建站点根目录

2.2 配置

 3. 搭建成功


1.安装php-fpm

nginx 需要使用php 需要安装php-fpm 

yum install php-fpm php-mbstring php-mysqlnd php-gd -y

Nginx 搭建可道云网盘_第1张图片

修改 www.conf 文件的配置29行和41行,将用户会让用户组改成nginx,因为nginx服务进程是nginx

user = nginx

group = nginx

vim /etc/php-fpm.d/www.conf

 Nginx 搭建可道云网盘_第2张图片

 修改后,启动php-fpm

systemctl start php-fpm.service #启动
systemctl enable php-fpm.service # 开机自启

 查看php-fpm服务是否启动,有9000端口出现即为启动

netstat -lntup

2. 建站点根目录与配置

2.1 建站点根目录

我在 /web/目录下讲个文件保存站点代码

 到网上下载 可 道 云 网站资源,然后进行上传

Nginx 搭建可道云网盘_第3张图片

将下载好的压缩包上传

Nginx 搭建可道云网盘_第4张图片

解压

unzip kodexplorer4.51.zip

 查看解压后的文件与目录

 将权限设置成nginx

chown -R nginx:nginx . # -R指全部文件目录,  .为当前目录

Nginx 搭建可道云网盘_第5张图片

 修改hosts 文件,添加 ip 与域名的联系

192.168.XXX.XX.XXX   aaaa.com # aaaa.com 是我的网站域名

2.2 配置

建立nginx连接接php-fpm的配置

来到我的网站配置目录下 /etc/nginx/conf.d

编辑属于这个站点的配置文件 vim aaaa.com.conf ,添加下面这段配置

server {
        listen 80;
        server_name aaaa.com;
        location / {
                root /web/aaaa.com;
                index index.php index.html index.htm;
        }
        location ~ \.php$ {
                root /web/aaaa;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME /web/aaaa$fastcgi_script_name;
                include fastcgi_params;
        }
}

保存退出,然后检查语法是否有错

nginx -t

 重启nginx

systemctl restart nginx

 3. 搭建成功

这是第一次访问的界面效果

Nginx 搭建可道云网盘_第6张图片

点击-设置管理员密码->再次确认密码->登录,输入用户 admin ,密码,点击登录即可进入到网页应用界面

Nginx 搭建可道云网盘_第7张图片

Nginx 搭建可道云网盘_第8张图片

Nginx 搭建可道云网盘_第9张图片

 这样就可以当做自己的网盘使用了

你可能感兴趣的:(Ngnix,nginx)