2016-08-20 48 views
0

從我的域名中,任何人都可以訪問phpmyadmin,唯一阻止它們的就是登錄。試圖使用.htaccess將/phpmyadmin重定向到404,但不會阻止它。從domain.com刪除對phpmyadmin的訪問

聽說有可能從phpmyadmin.conf做,但不知道要改變什麼。 任何想法?

Alias /phpmyadmin "c:/wamp/apps/phpMyAdmin-4.5.3.1/" 

# to give access to phpmyadmin from outside 
# replace the lines 
# 
# Require local 
# 
# by 
# 
# Require all granted 
# 

<Directory "c:/wamp/apps/phpMyAdmin-4.5.3.1/"> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride all 
    <IfDefine APACHE24> 
    Require all granted 
    </IfDefine> 
    <IfDefine !APACHE24> 
    Order Deny,Allow 
     Allow from all 
    </IfDefine> 
    php_admin_value upload_max_filesize 128M 
    php_admin_value post_max_size 128M 
    php_admin_value max_execution_time 360 
    php_admin_value max_input_time 360 
</Directory> 

回答

0

您可以限制只白名單的IP的訪問PHP myadmin這樣只有你就可以去phpMyAdmin的鏈接。檢查下面更新的htaccess規則。

Alias /phpmyadmin "c:/wamp/apps/phpMyAdmin-4.5.3.1/" 

# to give access to phpmyadmin from outside 
# replace the lines 
# 
# Require local 
# 
# by 
# 
# Require all granted 
# 

<Directory "c:/wamp/apps/phpMyAdmin-4.5.3.1/"> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride all 
    <IfDefine APACHE24> 
    Require all granted 
    </IfDefine> 
    <IfDefine !APACHE24> 
    Order Deny,Allow 
    deny from all 
    allow from <your ip> 
    </IfDefine> 
    php_admin_value upload_max_filesize 128M 
    php_admin_value post_max_size 128M 
    php_admin_value max_execution_time 360 
    php_admin_value max_input_time 360 
</Directory> 
+0

沒了,還可以從外部訪問它,是我沒有更改設置 –

+0

你在你的ip場 – error2007s

+0

添加你的真實IP地址,如果您使用的則正在執行這一行阿帕奇24後重新啓動WAMP: '要求所有授予'。將其更改爲'Require ip 1.1.1.1'(將1.1.1.1更改爲您的ip)。 – Vrac