Last active
September 15, 2017 05:41
-
-
Save freddiefujiwara/7ac8b3d58cc9cd1a4d39599805200cbc to your computer and use it in GitHub Desktop.
phpMyAdminをphp-fpmをやめてNGINX Unitで動かす ref: http://qiita.com/freddiefujiwara/items/9bd4d94cfe8f7e89de25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # service unitd start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # service unitd restoreconfig /etc/unit/phpmyadmin.json | |
| Restoring configuration from /etc/unit/phpmyadmin.json.. | |
| { | |
| "success": "Reconfiguration done." | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # service nginx restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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