Home  >  Article  >  Backend Development  >  经过Alias来修改phpMyAdmin的默认访问路径

经过Alias来修改phpMyAdmin的默认访问路径

WBOY
WBOYOriginal
2016-06-13 10:31:361204browse

通过Alias来修改phpMyAdmin的默认访问路径

?

phpMyAdmin的配置文件phpMyAdmin.conf文件位于/etc/httpd/conf.d/目录下,所有位于/etc/httpd/conf.d/目录中的配置文件都是httpd的子配置文件,任何一个子配置文件的语法错误都可能导致httpd启动失败。

?

[[email protected]]#?httpd?-t????//该命令可用于检查与httpd相关的配置文件的语法是否正确

?

phpMyAdminweb访问方式:

phpMyAdmin.conf中的Alias行决定了phpMyAdminweb访问路径:

[[email protected]]#?cat?/etc/httpd/conf.d/phpMyAdmin.conf

#?phpMyAdmin?-?Web?based?MySQL?browser?written?in?php

#

#?Allows?only?localhost?by?default

#

#?But?allowing?phpMyAdmin?to?anyone?other?than?localhost?should?be?considered

#?dangerous?unless?properly?secured?by?SSL

?

#Alias?/phpMyAdmin?/usr/share/phpMyAdmin

#Alias?/phpmyadmin?/usr/share/phpMyAdmin

Alias?/nima/shangbuqi??/usr/share/phpMyAdmin

?

???Order?Deny,Allow

???Deny??from?All

???Allow?from?127.0.0.1

???Allow?from?192.168.18.0/24

???Allow?from?192.168.1.0/24

???Allow?from?::1

?

Alias?/nima/shangbuqi??/usr/share/phpMyAdmin表明phpMyAdminweb访问路径为:

www.mydomain.com/nima/shangbuqi

?

下面的DenyAllow表示允许那些主机访问phpMyAdminOrder的顺序是"Deny,Allow",表示禁止所有IP访问,除了接下来Allow?from中定义的主机外。

?

注:/nima/shangbuqi是个虚拟路径,在服务器上没有该目录,httpd.conf中定义的web服务器根目录下更不会有该目录。

?

?

如果在phpMyAdmin的登陆页面中示:"Cannot?load?mcrypt?extension.?Please?check?your?PHP?configuration.",则表明服务器没有安装php-mcrypt包。

?

完了以后重启 service httpd restart

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn