我最近将我网站的网址从www.mydomain.com更改为在Ubuntu上运行NGINX的mydomain.com(没有子域名)。我让phpmyadmin在www.mydomain.com/phpmyadmin工作(使用本教程:https://www.digitalocean.com/community/articles/how-to-install-phpmyadmin-on-a-lemp-server/),但在更改网址后,我在登录后获得了一个白页。是否有一些phpmyadmin配置文件我需要更改以反映这个网址有变化吗?
答案 0 :(得分:1)
请查看/etc/nginx/site-available/default
您需要添加位置/ phpmyadmin
答案 1 :(得分:1)
这会将您的/ phpmyadmin更改为/ otherfilename并适用于LEMP Server(nginx)
使用以下方式更新您的虚拟主机
location /phpmyadmin {
root /usr/share/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(doc|sql|setup)/ {
deny all;
}
location ~ /phpmyadmin/(.+\.php)$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
}
}
sudo服务nginx重新启动
使用以下符号创建符号文件
sudo mv phpmyadmin otherfilename
ls -l </ p>
检查新的符号文件,并将虚拟主机更改为5点,将其更改为
location /otherfilename{
root /var/www/html/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/otherfilename/(doc|sql|setup)/ {
deny all;
}
location ~ /otherfilename/(.+\.php)$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
}
}
sudo服务nginx重新启动