Jese Leos


Aws Server Setup(EC2)

Setting up an AWS (Amazon Web Services) server involves several steps here 

1.  Sign Up or Sign In for an AWS Account:

 


2. Navigate to EC2:

Click on "Instances" in the EC2 dashboard. 
 

3. Launch an Instance:

Click the "Launch Instance" button. 
Choose an Amazon Machine Image (AMI), which is essentially a template for the server.


4. Select an Instance Type:

Choose an instance type based on your needs (e.g., t2.micro for a free tier eligible instance) 


5. Configure Instance:

 To configure an AWS EC2 instance, you'll need to follow these general steps:

 Add Storage: Configure the size and type of storage (EBS volumes) for your instance.

 Add Tags: Optionally, add tags to your instance to organize and manage it easily.

 Configure Security Group: Define the security group settings to control inbound and outbound traffic to your instance.

Review Instance Launch: Review all your configurations and make any necessary changes.

Launch Instance: Once you're satisfied with the configuration, launch the instance.

Create Key Pair: If you don't have an existing key pair, create a new one. This key pair will be used to connect to your instance securely via SSH (for Linux instances) or RDP (for Windows instances).

Configure instance details, such as the number of instances, network settings, and IAM roles.

6. Access Instance:

 Once the instance is launched, you can access it using SSH (for Linux) or RDP (for Windows) with the private key associated with the key pair you created.

 after creation on of the connection  follow this steps

 

7. Install apache2

sudo apt update && sudo apt install apache2

 

8. Install PHP

 sudo apt install php
 sudo apt install php7.4 //for php7.4 only
 sudo apt install php //latest version of php

 

9. Install PHPmyadmin

sudo apt instal phpmyadmin

 

10. config PHPmyadmin

 sudo nano /etc/apache2/apache2.conf

add into

 Include /etc/phpmyadmin/apache.conf

 

11. install mysql-server

sudo apt install mysql-server

 

12. first connect with the mysql database

  sudo mysql -u root -p

 

13. create user for phpmyadmin or mysql database

CREATE USER username IDENTIFIED by 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

 

14. Restart Your Server

sudo systemctl restart apache2

Now your server is ready for use 

if you want some extra configuration then like ftp server then follow these steps

 

1. Install FTP server

 sudo apt install vsftpd

 

2. Create FTP Accounts

 sudo useradd -m testuser
sudo passwd testuser

 

3. Configure Firewall to Allow FTP Traffic

sudo ufw allow 20/tcp
sudo ufw allow 21/tcp

4. Configuring and Securing Ubuntu vsftpd Server

 

Change Default Directory

sudo mkdir /srv/ftp/new_location
sudo usermod -d /srv/ftp/new_location ftp

 

5. Restart the vsftpd service to apply the changes:

sudo service vsftpd restart

 

6. Authenticate FTP Users

sudo nano /etc/vsftpd.conf

Find the entry labeled write_enable=NO, and change the value to “YES.”

sudo systemctl restart vsftpd.service