piwigo安装及初步使用

一 摘要

本文主要介绍piwigo 安装及初步使用,nginx \php\mysql 等使用 docker 安装

二 环境信息

2.1 操作系统

CentOS Linux release 7.9.2009 (Core)

2.2 piwigo

piwigo-13.6.0.zip

三 安装

3.1安装资源下载

piwigo 请到官网下载https://piwigo.org
安装步骤也是参考官网文档。

3.2 安装docker

参考 博文https://blog.csdn.net/nasooo/article/details/129753140

3.3 安装nginx\php\mysql

详见博文https://blog.csdn.net/nasooo/article/details/130129817

3.4 安装piwigo

3.4.1 数据库里建库以及建用户

一般不建议直接用root用户


create database piwigo_db  character set utf8 collate utf8_bin;
create user piwigo_db_user identified by '1qaz2wsx';
grant all privileges on piwigo_db.* to  piwigo_db_user@'%' identified by '1qaz2wsx' with grant option;
grant all privileges on piwigo_db.* to piwigo_db_user@localhost  identified by '1qaz2wsx' with grant option;
flush privileges;

3.4.2 解压文件

将软件解压放到nginx 目录下

我这里是目录 /data/yunweipro/commonapp/nginx/html

[root@2023001 html]# ll
total 20
-rw-r--r--  1 root root  107 Apr 13 17:51 hello.php
-rw-r--r--  1 root root  647 Apr 13 17:10 index.html
-rw-r--r--  1 root root   93 Apr 13 17:52 info.php
drwxr-xr-x 12 root root 4096 Apr 14 10:05 phpmyadmin
drwxr-xr-x 16 root root 4096 Feb 24 17:31 piwigo
[root@2023001 html]# pwd
/data/yunweipro/commonapp/nginx/html
[root@2023001 html]#

3.4.3 开始安装

浏览器访问 http://172.31.184.23/piwigo/install.php

mysql 主机地址 必须填容器名称
piwigo安装及初步使用_第1张图片
piwigo安装及初步使用_第2张图片
piwigo安装及初步使用_第3张图片

3.4.4 配置nginx 域名访问

关键修改地方:
location / {
root /usr/share/nginx/html/piwigo;
index index.html index.htm index.php;
}

location ~ \.php$ {
    fastcgi_pass   php:9000;
    fastcgi_index  index.php;
    **fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html/piwigo**/$fastcgi_script_name;
    include        fastcgi_params;
}
[root@2023001 conf.d]# cat digimicoo.conf
server {
    listen       80;
    listen  [::]:80;
    server_name  xxxx.xxxx.com;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html/piwigo;
        index  index.html index.htm index.php;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    #当请求网站下php文件的时候,反向代理到php-fpm
    location ~ \.php$ {
        fastcgi_pass   php:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html/piwigo/$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

你可能感兴趣的:(#,开源系统搭建及维护,php,开发语言)