Skip to main content

Install PHP & MySQL on Amazon Linux 2

Install PHP

sudo yum update -y

sudo amazon-linux-extras install -y php7.3

sudo yum install -y httpd

sudo systemctl start httpd

sudo systemctl enable httpd

sudo systemctl is-enabled httpd

sudo systemctl restart httpd

echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php


Install MYSQL 5.7

1. sudo yum update -y

2. sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

3. sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm 

4. sudo yum install mysql-community-server

5. sudo systemctl start mysqld.service 

   or

   sudo service mysqld start

   or

   sudo service mysqld status  

6. To get the default password

   sudo grep 'temporary password' /var/log/mysqld.log 

7. mysql -u root -p

8. Change the password

   mysql_secure_installation

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Success.

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

  ... skipping.

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

  - Dropping test database...

Success.

- Removing privileges on test database...

Success.

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Success.

All done!

9. Restart service

   systemctl restart mysql

10. Then connect to MySQL and create user and grand all privilege to all database

   [ec2-user@ip- etc]$  mysql -u root -p

   Enter password:

   mysql> GRANT ALL ON *.* TO rahul@'%' IDENTIFIED BY "Rahul@Test123";

   Query OK, 0 rows affected, 1 warning (0.00 sec)

   mysql> FLUSH PRIVILEGES;

   Query OK, 0 rows affected (0.00 sec) 

Comments

Popular posts from this blog

How to configure memcache with drupal 8 on ubuntu for reduce page load?

Memcache is an in-memory (RAM). It store data in Key-Value Format. Memcached server automatically stores all the content (data) in allocated RAM on the server. After configure memcache, it increase Drupal Site performance by moving standard caches out of the database. Drupal does not come with memcache by default if we want to install it then we have to install it on server. There are many steps that how to install memcache on the server and how to configure it with drupal 8 for reducing the load on the database with every page request. Step1 :- Open terminal of your machine and run following commands :- a. sudo apt-get update b. sudo apt install memcached c. sudo apt install php-memcached Step2 :- Check that Memcache daemon is working by using the following command : a. "ps aus | grep memcached" Step3 :- Also, check Memcache extension is configured in PHP. For that you have create a file phpinfo.php then write below code. <?php phpinfo(); ?> or sudo vi /var/www/html...

How deploy your angular project on GitHub Pages

Step 1:- Create Repository on github Note :- Open terminal and goto your project direcoty then run following command which you got after created repository. Step 2:- git init Step 3:- git add . Step 4:- git commit -m "first commit" Step 5:- git branch -M main Step 6:- git remote add origin https://github.com/rahuldrupal5788/DevR9angular.git Step 7:- git push -u origin main Step 8:- We need to build our code in production mode for that we will create deployment files that will be deployed on GitHub Pages. By default, this deployment code is generated in the /dist/<ProdectName> folder under the angular project folder, but we need to generate this in the "docs" folder under the angular project folder. So, we need to make a small change in the angular.json file and change the outputpath value to "docs/". Step 9:- Run the following command with the baseHref  option in the git bash window to generate deployment files in the docs folder. ng build --prod --b...

What is Docker? How to create Dockerfile, Volumes? How to manage container with Port Mapping?

What is Docker? Docker is an open source centerlized Platform designed to Create, Deploy and run applications. Docker use container on the host OS to run applications. It allows application to use the same linux Kernal as a System on the host computer, rather than creating a whole virtual OS. We can install docker on any OS but Docker engine run natively on linux distribution. Docker written in 'go' language. Docker is a tool that perform OS level virtualization, also known as Containerization. Before Docker, many users faces the problem that a particular Code is running in  the developer's system but not in the User's System. Docker was first Release in March 2013. It is developed by Soloman Hykes and Sebastion Pahl. Docker is a set of Platform as a service that uses OS level Virtualization whereas VMware uses Hardware level Virtualization. We can say that Docker is a tools which create the VM. Advantages of Docker :- There are following advantage of Docker : No pre-a...