Lädt...


🔧 How to Deploy a WordPress website on AWS Cloud(Elastic Compute Cloud).


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Introduction

To Deploy a WordPress website first you have to understand What is LAMP Stack? A “LAMP” stack is a group of open source software that is typically installed together in order to enable a server to host dynamic websites and web applications written in PHP. The term is an acronym which represents the Linux operating system, Apache web server, MySQL database and PHP.

Prerequisites
In order to use the AWS, you will need to have an Amazon Web Services (AWS) account.

Before proceeding to the first step first click the Security groups under the Network & Security. Then a list of security groups will be opened that are already created. Click on the option Create Security Group at the top right corner of screen.

Image description
Fill the above information accordingly and then scroll down.

Image description

In the above Image add the inbound rules that should contain the rules listed below:
Type- SSH | port-22 | Source Anywhere from IPv4- 0.0.0.0/0
Type- HTTP | port-80 | Source Anywhere from IPv4- 0.0.0.0/0
Type- HTTPS | port-443 | Source Anywhere from IPv4- 0.0.0.0/0

Image description

Step 1:
Search for the EC2 Service at the search bar.

Image description

Step 2:
Click on the 'Launch an instance' and enter your server name, secondly select an AMI(Amazon Machine Image) like Linux, macOs, Windows for the configuration of server.

Image description

Step 3:
Then select the instance type, this is basically the resources we will use from our cloud. Under Instance type, from the Instance type list, you can select the hardware configuration for your instance. Choose the t2.micro instance type, which is selected by default. The t2.micro instance type is eligible for the free tier. In Regions where t2.micro is unavailable, you can use a t3.micro instance under the free tier.

Image description

Step 4:
Under the Key pair (login) click on the link at the bottom right create new key pair

Image description

In the above screenshot enter the Key Pair name like 'server-name'. Then select the Encryption technique that is RSA selected by Default & then select the .pem format for the Key File to be downloaded locally in order to access the server locally using SSH Protocol.
At last click the Create Key Pair. After clicking it a file will be downloaded named 'server-name.pem' it is a text file containing the RSA key.

Step 5:
Under the Network Settings select existing Security groups and then select that specific security group you created at the start

Image description

Step 6:
Then at last on the right side check the summary of your configuration of instance and after a brief check, click Launch instance.

Image description

It will redirect to the page where the instances are listed including your new instance. Here you wait for 2-3 minutes for the initialization of instance and verify that Instance state is Running and status check should be 3/3. Then select the instance you created and click on the connect at the top right corner of screen.

Image description

If you want to configure it online using AWS CLI you can simply click connect and a tab will opened showing the CLI for the configuration.
But if you want to access your instance locally then go on the SSH client tab And here copy the command under the Example and paste it in the CLI of your localhost Windows/Linux and remember one thing you should be in the directory/folder where your Security Key file is saved.

I will prefer online AWS CLI for the configuration:

Image description

Step 7:
Now you have install the LAMP Stack here.

  1. Perform a quick software update on your instance:
sudo dnf update -y
  1. Install the latest versions of Apache web server and PHP packages for Amazon Linux 2023:
sudo dnf install -y httpd wget php-fpm php-mysqli php-json php php-devel

  1. Install the MariaDB software packages. Use the dnf install command to install multiple software packages and all related dependencies at the same time:
sudo dnf install mariadb105-server 

  1. Start the Apache web server:
sudo systemctl start httpd

  1. Use the systemctl command to configure the Apache web server to start at each system boot:
sudo systemctl enable httpd

  1. Secure the MariaDB installation: After the installation, run this command to secure your MariaDB:
sudo mysql_secure_installation

  1. Download WordPress: Navigate to the web root directory and download the latest version of WordPress:
