Skip to content

Instantly share code, notes, and snippets.

@freddiefujiwara
Last active September 15, 2017 05:41
Show Gist options
  • Select an option

  • Save freddiefujiwara/7ac8b3d58cc9cd1a4d39599805200cbc to your computer and use it in GitHub Desktop.

Select an option

Save freddiefujiwara/7ac8b3d58cc9cd1a4d39599805200cbc to your computer and use it in GitHub Desktop.
phpMyAdminをphp-fpmをやめてNGINX Unitで動かす  ref: http://qiita.com/freddiefujiwara/items/9bd4d94cfe8f7e89de25
$ 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
# service unitd start
# service unitd restoreconfig /etc/unit/phpmyadmin.json
Restoring configuration from /etc/unit/phpmyadmin.json..
{
"success": "Reconfiguration done."
}
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/;
}
}
# service nginx restart
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/;
}
}
{
"listeners": {
"*:8300": {
"application": "phpmyadmin"
}
},
"applications": {
"phpmyadmin": {
"type": "php",
"workers": 20,
"root": "/usr/share/phpmyadmin",
"index": "index.php"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment