LoginSignup
6
5

More than 5 years have passed since last update.

ubuntu16.04 LTS上に Nginx/pukiwiki をインストール

Last updated at Posted at 2016-08-14

目的

ubuntu16.04LTS上にnginx/pukiwiki環境を構築する

動作確認環境

VirtualBox上に構築した環境で以下のバージョンで動作確認
- ubuntu 16.04 LTS
- nginx 1.10.0
- php 7.0
- pukiwiki 1.5.1

インストール

sudo apt-get update
sudo apt-get install nginx php-fpm

Nginx設定

設定ファイル編集

基本的にコメントアウトで良い

/etc/nginx/sites-available/default
server {
...
    index index.php index.html index.htm index.nginx-debian.html;

    server_name <server_domain_or_IP>;
...
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
...
    location ~ /\.ht {
        deny all;
    }
}

上記設定の概説
- index: indexファイルへindex.phpを追加
- server_name: サーバー名にドメインorIPアドレスを指定
- localtion ~ .php$: phpファイルに対する挙動の設定
- include: fastcgi-php.confをここにincludeする
- fastcgi_pass: php-fpmのunixソケットファイルを指定
- location ~ /.ht: .htaccessへのアクセス設定拒否

設定テスト

sudo nginx -t

設定に間違いがあった場合は、エラーメッセージが表示される

再起動

PHP

sudo systemctl restart php7.0-fpm

Nginx

sudo systemctl reload nginx

PHP動作テスト

/var/www/html/info.php
<?php
phpinfo();
http://<server_domain_or_IP>/info.php

pukiwikiインストール

cd /var/www/html/
sudo wget http://jaist.dl.osdn.jp/pukiwiki/64807/pukiwiki-1.5.1_utf8.zip
sudo unzip pukiwiki-1.5.1_utf8.zip
sudo mv pukiwiki-1.5.1_utf8 pukiwiki
sudo rm pukiwiki-1.5.1_utf8.zip
sudo chown -R www-data:www-data ./*

pukiwiki設定

/var/www/html/pukiwiki/pukiwiki.ini.php
$page_title = 'PukiWiki';
...
$script = 'http://<server_domain_or_IP>/pukiwiki/';
...
$adminpass = '<password>';
  • $page_title: pukiwikiのページタイトル
  • $script: pukiwikiのURL
  • $adminpass: 編集用パスワード

TODO

  1. Docker化

参考リンク

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5