Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _______________MASTER_______________
- yum install epel-release
- yum -y install mariadb-server mariadb
- systemctl start mariadb.service
- systemctl enable mariadb.service
- mysql_secure_installation
- nano /etc/my.cnf
- [mysqld]
- log-bin=mysql-bin
- server-id=101
- systemctl restart mariadb
- mysql -u root -p
- create user AMI@DOMAIN identified by 'passowrd';
- stop slave;
- grant replication slave on *.* to namauser@'%' identified by 'passwordnya';
- flush privileges;
- firewall-cmd --permanent --add-service=mysql
- firewall-cmd --reload
- ______________SLAVE______________
- yum install epel-release
- yum -y install mariadb-server mariadb
- systemctl start mariadb.service
- systemctl enable mariadb.service
- mysql_secure_installation
- nano /etc/my.cnf
- [mysqld]
- log-bin=mysql-bin
- server-id=102
- report-host=DOMAIN_SLAVE
- systemctl restart mariadb
- firewall-cmd --permanent --add-service=mysql
- firewall-cmd --reload
- ____________MASTER____________
- mysql -u root -p
- flush tables with read lock;
- show master status;
- mysqldump -u root -p --all-databases --lock-all-tables --events > mysql_dump.sql
- mysql -u root -p
- unlock tables;
- quit
- scp mysql_dump.sql DOMAIN_SLAVE:/tmp/
- ___________SLAVE_______________
- mysql -u root -p < /tmp/mysql_dump.sql
- mysql -u root -p
- change master to
- master_host='IP_MASTER',
- master_user='AMI',
- master_password='password',
- master_log_file='mysql-bin.000002',
- master_log_pos=123;
- start slave;
- show slave status\G;
- yes
- yes
- __________SLAVE WEB SERVER_________
- yum -y install httpd
- systemctl start httpd.service
- systemctl enable httpd.service
- firewall-cmd --permanent --zone=public --add-service=http
- firewall-cmd --permanent --zone=public --add-service=https
- firewall-cmd --permanent --zone=public --add-port=80/tcp&udp
- firewall-cmd --reload
- test
- yum -y install php
- systemctl restart httpd.service
- vi /var/www/html/info.php
- http://ip/info.php
- yum -y install php-mysql
- yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
- systemctl restart httpd.service
- http://ip/info.php
- ___________MASTER_______________
- create database wordpress;
- __________SLAVE WEB SERVER___________
- mysql -u root -p
- create user userwp@localhost identified by 'password';
- grant all privileges on wordpress.* TO userwp@localhost IDENTIFIED BY 'password';
- FLUSH PRIVILEGES;
- exit
- yum install php-gd
- service httpd restart
- wget http://wordpress.org/latest.tar.gz
- tar xzvf latest.tar.gz
- yum install rsync -y
- rsync -avP ~/wordpress/ /var/www/html/
- mkdir /var/www/html/wp-content/uploads
- chown -R apache:apache /var/www/html/*
- cp wp-config-sample.php wp-config.php
- nano wp-config.php
- define('DB_NAME', 'wordpress');
- define('DB_USER', 'wordpressuser');
- define('DB_PASSWORD', 'password');
- systemctl restart httpd
- ____________NODE WEB SERVER______________
- grep "mod_proxy" /etc/httpd/conf.modules.d/00-proxy.conf
- nano /etc/httpd/conf.d/r_proxy.conf
- <IfModule mod_proxy.c>
- ProxyRequests Off
- <Proxy *>
- Require all granted
- </Proxy>
- ProxyPass / http://172.3.3.3/
- ProxyPassReverse / http://172.3.3.3/
- </IfModule>
- systemctl restart httpd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement