-- Launch an EC2 Ubuntu Instance from below link
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
-- Create new certificate and after download give permisson to pem file
chmod 400 mycertificate.pem
-- Connect to EC2 instance
ssh -i mycertificate.pem ubuntu@eec2-**-**-**-**.eu-west-1.compute.amazonaws.com
-- Update ubuntu
sudo apt-get update
-- Installing mysql server
$ sudo apt-get install mysql-server
root pass : ************
$ sudo mysql_secure_installation
Enter current password for root: Press return for none
Change Root Password: Y
New Password: Enter your new password
Remove anonymous user: Y
Disallow root login remotely: Y
Remove test database and access to it: Y
Reload privilege tables now: Y
$ sudo vim /etc/mysql/mysql.conf.d/myconf.cnf
[mysqld]
lower_case_table_names=1
init_connect= 'SET NAMES utf8'
init_connect= 'SET collation_connection = utf8_general_ci'
collation-server = utf8_general_ci
character-set-server = utf8
# bind-address = 0.0.0.0
$ sudo service mysql restart
$ mysql -u root -p
mysql> CREATE DATABASE my_schema CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'my_schema_user'@'%' IDENTIFIED BY '*********';
mysql> GRANT ALL PRIVILEGES ON my_schema. * TO 'my_schema_user'@'%';
mysql> FLUSH PRIVILEGES;
-- Mysq db backup and restore
mysqldump -h ec2-**-**-**-**.eu-west-1.compute.amazonaws.com -u my_schema_user -p my_schema > my_schema_backup.sql
mysql -h ec2-**-**-**-**.eu-west-1.compute.amazonaws.com -u my_schema_user -p my_schema < my_schema_backup.sql
-- Upload file
scp -i mycertificate.pem myapp.war ubuntu@ec2-**-**-**-**.eu-west-1.compute.amazonaws.com:/home/ubuntu/upload/
-- Install the Apache Web Server
$ sudo apt-get install apache2
sudo service apache2 restart
-- Test web server on local system
curl 127.0.0.1
-- Test web server, use public dns name in a browser.
http://ec2-**-**-**-**.eu-west-1.compute.amazonaws.com/
-- Install PHP
$ sudo apt-get install php php-mysql libapache2-mod-php7.0
-- Restart the Apache Web Server
$ sudo service apache2 restart
-- Test php installation
$ cd /var/www/html
$ sudo vi test.php
<?php phpinfo() ?>
Browser: http://ec2-**-**-**-**.eu-west-1.compute.amazonaws.com/test.php
-- Install WordPress
$ cd /var/www/html
$ wget http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
$ mv wordpress mypage
-- Create the WordPress wp-config.php file:
$ cd mypage
$ mv wp-config-sample.php wp-config.php
-- Modify the database connection parameters as follows
$ vi wp-config.php
define('DB_NAME’, 'my_schema’);
define('DB_USER’, 'my_schema_user’);
define('DB_PASSWORD’, '*********’);
define('DB_HOST’, 'localhost’);
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
-- Create new certificate and after download give permisson to pem file
chmod 400 mycertificate.pem
-- Connect to EC2 instance
ssh -i mycertificate.pem ubuntu@eec2-**-**-**-**.eu-west-1.compute.amazonaws.com
-- Update ubuntu
sudo apt-get update
-- Installing mysql server
$ sudo apt-get install mysql-server
root pass : ************
$ sudo mysql_secure_installation
Enter current password for root: Press return for none
Change Root Password: Y
New Password: Enter your new password
Remove anonymous user: Y
Disallow root login remotely: Y
Remove test database and access to it: Y
Reload privilege tables now: Y
$ sudo vim /etc/mysql/mysql.conf.d/myconf.cnf
[mysqld]
lower_case_table_names=1
init_connect= 'SET NAMES utf8'
init_connect= 'SET collation_connection = utf8_general_ci'
collation-server = utf8_general_ci
character-set-server = utf8
# bind-address = 0.0.0.0
$ sudo service mysql restart
$ mysql -u root -p
mysql> CREATE DATABASE my_schema CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'my_schema_user'@'%' IDENTIFIED BY '*********';
mysql> GRANT ALL PRIVILEGES ON my_schema. * TO 'my_schema_user'@'%';
mysql> FLUSH PRIVILEGES;
-- Mysq db backup and restore
mysqldump -h ec2-**-**-**-**.eu-west-1.compute.amazonaws.com -u my_schema_user -p my_schema > my_schema_backup.sql
mysql -h ec2-**-**-**-**.eu-west-1.compute.amazonaws.com -u my_schema_user -p my_schema < my_schema_backup.sql
-- Upload file
scp -i mycertificate.pem myapp.war ubuntu@ec2-**-**-**-**.eu-west-1.compute.amazonaws.com:/home/ubuntu/upload/
-- Install the Apache Web Server
$ sudo apt-get install apache2
sudo service apache2 restart
-- Test web server on local system
curl 127.0.0.1
-- Test web server, use public dns name in a browser.
http://ec2-**-**-**-**.eu-west-1.compute.amazonaws.com/
-- Install PHP
$ sudo apt-get install php php-mysql libapache2-mod-php7.0
-- Restart the Apache Web Server
$ sudo service apache2 restart
-- Test php installation
$ cd /var/www/html
$ sudo vi test.php
<?php phpinfo() ?>
Browser: http://ec2-**-**-**-**.eu-west-1.compute.amazonaws.com/test.php
-- Install WordPress
$ cd /var/www/html
$ wget http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
$ mv wordpress mypage
-- Create the WordPress wp-config.php file:
$ cd mypage
$ mv wp-config-sample.php wp-config.php
-- Modify the database connection parameters as follows
$ vi wp-config.php
define('DB_NAME’, 'my_schema’);
define('DB_USER’, 'my_schema_user’);
define('DB_PASSWORD’, '*********’);
define('DB_HOST’, 'localhost’);
Comments
Post a Comment