- ubuntu 16.04
- php 7.1
- apache 2.4
- mysql 5.7
- git & composer
- "sudo dpkg-reconfigure tzdata" : set system timezone
- "sudo apt-get update"
- "sudo add-apt-repository ppa:ondrej/php" : add php offical repository
- "sudo apt-get update"
- "sudo apt-get install php7.1 php7.1-common php7.1-zip php7.1-xml php7.1-mbstring php7.1-mysql php7.1-mcrypt php7.1-cli libapache2-mod-php7.1 -y"
- "sudo apt-get install apache2 -y"
- "sudo a2dismod php7.0" disabled apache use php7.0
- "sudo a2enmod php7.1" enable apache use php7.1
- "cd /etc/apache2/site-enabled"
- "vim account-service-write.conf"
- paste
<VirtualHost *:80>
ServerName {your IP}
DocumentRoot /home/{user}/{your application}/public
<Directory "/home/{user}/{your application}">
AllowOverride all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
- "sudo service apache2 restart"
suggest use different account for application and root
- "sudo apt-get install mysql-server"
- "mysql -u root -p"
- after into mysql : "create database {your database name}"
- "GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '{mysql_root_password}';"
- "FLUSH PRIVILEGES;"
- first build master mysql & slave mysql
- master mysql : "GRANT REPLICATION SLAVE ON . TO 'repl'@'%' IDENTIFIED BY 'repl';"
- master : "sudo vim /etc/my.cnf"
- paste :
server-id = 1
default-character-set = utf8
default-storage-engine = innodb
bind-address = 0.0.0.0
log-bin = mysql-bin
binlog_format = row
log_slave_updates = 1
expire_logs_days = 7
gtid-mode = ON
enforce-gtid-consistency = ON
- master : "sudo service mysql restart"
- slave : "sudo vim /etc/my.cnf"
- paste :
server-id = 2
default-character-set = utf8
default-storage-engine = innodb
bind-address = 0.0.0.0
log-bin = mysql-bin
binlog_format = row
log_slave_updates = 1
expire_logs_days = 7
gtid-mode = ON
enforce-gtid-consistency = ON
- slave mysql : "CHANGE MASTER TO MASTER_HOST='{master_mysql_ip}', MASTER_PORT={master_mysql_port},MASTER_USER='repl', MASTER_PASSWORD='repl',MASTER_AUTO_POSITION = 1;"
- slave mysql : "START SLAVE;"
- check mysql salve is ok : "show slave status\G"
- "sudo apt-get install git -y"
- "sudo curl -sS https://getcomposer.org/installer -o composer-setup.php"
- "sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer"
- "sudo rm composer-setup.php"
- "sudo mkdir ~/{your application}"
- "cd ~/lnb-account-service-write"
- "git clone {remote git repository}"
- "composer install"