Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

目的

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化

参考リンク

ncore
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした