Is it possible to move phpmyadmin to outside the root folder?

强颜欢笑 提交于 2020-01-05 10:23:50

问题


currently phpmyadmin is located at www.website.com/phpmyadmin on an apache server but I'm wondering if it is possible to have it located outside the html folder and in a different directory but having it possible to access it myself to make changes?


回答1:


yes, you can! Move it wherever you want. Then go to /etc/httpd/conf.d and create a new configuration file (maybe phpmyadmin.conf) and edit it. For instance, if you choose to move it to /usr/share/phpMyAdmin, the configuration file can be as follows:

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin


<Directory /usr/share/phpMyAdmin/>
    Options none
    AllowOverride Limit
    Require all granted
</Directory>

<Directory /usr/share/phpMyAdmin/>
    Options none
    AllowOverride Limit
    Require all granted
</Directory>

<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

Greetings



来源:https://stackoverflow.com/questions/28431926/is-it-possible-to-move-phpmyadmin-to-outside-the-root-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!