Ubuntu 安裝phpMyAdmin + 配置nginx


0x01 安裝phpMyAdmin

```
sudo apt-get install phpmyadmin
```

0x02 添加鏈接

```
sudo ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
```
 

0x03 配置nginx

添加server節點,監聽端口8001
 
server {
charset utf-8;
client_max_body_size 128M;
 
listen 8001; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
 
server_name phpmyadmin;
root /usr/share/phpmyadmin ;
index index.php;
 
 
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
 
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
 
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
 
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php7.2-fpm.sock;
try_files $uri =404;
}
 
location ~* /\. {
deny all;
}

0x04 重啟nginx

```
sudo service nginx restart
```
 

0x05 測試

1.訪問http://127.0.0.1:8001

 

2.登陸
用戶名:root
密碼:abc123_

 


作  者: Jackson0714
出  處:http://www.cnblogs.com/jackson0714/
關於作者:專注於微軟平台的項目開發。如有問題或建議,請多多賜教!
版權聲明:本文版權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文鏈接。
特此聲明:所有評論和私信都會在第一時間回復。也歡迎園子的大大們指正錯誤,共同進步。或者直接私信
聲援博主:如果您覺得文章對您有幫助,可以點擊文章右下角推薦一下。您的鼓勵是作者堅持原創和持續寫作的最大動力!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM