3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
限制 phpMyAdmin 存取 IP on Debian 6 [限定網站的存取IP] 資料來源:http://note.drx.tw/2012/08/phpmyadmin-limit-ip-debian-6.html 1. 環境設定     ◆作業系統:Debian 6 stable (squeeze)。     ◆phpMyAdmin 路徑:/usr/share/phpmyadmin。     ◆允許 IP:192.168.1.1。     ◆允許 IP 範圍:192.168.2.1 ~ 192.168.2.254。      2. 設定檔修改     ◆Apache         $ sudo vi /etc/phpmyadmin/apache.conf [Enter]         Alias /phpmyadmin/  “/usr/share/phpmyadmin/”         Alias /phpMyAdmin/  “/usr/share/phpmyadmin/”                          Options -Indexes FollowSymLinks                 AllowOverride All                 Order deny,allow                 Deny from all                 Allow from 192.168.1.1                 Allow from 192.168.2.0/24                 ErrorDocument 403 ok                 RewriteEngine On                  # Windows 上的 AppServ 預設路徑為 “C:/AppServ/www/phpMyAdmin”。               ◆Nginx         $ sudo vi /etc/nginx/nginx.conf [Enter]         server {          location /phpmyadmin {                 allow 192.168.1.1                 allow 192.168.2.0/24                 deny all;                 root /usr/share/;                 index index.php index.html index.htm;                 location ~ ^/phpmyadmin/(.+\.php)$ {                     try_files $uri =404;                     root /usr/share/;                     #fastcgi_pass 127.0.0.1:9000;                     fastcgi_pass unix:/var/run/php5-fpm.sock;                     fastcgi_index index.php;                     fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;                     include /etc/nginx/fastcgi_params;                 }                 location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {                     root /usr/share/;                 }             }             location /phpMyAdmin {                 rewrite ^/* /phpmyadmin last;             }         }              

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