====== 2021.12.30 Docker Dokuwiki bitnami ====== Dokuwikiは、Nginx版の[[50_dialy:2021:04:29]]でも書いてます。 こちら[[https://hub.docker.com/r/bitnami/dokuwiki|bitnamiのdokuwiki]]はApache2で動きます。 [[06_virtualization:05_container:02_dcoker_composer|docker-compose install]] ===== Dokuwikiだけ ===== これだけで、dokuwiki起動できます。 user: hoge, password: hogehogepassword でログインできます。 ==== docker-compose.yml ==== --- version: '3' services: dokuwiki: image: docker.io/bitnami/dokuwiki:latest user: root ports: - '80:8080' - '443:8443' volumes: ### Timezonを合わすため - ./timezone.ini:/opt/bitnami/php/etc/conf.d/timezone.ini - ./data:/bitnami environment: - TZ=Asia/Tokyo - DOKUWIKI_USERNAME=hoge - DOKUWIKI_PASSWORD=hogehogepassword ### Apacheのポートを指定する場合 - APACHE_HTTP_PORT_NUMBER=8080 - APACHE_HTTPS_PORT_NUMBER=8443 volumes: dokuwiki_data: driver: local [Date] date.timezone = "Asia/Tokyo" ==== 起動 ==== docker-compose up -d ===== SSL付きDokuwiki ===== これで、https://testwiki.hogehoge.com でアクセスでるようになります。 --- version: '2' services: https-portal: image: steveltn/https-portal:1 ports: - '80:80' - '443:443' links: - dokuwiki #restart: always restart: unless-stopped environment: DOMAINS: 'testwiki.hogehoge.com -> http://dokuwiki:8080' STAGE: 'local' #STAGE: 'production' #FORCE_RENEW: 'true' dokuwiki: image: docker.io/bitnami/dokuwiki:latest user: root #ports: # - '80:8080' # - '443:8443' volumes: - ./data:/bitnami environment: - DOKUWIKI_USERNAME=hoge - DOKUWIKI_PASSWORD=hogehogepassword volumes: dokuwiki_data: driver: local ===== Apache実行ユーザはdaemon ===== defaultではdaemonユーザになってます。 Apacheの実行ユーザをviで編集してrootに変更するとApache起動できなくなります。 dokuwiki 22:19:00.44 INFO ==> ** Starting Apache ** AH00526: Syntax error on line 172 of /opt/bitnami/apache/conf/httpd.conf: Error:\tApache has not been designed to serve pages while\n\trunning as root. There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n ===== 既存環境からのコピー ===== 下記と同じように行う。 [[50_dialy:2021:04:29#既存環境からのコピー]] === ただ権限だけ変更 === chown -R bin:root data/dokuwiki === savedirも変更 === Dokuwiki bitnamiのPATHは、「/opt/bitnami/dokuwiki」 # cat data/dokuwiki/conf/local.php | grep savedir $conf['savedir'] = '/opt/bitnami/dokuwiki/data'; {{tag>Docker Dokuwiki}}