We’re here to help and answer any question you might have. We look forward to hearing from you.
Setting up a Linux account is a fundamental step for users who want to harness the power of Linux-based operating systems. By creating a Linux account, you gain access to a world of open-source software, robust security features, and the ability to customize your computing environment


WordPress setup on AWS - Linux

What will you do
- Installing Apache , PHP , Mysql Server for WordPress
- Installing latest WordPress on Linux Server
- Configure MySQL database for WordPress
- Configure WordPress Security Key
- Creating Apache Virtual Host for WordPress
Requirements
- AWS Account: You need an active AWS account.
- EC2 Instance: Launch an EC2 instance with AWS Linux.
- Security Group: Configure inbound traffic rules for ports 22, 80, and 443.
- Apache Web Server: Install and configure Apache on the EC2 instance.
- MySQL Database: Set up and configure MySQL for storing WordPress data.
Step 1: Launch an Amazon EC2 instance with the AWS Linux AMI.
Step 2: Connect to the instance using SSH.
Step 3: Update the instance and install necessary packages by running the following commands:
Command 1 | sudo yum update -y |
Command 2 | sudo yum install -y httpd24 php74 mysql57-server php74-mysqlnd |
Step 4: Start the Apache web server by running the following commands:
Command 1 | sudo service httpd start |
Step 5: Enable the Apache web server to start automatically on system boot by running the following command:
Command 1 | sudo chkconfig httpd on |
Step 6: Start the MySQL server by running the following command:
Command 1 | sudo service mysqld start |
Step 7: Secure the MySQL installation by running the following command:
Command 1 | sudo mysql_secure_installation |
Step 8: Install WordPress by downloading the latest version from the official website and extracting the files to the web root directory:
Command 1 | cd /var/www/html |
Command 2 | sudo wget https://wordpress.org/latest.tar.gz |
Command 3 | sudo tar -xzf latest.tar.gz |
Command 4 | sudo mv wordpress/* . |
Command 5 | sudo rmdir wordpress |
Command 6 | sudo rm latest.tar.gz |
Step 9: Create a MySQL database and user for WordPress:
Command 1 | sudo mysql -u root -p |
Command 2 | CREATE DATABASE wordpress; CREATE USER ‘wordpressuser’@’localhost’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpressuser’@’localhost’; |
Command 3 | FLUSH PRIVILEGES; |
Command | EXIT; |
Step 10: Configure WordPress by copying the sample configuration file and editing it with the MySQL database details:
Command 1 | cd /var/www/html |
Command 2 | sudo cp wp-config-sample.php |
Command 3 | wp-config.php sudo vi wp-config.php |
Edit the following lines:
Command 1 | define(‘DB_NAME’, ‘wordpress’); |
Command 2 | define(‘DB_USER’, ‘wordpressuser’); |
Command 3 | define(‘DB_PASSWORD’, ‘password’); |
Command 4 | define(‘DB_HOST’, ‘localhost’); |
Step 11: Modify the .htaccess file to hide index.php from URLs:
Command 1 | cd /var/www/html |
Command 2 | sudo vi .htaccess |
Add the following code:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress |
Step 12: Restart the Apache web server by running the following command:
Command 1 | sudo yum install vsftpd restart |
Step 13: Set up FTP access to the server by installing vsftpd:
Command 1 | sudo service httpd restart |
Step14: Enable FTP access by editing the configuration file:
Command 1 | sudo vi /etc/vsftpd/vsftpd.conf |
Add the following lines at the end of the file:
write_enable=YES local_umask=022 chroot_local_user=YES user_sub_token=$USER local_root=/var/www/html/$USER pasv_min_port=1024 pasv_max_port=1048 pasv_address=<YOUR_PUBLIC_IP_ADDRESS> |
Step 15: Create an FTP user for each WordPress user by running the following command:
Command 1 | sudo useradd -d /var/www/html/ -s /sbin/nologin |
Command 2 | sudo passwd |
Step 16: Test FTP access by connecting to the server using an FTP client
Command 1 | sudo useradd -d /var/www/html/ -s /sbin/nologin |
Command 2 | sudo passwd |
To open PHPMyAdmin, follow these steps:
Step 1: Install PHPMyAdmin using the following command:
Command 1 | sudo yum install phpMyAdmin |
Step2: Configure PHPMyAdmin by editing the Apache configuration file:
Command 1 | sudo vi /etc/httpd/conf.d/phpMyAdmin.conf |
Comment out the existing lines and add the following lines:
Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require all granted Require ip <YOUR_IP_ADDRESS> Require ip ::1 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from <YOUR_IP_ADDRESS> Allow from ::1 </IfModule> </Directory> |
Note: Replace `YOUR_IP_ADDRESS` with your public IP address.
Step 3: Restart the Apache web server by running the following command:
Command 1 | sudo service httpd restart |
Step 4: Access PHPMyAdmin
By navigating to `http://<YOUR_PUBLIC_IP_ADDRESS>/phpMyAdmin`
Step 5: Log in using the MySQL database credentials you created earlier.
Command 1 | sudo yum install phpMyAdmin |
Trust and Worth
Our Customers
We are having a diversified portfolio and serving customers in the domains namely Sports Management, Online Laundry System, Matrimonial, US Mortgage, EdTech and so on.















Would you like to start a project with us?
DAStek team would be happy to hear from you and would love to turn your ‘Imaginations to Reality’.