Reputation: 2569
I recently changed the url of my site from www.mydomain.com to mydomain.com (no subdomain) running off NGINX on Ubuntu. I had phpmyadmin working at www.mydomain.com/phpmyadmin (using this tutorial: https://www.digitalocean.com/community/articles/how-to-install-phpmyadmin-on-a-lemp-server/), but after changing the url I get a white page after signing in. Is there some phpmyadmin configuration file I need to change to reflect this url change?
Upvotes: 1
Views: 3480
Reputation: 1
There is another way to do it, with alias directive instead of root.
location /ddh73d1re1tp01hpn8sbceryzzzcp1 {
alias /usr/share/phpmyadmin;
index index.php index.html index.htm;
location ~ ^/ddh73d1re1tp01hpn8sbceryzzzcp1/(.+\.php)$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
Upvotes: 0
Reputation: 369
this will change your /phpmyadmin to /otherfilename and work for LEMP Server (nginx)
update your vhost with
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 service nginx restart
create a symbolic file with
sudo mv phpmyadmin otherfilename
ls -l
check your new symbolic file and change your virtual host in 5 point to
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 service nginx restart
Upvotes: 4
Reputation: 620
Please take a look at /etc/nginx/site-available/default
where you will need to add location /phpmyadmin
Upvotes: 1