2

I'm getting a 404 error after install phpMyAdmin using Digital Ocean's guide. I have multiple domains setup on Ubuntu running nginx. There is a phpmyadmin directory within /var/www/. The only difference from the guide was the following command:

sudo ln -s /usr/share/phpmyadmin/ /var/www

Do I need to add server block possibly? Since I have multiple domains, each of them has a separate configuration file.

Sample config file:

server { listen 80 default_server; listen [::]:80 default_server; root /var/www/domain1.com/html; index index.php index.html index.htm index.nginx-debian.html; server_name MY_IP_ADDRESS; location / { try_files $uri $uri/ =404; } location /phpmyadmin { root /var/www/; index index.php index.html; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; try_files $uri /index.php; } location ~ /\.ht { deny all; } } 

I'm not great at server administration. Any suggestions?

1 Answer 1

1

Define this server block it worked for me. A basic configuration for phpmyadmin in you case.As you have created a symbolic link in /var/www.

sudo ln -s /usr/share/phpmyadmin/ /var/www

server { listen 80; server_name website.in www.website.in; autoindex on; location /phpmyadmin { root /var/www/; index index.php index.html; location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; try_files $uri $uri/ /index.php; } } location / { root /var/www/your/path; index index.php index.html; location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; try_files $uri $uri/ /index.php; } } } 
Sign up to request clarification or add additional context in comments.

27 Comments

I have two configuration files for two different domains. So, which configuration file would this live on? Would I need to create a default?
you can put it in any config file. Just make sure to put both the blocks if 2nd block is not defined for PHP. And let me know if any issue occurs.
I'm getting a 500 server error after setting both the config files.
can you share your dummy configuration?
You have to create separate config in /etc/nginx/conf.d. And make sure in /etc/nginx/nginx.conf this line is include /etc/nginx/conf.d/*.conf; is uncommented.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.