LoginSignup
0
0

More than 5 years have passed since last update.

ubuntu14.04にNginxをインストールし、pukiwikiを動かす

Last updated at Posted at 2016-07-18

LTSの関係で、Ubuntu14.04の人は、7/21 リリース予定のUbuntu16.04.1までお預けらしい。なので、今更14.04の記事。

いろんなサービスやらツールを使うにあたっての、アカウントや家庭内LANの情報なんかが氾濫して収集がつかなくなってきたので、家族のポータルをwikiで作り、そこでいろいろ情報をまとめることにした。ついでに未だに触ったことのないNginXでやってしまう。

hoge@locaohost:~$ apt-cache search nginx

すると、nginxというそのものなパッケージが見つかるので、

sudo apt-get install nginx

でさくっとインストール。

hoge@locaohost:/etc/nginx$ /etc/init.d/nginx start

して、ブラウザでインストールしたホストを開いてやれば、NginXのデフォルトページとこんにちは。

デフォルトの80ポートを変更してみる

sudo vim sites-enabled/default

変更前

 listen 80 default_server;
 listen [::]:80 default_server ipv6only=on;

変更後

 listen 89 default_server;
 listen [::]:89 default_server ipv6only=on;

hoge@locaohost:/etc/nginx$ sudo apt-get install php5-fpm

hoge@locaohost:/etc/nginx$ sudo vim /etc/nginx/sites-available/default
location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                # With php5-cgi alone:
                #fastcgi_pass 127.0.0.1:9000; ★コメントアウトのままに注意
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

ドキュメントルートが/usr/share/nginx/html
なので/usr/share/nginx/html配下にtest.phpあたりを作成して、

<?php phpinfo();

と、よくあるPHPの動作確認でPHPInfoを出力してやる。
ブラウザで、PHPInfoが出力されればOK。

あと一息。

pukiwikiの公式サイトからアーカイブをダウンロードし、展開し、
出てきたindex.phpが開ければ、目標達成です。

0
0
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
0
0