• TechOps

    Need clarity?
    Chat with our experts now

    • Web Hosting SupportWeb Hosting Support
    • Helpdesk Support

      Skilled and professional 24/7 helpdesk support

    • Product Support

      Boost your product support with our expertise

    • Managed ServicesManaged Services
    • Server Management

      Don't let server issues slow you down. Let us manage them for you

    • Server Monitoring

      Safeguard your server health with our comprehensive monitoring solutions

    • Staff AugmentationStaff Augmentation
    • Hire an Admin

      Transform your business operations with our expert administrative support

    • Hire a Team

      Augment your workforce with highly skilled professional from our diverse talent pool

  • CloudOps

    Confused?
    Discuss with our sales team now.

    • Author ProfileAWS
      Well Architected Review
    • Author ProfileFinOps As a Service

      FinOps As a Service

    • Migrate

      Upgrade the journey: Migrate & Modernize seamlessly

    • Modernize

      Effortless CloudOps mastery for seamless cloud management

    • Optimize

      Efficient CloudOps: Boosting performance through optimization

    • Manage

      Simplify compliance complexities with our dedicated service

  • DevOps

    How Supportsages
    is creating an
    impact?

    View Casestudies
    • Author Profile24/7 DevOps As a Service

      Round-the-clock DevOps for uninterrupted efficiency

    • Author ProfileCI/CD Pipeline

      Automated CI/CD pipeline for seamless deployments

    • Author ProfileInfrastructure As a Code

      Crafting infrastructure with ingenious code

    • Author ProfileDevSecOps

      Integrated security in continuous DevOps practices

    • Author ProfileHire DevOps Engineers

      Level up your team with DevOps visionaries

    • Author ProfileConsulting Services

      Navigate success with expert DevOps consulting

  • SecOps

    Expert SecOps Services
    for any Scale

    • Author ProfileVAPT

      Vulnerability Assessment and Penetration Testing

    • Author ProfileSource Code Review

      Ensuring source code security and safe practices to reduce risks

    • Author ProfileSecurity Consultation

      On demand services for improving server security

    • Author ProfileSystem Hardening

      Reduced vulnerability and proactive protection

    • Author ProfileManaged SOC

      Monitors and maintains system security. Quick response on incidents

    • Author ProfileCompliance as a Service

      Regulatory compliance, reduced risk

  • Insights

    Explore our latest
    insights and resources

    Blog

    Explore our latest articles and insights

    Case Studies

    Read about our client success stories

  • Contact Us

  • About
  • Certifications
  • Life at Supportsages
  • Events
  • Contact
  • Careers
  • Blog

  • Dedicated Support Team
  • Quasi-dedicated Support Team
  • Hire a DevOps Engineer
  • Hire a Billing Support Staff
  • Per-ticket Support Plan
  • Managed Services

  • Microsoft Azure Expert
  • AWS Cloud Expert
  • Hire a developer
SS

SupportSages

Bites of wisdom @ work


Copyright © 2008 - 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
Building up a WordPress website with AWS – PART 3

Building up a WordPress website with AWS – PART 3

Albert Reilly
  • 7 min read
Building up a WordPress website with AWS – PART 3

Generating audio, please wait...

INSTALLING AND SECURING PHPMYADMIN

A website may require database connection and management. Here we will install phpMyAdmin, a common database management tool. Then we will follow some steps to secure it and using this tool, create a database and a user.

To setup the server, you will need to follow the Part One of this series.

Install phpMyAdmin using the below command and restart Apache.

# yum install phpMyAdmin -y

# systemctl restart httpd.service

You can access the interface from the browser. But you will be getting a 403 permission error. In that case, open the configuration file /etc/httpd/conf.d/phpMyAdmin.conf and edit some lines. If you want to access phpMyAdmin from anywhere, add Require all granted between the lines as below or you can add Require ip xxx.xxx.xxx.xxx for a specific IP.

