<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DokuWiki | YdlProg</title>
	<atom:link href="https://ydlprog.ddns.net/category/almalinux/dokuwiki/feed/" rel="self" type="application/rss+xml" />
	<link>https://ydlprog.ddns.net</link>
	<description>プログラマーが日々得た知識のメモ</description>
	<lastBuildDate>Sun, 29 Sep 2024 04:15:42 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>PodmanでDokuWikiの起動</title>
		<link>https://ydlprog.ddns.net/2023/02/05/podman%e3%81%a7dokuwiki%e3%81%ae%e8%b5%b7%e5%8b%95/</link>
					<comments>https://ydlprog.ddns.net/2023/02/05/podman%e3%81%a7dokuwiki%e3%81%ae%e8%b5%b7%e5%8b%95/#respond</comments>
		
		<dc:creator><![CDATA[ydlprog]]></dc:creator>
		<pubDate>Sun, 05 Feb 2023 01:31:24 +0000</pubDate>
				<category><![CDATA[AlmaLinux]]></category>
		<category><![CDATA[DokuWiki]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP-FPM]]></category>
		<category><![CDATA[Podman]]></category>
		<guid isPermaLink="false">https://ydlprog.ddns.net/?p=244</guid>

					<description><![CDATA[ルートフォルダだったので、パスを /srv から /home に変更(2024/09/29) 目次 はじめにネットワークの作成DokuWiki用のポッド作成ボリュームの作成ダミーコンテナを作成し設定ファイル取り出しポッド [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>ルートフォルダだったので、パスを /srv から /home に変更(2024/09/29)</p>




  <div id="toc" class="toc tnt-number tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2"><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">はじめに</a></li><li><a href="#toc2" tabindex="0">ネットワークの作成</a></li><li><a href="#toc3" tabindex="0">DokuWiki用のポッド作成</a><ol><li><a href="#toc4" tabindex="0">ボリュームの作成</a></li><li><a href="#toc5" tabindex="0">ダミーコンテナを作成し設定ファイル取り出し</a></li><li><a href="#toc6" tabindex="0">ポッド作成</a></li></ol></li><li><a href="#toc7" tabindex="0">nginx設定</a></li><li><a href="#toc8" tabindex="0">dokuwikiのインストール</a></li><li><a href="#toc9" tabindex="0">dokuwikiの起動</a></li><li><a href="#toc10" tabindex="0">自動起動設定</a><ol><li><a href="#toc11" tabindex="0">自動起動用にユニットファイル作成</a></li><li><a href="#toc12" tabindex="0">自動起動</a></li></ol></li><li><a href="#toc13" tabindex="0">コンテナ作成用スクリプト</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">はじめに</span></h2>



<p>自宅サーバー用にリバースプロキシ呼び出しなので、ローカル用途では不要な設定が含まれています。</p>



<h2 class="wp-block-heading"><span id="toc2">ネットワークの作成</span></h2>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>podman network create --subnet 10.0.30.0/24 --gateway 10.0.30.1 network-dokuwiki</code></pre></div>



<h2 class="wp-block-heading"><span id="toc3">DokuWiki用のポッド作成</span></h2>



<h3 class="wp-block-heading"><span id="toc4">ボリュームの作成</span></h3>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>mkdir -p \
  /home/podman/dokuwiki-pod/nginx/conf.d \
  /home/podman/dokuwiki-pod/public \
  /home/podman/dokuwiki-pod/php/conf.d</code></pre></div>



<h3 class="wp-block-heading"><span id="toc5">ダミーコンテナを作成し設定ファイル取り出し</span></h3>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>podman run -d --name tmp docker.io/library/nginx:latest
podman cp tmp:/etc/nginx/nginx.conf /home/podman/dokuwiki-pod/nginx/nginx.conf
podman cp tmp:/etc/nginx/conf.d/default.conf /home/podman/dokuwiki-pod/nginx/conf.d/default.conf
podman rm -f tmp

podman run -d --name tmp php:fpm-alpine
podman cp tmp:/usr/local/etc/php/php.ini-production /home/podman/dokuwiki-pod/php/php.ini
podman rm -f tmp</code></pre></div>



<h3 class="wp-block-heading"><span id="toc6">ポッド作成</span></h3>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>podman pod create --name dokuwiki-pod -p 30080:80 -p 30443:443 --network=network-dokuwiki
podman create --pod dokuwiki-pod --name dokuwiki-nginx \
  -v /home/podman/dokuwiki-pod/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
  -v /home/podman/dokuwiki-pod/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro \
  -v /home/podman/dokuwiki-pod/public:/usr/share/nginx/html \
  docker.io/library/nginx:latest

podman create --pod dokuwiki-pod --name dokuwiki-phpfpm \
  -v /home/podman/dokuwiki-pod/php/php.ini:/usr/local/etc/php/php.ini:ro \
  -v /home/podman/dokuwiki-pod/public:/usr/share/nginx/html \
  php:fpm-alpine</code></pre></div>



<h2 class="wp-block-heading"><span id="toc7">nginx設定</span></h2>



<div class="hcb_wrap"><pre class="prism line-numbers lang-nginx" data-file="/srv/podman/dokuwiki-pod/nginx/conf.d/default.conf " data-lang="nginx" data-line="10,30-36"><code>server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

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

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

    #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           /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache&#39;s document root
    # concurs with nginx&#39;s one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}</code></pre></div>



<h2 class="wp-block-heading"><span id="toc8">dokuwikiのインストール</span></h2>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>cd /home/podman/dokuwiki-pod/public/
wget https://download.dokuwiki.org/out/dokuwiki-a6b3119b5d16cfdee29a855275c5759f.tgz
tar xvfz dokuwiki-a6b3119b5d16cfdee29a855275c5759f.tgz 
rm -f dokuwiki-a6b3119b5d16cfdee29a855275c5759f.tgz 

cd dokuwiki/
chmod -R 777 data
chmod 777 lib/plugins/
chmod 777 lib/tpl/
chmod 777 conf
chmod 666 conf/*</code></pre></div>



<p>リバースプロキシ用のフォルダ名に変更</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>cd /home/podman/dokuwiki-pod/public/
mv dokuwiki ydlprog</code></pre></div>



<h2 class="wp-block-heading"><span id="toc9">dokuwikiの起動</span></h2>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>podman pod start dokuwiki-pod</code></pre></div>



<h2 class="wp-block-heading"><span id="toc10">自動起動設定</span></h2>



<h3 class="wp-block-heading"><span id="toc11">自動起動用にユニットファイル作成</span></h3>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code># cd /usr/lib/systemd/system
# podman generate systemd --name dokuwiki-pod --files --restart-policy=always
/usr/lib/systemd/system/pod-dokuwiki-pod.service
/usr/lib/systemd/system/container-dokuwiki-phpfpm.service
/usr/lib/systemd/system/container-dokuwiki-nginx.service</code></pre></div>



<h3 class="wp-block-heading"><span id="toc12">自動起動</span></h3>



<div class="hcb_wrap"><pre class="prism off-numbers lang-plain"><code>systemctl daemon-reload
systemctl enable pod-dokuwiki-pod.service
systemctl enable container-dokuwiki-phpfpm.service
systemctl enable container-dokuwiki-nginx.service</code></pre></div>



<h2 class="wp-block-heading"><span id="toc13">コンテナ作成用スクリプト</span></h2>
]]></content:encoded>
					
					<wfw:commentRss>https://ydlprog.ddns.net/2023/02/05/podman%e3%81%a7dokuwiki%e3%81%ae%e8%b5%b7%e5%8b%95/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
