Chevereto是一个托管PHP应用程序的图像,允许您在您自己的服务器上获取自己的美丽和全功能的图像托管网站。有几种方法可以安装它。在这篇文章中,我将向您展示使用Docker安装Chevereto的步骤。

在Ubuntu或CentOS中安装Docker

对于CentOS:

sudo -i
yum -y update
curl -sSL //get.docker.com/ | sh
systemctl start docker.service
systemctl enable docker.service

For Ubuntu

sudo apt update
sudo apt upgrade
sudo apt install docker.io -y
sudo -i
systemctl start docker
systemctl enable docker
docker version

Not necessary, here are the commands to install Docker Compose:

  1. 运行此命令下载Docker Compose的当前稳定版本:

    sudo curl -L "//github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

    To install a different version of Compose, substitute 1.27.4 with the version of Compose you want to use.

  2. 将可执行权限应用于二进制文件:

    sudo chmod +x /usr/local/bin/docker-compose
    

笔记 : If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.

例如:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. (可选)安装 命令完成 for the bash and zsh shell.

  2. 测试安装。

    $ docker-compose --version
    docker-compose version 1.27.4, build 1110ad01

Chevereto Docker.

Docker. Image from : //ift.tt/3oZYyh3

Docker. 撰写

vi docker-compose.yaml
version: '3'

services:
  db:
    image: mariadb
    volumes:
      - database:/var/lib/mysql:rw
    restart: always
    networks:
      - private
    environment:
      mysql_root_password:chevereto_root.
      mysql_database:chevereto.
      mysql_user:chevereto.
      mysql_password:chevereto.

  chevereto:
    depends_on:
      - db
    图片:nmtan / chevereto
    restart: always
    networks:
      - private
    environment:
      chevereto_db_host:db.
      chevereto_db_username:chevereto.
      chevereto_db_password:chevereto.
      chevereto_db_name:chevereto.
      chevereto_db_prefix:chv_
    volumes:
      - chevereto_images:/var/www/html/images:rw
    ports:
      - 8080:80

networks:
  private:
volumes:
  database:
  chevereto_images:

Once docker-compose.yaml is ready, you can run

docker-compose up -d

Docker. PS.

Docker. 检查<container id>

打开浏览器到URL:http://<public ip>:8080

1.获得php.ini位置

$ php -ini

 

2.更改PHP设置

如果/ usr / local / etc / php没有php.ini文件,只需创建一个。 

有  

upload_max_filesize = 5M

 

3.重新启动Apache服务器

重新启动Apache服务器以应用更改

$ service apache2 restart

安装portainer. 

docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
docker ps
Use your browser to access URL http://<public ip of your linuxserver>:9000
First time, it will ask you to set up admin user's password.

创建nginx容器


Docker. 图片:Johnyan2 / Nginx1netsec

nginx正在使用桥接网络。重新启动策略也设置为始终设置。 

[email protected]:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[email protected]:/# cd etc
[email protected]:/etc# cd nginx
[email protected]:/etc/nginx# cd conf.d
[email protected]:/etc/nginx/conf.d# ls
default.conf  portainer.conf  webssh.conf  wordpress.conf
[email protected]:/etc/nginx/conf.d# nano chevereto.conf 
server {
    listen       80;
    server_name  chevereto.51sec.org;
location / {
    proxy_pass       http://132.145.9.4:8080;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
[email protected]:/etc/nginx/conf.d# 

[email protected]:/etc/nginx/conf.d# cat portainer.conf 
server {
    listen       80;
    server_name  gcp1portainer.51sec.org;

location / {
    proxy_pass       http://132.145.9.41:9000;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

服务nginx重启

其他脚本

Here is another Docker configuration file from : //ift.tt/2WngmX8

转到Portainer并将其复制到一个新堆栈:

版本:'2'
服务:
db:
image: mariadb
volumes:
- / database:/ var / lib / mysql:rw#我没有祝好运气把这个数据库放在不同的目录中
重启:除非停止
networks:
– private
environment:
mysql_root_password:chevereto_root.
mysql_database:chevereto.
mysql_user:chevereto.
mysql_password:chevereto.
chevereto:
depends_on:
– db
图片:nmtan / chevereto
重启:除非停止
networks:
– private
environment:
chevereto_db_host:db.
chevereto_db_username:chevereto.
chevereto_db_password:chevereto.
chevereto_db_name:chevereto.
chevereto_db_prefix:chv_
volumes:
- / srv / dev-disk-by-label-ssd / conf / chevereto / chevereto_images:/ var / www / html /图像:RW
- /srv/dev-disk-by-label-sd/conf/php.ini:/usr/local/etc/php/php.ini::.
ports:
– 8686:80
网络:
private:
卷:
database:
chevereto_images:

额外的Chevereto修改

如果您没有可用于使用,则需要由您创建php.ini文件。默认情况下,您将无法上传图像超过2MB,这将解决此问题。

以下是此设置的php.ini文件的内容:

upload_max_filesize = 20m.
post_max_size = 20m.
memory_limit = 512m.
max_execution_time = 180.

您还需要确保将正确的权限设置为Chevereto_Images文件夹。要执行此操作,并使用以前的设置为例,您将使用以下命令:

sudo chmod -r a + rwx / srv / dev-disk-by-label-ssd / conf / chevereto / chevereto_images

参考

  • //ift.tt/38ftL94

来自Blogger. http://blog.fabiandinkins.com/2020/12/install-chevereto-open-source-image.html

经过 Jon.

发表评论