<IfModule mod_authz_core.c>

# Apache 2.4

<RequireAny>

Require ip 127.0.0.1

Require ip xxx.xxx.xxx.xxx

Require ip ::1

Require all granted

</RequireAny>

</IfModule>


AWS

We can secure the installation by following some methods. We can change the URL with which the interface is accessed. Open the configuration file and make change as below. Feel free to change MyAdmin to anything you like. Make sure you restart Apache after you make change to the configuration file.

 # vi /etc/httpd/conf.d/phpMyAdmin.conf

#Alias /phpMyAdmin /usr/share/phpMyAdmin

#Alias /phpmyadmin /usr/share/phpMyAdmin

Alias /MyAdmin /usr/share/phpMyAdmin

# systemctl restart httpd.service

Now you will need to call http://xxx.xxx.xxx.xxx/MyAdmin instead of http://xxx.xxx.xxx.xxx/phpMyAdmin to get the interface.

We will setup an authentication prompt that a user would be required to pass before going to the phpMyAdmin login screen. For that, we will need to override the admin configurations by adding the line AllowOverride All as below allowing us to specify additional configuration details in a file .htaccess located in phpMyAdmin directory. We will use this file to set up our password authentication. 

# vi /etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>

AddDefaultCharset UTF-8

AllowOverride All

<IfModule mod_authz_core.c>

.....

Now, add the below contents to the file.

# vi /usr/share/phpMyAdmin/.htaccess

AuthType Basic

AuthName "Admin Login"

AuthUserFile /etc/httpd/auth_pass

Require valid-user

AuthType Basic specifies the authentication type that we are implementing. This type will implement password authentication using a password file. AuthName sets the message for the authentication dialog box. AuthUserFile sets the location of the actual password file that will be used for authentication. This should be outside of the directories that are being served. Require valid-user specifies that only authenticated users should be given access to this resource.

Now we will move on to create the Password File for Authentication. We can create multiple users by removing the -c option. We use this option to create the file as it doesn’t exists.

# htpasswd -c /etc/httpd/auth_pass myuser

New password: 

Re-type new password: 

Adding password for user myuser

Finally, restart Apache service and access the phpMyAdmin page. You will be asked for the username and password we have just created.

# systemctl restart httpd.service
AWS

 Now we will create a database user for our website and then will disallow root login. Login as root and click on users tab.

AWS

Add the username, password, host as localhost and select the required privileges. Finally click go in the bottom and a new user is created.

AWS

Now we will disable root login to phpMyAdmin by editing the phpMyAdmin configuration.

Change the line below line in /etc/phpMyAdmin/config.inc.php.

$cfg['Servers'][$i]['AllowRoot'] = TRUE; // whether to allow root login

$cfg['Servers'][$i]['AllowRoot'] = FALSE; // whether to allow root login

Restart Apache service and try to login as root and you will get Access denied message.

# systemctl restart httpd.service

We have now installed and secured phpMyAdmin interface and access and will now move on to create a website in the Part Four of the series.

Get 24/7 technical helpdesk support
  • Apache
  • VPS

Looking for AWS Experts?

We provide top-of-the-line custom AWS setup services tailored to your needs.

Building up a WordPress website with AWS – PART 1

Building up a WordPress website with  AWS – PART 1
  • Apache
  • VPS
logo

Building up a WordPress website with AWS – PART 2

Building up a WordPress website with AWS – PART 2
  • Apache
  • VPS
logo

Building up a WordPress website with AWS – PART 4

Building up a WordPress website with AWS – PART 4
  • WordPress
logo

Building up a WordPress website with AWS – PART 5

Building up a WordPress website with AWS – PART 5
  • Linux
  • WordPress
logo
Posts by Albert Reilly

Albert likes to explore and learn new things. He is hardworking, enthusiastic and is getting expertise in Linux administration, Networking and Security areas. He understands client requirements and is able to act accordingly. He has been working for 2 years with us.