LoginSignup
0
0

More than 5 years have passed since last update.

phpMyAdminをphp-fpmをやめてNGINX Unitで動かす 

Last updated at Posted at 2017-09-09

Install

https://github.com/nginx/unit#ubuntu-packages をみながら

$ wget http://nginx.org/keys/nginx_signing.key
$ sudo apt-key add nginx_signing.key
$ sudo su
# echo 'deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx' >> /etc/apt/sources.list.d/nginx.list 
# echo 'deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx' >> /etc/apt/sources.list.d/nginx.list 
# apt-get update
# apt-get install unit

Run

 # service unitd start

Configuration

/etc/unit/phpmyadmin.json
{
     "listeners": {
         "*:8300": {
             "application": "phpmyadmin"
         }
     },
     "applications": {
         "phpmyadmin": {
             "type": "php",
              "workers": 20,
              "root": "/usr/share/phpmyadmin",
              "index": "index.php"
         }
     }
}

起動時にjsonを読み込ませるわけではなく
APIを通して設定を動的に変更するようだ

Install the configuration

# service unitd restoreconfig /etc/unit/phpmyadmin.json
Restoring configuration from /etc/unit/phpmyadmin.json..
{
        "success": "Reconfiguration done."
}

Reconfigure nginx

/etc/nginx/sites-available/phpmyadmin.conf
server {
        server_name phpmyadmin.example.com;

        root        /usr/share/phpmyadmin;
        index       index.html index.php;
        access_log  /var/log/nginx/phpmyadmin.example.com.access_log;
        error_log   /var/log/nginx/phpmyadmin.example.com.error_log;
        #fpmの設定をコメントアウト
        #location ~ \.php {
        #        fastcgi_pass    unix:/var/run/php5-fpm.phpmyadmin.example.com.sock;
        #        fastcgi_index   index.php;
        #        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #        include fastcgi_params;
        #}
     #あらたにunitdのための設定を追加
        location / {
            proxy_pass http://127.0.0.1:8300/;
        }
}

Restart nginx

# service nginx restart

Check

ブラウザで  phpmyadmin.example.comにアクセス

phpmyadmin-result.png

うごいた。。けど権限周りのエラーがでるようだ
あとで調べよ

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