Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


install_nqinx_webserver_linux_ubuntu_server_20_04_lts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
install_nqinx_webserver_linux_ubuntu_server_20_04_lts [2020/06/10 04:01] – [Return (above) to Start Nginx, Enable it to start at start-up, and check its status] wikiadmininstall_nqinx_webserver_linux_ubuntu_server_20_04_lts [2020/06/10 04:42] (current) – [Configure PhpMyAdmin within Nginx Server default sites-available virtual host file] wikiadmin
Line 121: Line 121:
 ===== Open the UFW firewall for Nginx port 80 and 443 ===== ===== Open the UFW firewall for Nginx port 80 and 443 =====
  
-You need to type the following ufw command to open TCP port number 80 and 443 for everyone:+If you have enabled the uncomplicated firewall (ufw) on Ubuntu, then you will need to type the following ufw command to open TCP port number 80 and 443 for everyone.  If the firewall is not enabled because you are behind a NAT router (or whatever reason), then skip these steps to open ports in the firewall.
  
 <code> <code>
Line 131: Line 131:
 Verify port status it: Verify port status it:
  
-sudo ufw status+<code>sudo ufw status</code>
  
 ===== Configure Nginx to Use the PHP Processor ===== ===== Configure Nginx to Use the PHP Processor =====
 +
 +===== Configure PhpMyAdmin within Nginx Server default sites-available virtual host file =====
 +
 +Now go to the '/etc/nginx' configuration directory, and edit the default virtual host file.
 +
 +<code>
 +cd /etc/nginx/sites-available/
 +
 +sudo cp default default-original 
 +
 +sudo vim default
 +</code>
 +
 +Paste the following Nginx configuration for PHPMyAdmin inside the 'server {...}' bracket.
 +
 +<code>
 +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.4-fpm.sock;
 +    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 +    include fastcgi_params;
 +    include snippets/fastcgi-php.conf;
 +    }
 +}
 +</code>
 +
 +Save and exit.
 +
 +Test the nginx configuration and make sure there is no error, then restart the nginx service.
 +
 +<code>
 +sudo nginx -t
 +
 +sudo systemctl reload nginx
 +</code>
 +
 +And we've added the Nginx configuration for our phpMyAdmin installation, it's accessible through the path URL as 'http://server-ip/phpmyadmin'.
  
  
  
  
install_nqinx_webserver_linux_ubuntu_server_20_04_lts.1591761717.txt.gz · Last modified: 2020/06/10 04:01 by wikiadmin