Install wordpress on amazon linux AMI ec2
Install wordpress on amazon linux AMI ec2
02/01/2016
Common commands for amazon linux AMI ec2
Common commands for amazon linux AMI ec2
07/01/2016
Show all

Restore wordpress on amazon linux AMI ec2

Restore wordpress on amazon linux AMI ec2

login with ec2-user and run this commands:

Move all files & folders from http foldersudo mv /var/www/html/* /var/tmp/
Copy backup file (wordpress site files) to http folder and unzipsudo tar -xzf backfilename
Copy backup file SQL to http folder and unzipsudo tar -xzf db.tar
Create databasemysqladmin -u root -p create dbname
Import SQL backup file to databasesudo mysql -h localhost -u root -p --max_allowed_packet=1073741824 dbname < /var/www/html/dbname.sql
clean.........
delete backup file from html folder
delete back sql file from html folder

FIX Directory permissions
sudo groupadd www
sudo usermod -a -G www ec2-user
sudo chown -R root:www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} +
find /var/www -type f -exec sudo chmod 0664 {} +
sudo usermod -a -G www apache
sudo chown -R apache /var/www
sudo chgrp -R www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} +
find /var/www -type f -exec sudo chmod 0664 {} +
sudo service httpd restart
.

 

FIX ERROR 2006 (HY000): MySQL server has gone away

Adding this line into my.cnf max_allowed_packet=1000M
sudo nano /etc/my.cnf
sudo service mysqld stop
sudo service mysqld start

Resources: link





Leave a Reply

Your email address will not be published. Required fields are marked *