Installing phpMyAdmin on Linux Using PuTTY

phpMyAdmin is a popular web-based administration tool for managing MySQL or MariaDB databases. In this guide, we'll walk you through the process of installing phpMyAdmin on a Linux server using PuTTY. We'll cover installation steps, accessing phpMyAdmin, and considerations for different web servers (Nginx or Apache) as well as security best practices.

Prerequisites:

  • A Linux server with SSH access (using PuTTY).
  • MySQL or MariaDB installed and running on your server.

Step 1: Connect to Your Linux Server via PuTTY

Open PuTTY and enter the IP address or hostname of your Linux server. Click "Open" to establish the SSH connection.

Step 2: Update Package Lists

Before installing phpMyAdmin, it's recommended to update your system's package lists to ensure you're installing the latest versions of packages.

sudo apt update

Step 3: Install phpMyAdmin

Install phpMyAdmin using the following command:

sudo apt install phpmyadmin

During the installation process, you'll be prompted to select a web server. Choose the appropriate web server (Nginx or Apache) by using the arrow keys and pressing Enter.

Step 4: Configure phpMyAdmin

During the installation, you may be asked to configure phpMyAdmin. If not, you can manually reconfigure it using the following command:

sudo dpkg-reconfigure phpmyadmin

Follow the prompts to complete the configuration. You'll be asked to specify the web server you're using (Nginx or Apache) and provide the database administrator's password.

Step 5: Accessing phpMyAdmin

For Apache:

If you're using Apache, phpMyAdmin should be automatically configured to work with it. You can access phpMyAdmin by entering the following URL in your web browser:

http://your_server_ip/phpmyadmin

For Nginx:

If you're using Nginx, you'll need to create a symbolic link to phpMyAdmin's configuration file in the Nginx configuration directory:

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

Then, edit the Nginx virtual host configuration file to include phpMyAdmin:

 
sudo nano /etc/nginx/sites-available/default

Add the following location block inside the server block:

 
location /phpmyadmin { alias /usr/share/phpmyadmin/; index index.php index.html index.htm; }

Save the file and restart Nginx:

sudo systemctl restart nginx

Now, you can access phpMyAdmin by entering the following URL in your web browser:

http://your_server_ip/phpmyadmin

Step 6: Security Considerations

  • Change the Default URL: To enhance security, consider changing the default URL (/phpmyadmin) to something less predictable.
  • Use HTTPS: Encrypt the connection to phpMyAdmin by using HTTPS. Obtain an SSL certificate and configure your web server to use it.
  • Limit Access: Restrict access to phpMyAdmin by IP address or by using HTTP authentication.
  • Update Regularly: Keep phpMyAdmin and other server software up-to-date to address security vulnerabilities.

Conclusion

By following this guide, you've successfully installed phpMyAdmin on your Linux server using PuTTY. You've also learned how to access phpMyAdmin and considerations for different web servers (Nginx or Apache) as well as security best practices to ensure the safety of your database management interface.

  • phpmyadmin, install, php, databases, manage

Hai trovato utile questa risposta?

0 Utenti hanno trovato utile questa risposta