cd /var/www/html
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xvzf latest.tar.gz
sudo mv wordpress/* ./
sudo rm -rf wordpress latest.tar.gz
sudo chown -R apache:apache /var/www/html
sudo chmod -R 755 /var/www/html

  1. Create a Database for WordPress: Log in to MariaDB and create a database for WordPress:
sudo mysql -u root -p

Inside the MariaDB shell, run the following SQL commands:

CREATE DATABASE wordpress;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

  1. Configure Apache: Open the Apache configuration file and add the following configuration:
sudo nano /etc/httpd/conf/httpd.conf

Ensure that the DocumentRoot is set to /var/www/html.
Modify the Directory Permissions for /var/www/html: In the httpd.conf file, look for the section that refers to /var/www/html (or you can add it if it doesn't exist):

<Directory "/var/www/html">
    AllowOverride All
    Require all granted
</Directory>

Restart Apache to apply changes:

sudo systemctl restart httpd

  1. Then go on the new tab and type : http://here-enter-public-ip Replace here-enter-public-ip with your actual public IP.

Image description

And here your wordPress is successfully deployed on your server.

Step 8:
Update Domain and DNS Settings
Point Domain to AWS: If you're using a custom domain, update the DNS settings with your domain registrar:

Set an A record pointing to your EC2 instance's public IP address.

Step 9:
Secure Your Website with SSL (Optional), So that it can be accessible at HTTPS.

  1. Install Certbot for SSL: Install Certbot, which is a tool to easily set up SSL for your site:
sudo yum install -y certbot python2-certbot-apache

  1. Obtain an SSL Certificate: Run Certbot to obtain an SSL certificate:
sudo certbot --apache -d yourdomain.com

  1. Test SSL Auto-Renewal: Certbot automatically renews SSL certificates, but you can test it by running:
sudo certbot renew --dry-run

At the End Test Your Website
Visit Your Site: Navigate to your domain or your EC2 instance's public IP address. Your website should now be live and functional.
Check SSL (if applied): If you installed SSL, ensure that your site is accessible via https://.

...

🔧 How to Deploy a WordPress website on AWS Cloud(Elastic Compute Cloud).


📈 54.65 Punkte
🔧 Programmierung

🔧 Belajar Deploy Aplikasi Web Menggunakan Layanan ECS (Elastic Compute Service) Alibaba


📈 33.68 Punkte
🔧 Programmierung

🔧 Deploy a static (Next.js) website to AWS using AWS CDK & AWS console


📈 33.37 Punkte
🔧 Programmierung

🔧 AWS EC2 Explained: Everything You Need to Know About Elastic Compute Cloud


📈 32.61 Punkte
🔧 Programmierung

🔧 1)AWS-Amazon Web Services(Basic Services)-EC2-Elastic Cloud Compute -Overview-Part-1


📈 32.61 Punkte
🔧 Programmierung

🔧 Unveiling the Power of AWS EC2: An Introduction to Elastic Compute Cloud.


📈 32.61 Punkte
🔧 Programmierung

📰 AWS unveils Mac instances for Amazon Elastic Compute Cloud


📈 32.61 Punkte
📰 IT Security Nachrichten

🔧 AWS Elastic Compute Cloud (EC2)


📈 32.61 Punkte
🔧 Programmierung

🔧 A Beginner's Guide to Understanding AWS EC2 -(Elastic Compute Cloud)


📈 32.61 Punkte
🔧 Programmierung

🔧 Managing Elastic IPs and Elastic Block Storage (EBS) in AWS - Week Eleven


📈 30.71 Punkte
🔧 Programmierung

🔧 AWS Compute - Part 5: How to choose compute service


📈 29.82 Punkte
🔧 Programmierung

🔧 Deploy Apache Airflow on AWS Elastic Kubernetes Service (EKS)


📈 27.62 Punkte
🔧 Programmierung

📰 Elastic präsentiert Elastic Security for Cloud - Dev-Insider


📈 27.15 Punkte
📰 IT Security Nachrichten

🔧 Understand Amazon Elastic Compute Cloud (EC2) for launching virtual machines


📈 26.71 Punkte
🔧 Programmierung

🔧 Understanding Amazon Elastic Compute Cloud (Amazon EC2)


📈 26.71 Punkte
🔧 Programmierung

🔧 Amazon EC2 (Elastic Compute Cloud) : Launching First Instance


📈 26.71 Punkte
🔧 Programmierung

📰 Suche: Der Elastic Agent bringt Daten auf neue Art in den Elastic Stack 7.9


📈 24.81 Punkte
📰 IT Nachrichten

📰 Elastic launches new alerting framework to bring native alerting workflows to Elastic Stack users


📈 24.81 Punkte
📰 IT Security Nachrichten

📰 Elastic Stack 7.3 bietet mit Elastic Maps ein Tool zur Geodatenanalyse


📈 24.81 Punkte
📰 IT Nachrichten

🔧 Creating a CI/CD Pipeline for AWS Elastic Beanstalk with AWS CDK


📈 24.21 Punkte
🔧 Programmierung

🔧 AWS Elastic Beanstalk vs. AWS Amplify: Choosing the Right Tool for Your App’s Success


📈 24.21 Punkte
🔧 Programmierung

🕵️ Microsoft Windows Host Compute Host Compute Service Shim Code Execution memory corruption


📈 23.92 Punkte
🕵️ Sicherheitslücken

📰 Intel Mini-PC: Auf die Compute Card folgt das NUC Compute Element


📈 23.92 Punkte
📰 IT Nachrichten

📰 Intel: Auf die Compute Card folgt das Compute Module


📈 23.92 Punkte
📰 IT Nachrichten

📰 Intel: Auf die Compute Card folgt das Compute Module


📈 23.92 Punkte
📰 IT Nachrichten

🕵️ OpenStack Compute 13.0.0 Compute Nodes Handler Disk Consumption Denial of Service


📈 23.92 Punkte
🕵️ Sicherheitslücken

🕵️ OpenStack Compute 13.0.0 Compute Nodes Handler Disk Consumption Denial of Service


📈 23.92 Punkte
🕵️ Sicherheitslücken

🔧 AmazonECS now supports AWS Graviton-based Spot compute with AWS Fargate Spot


📈 23.76 Punkte
🔧 Programmierung

🔧 30 Days of AWS- Part 2: AWS Compute


📈 23.76 Punkte
🔧 Programmierung

matomo