[AWS] Amazon Linux AMI 버전 - APM 세팅 하기[AWS] Amazon Linux AMI 버전 - APM 세팅 하기

Posted at 2020. 3. 27. 16:03 | Posted in AWS



참고 : Amazon Linux AMI를 사용하여 LAMP 웹 서버 설치





■ Amazon Linux AMI 업데이트


 $ sudo yum -y update

 



 Apache 2.4 세팅



#01. Apache2.4 설치

 $ sudo yum install httpd24

 


 $ sudo service httpd start

 


 $ sudo chkconfig httpd on

 


 $ sudo chkconfig --list httpd

 



#02. Apache2.4 설정 변경

 $ sudo vim /etc/httpd/conf/httpd.conf 

 


 $ sudo service httpd restart

 




 PHP 7.2 세팅



① PHP 7.2 설치


 $ sudo yum install php72

 


 $ php -v

 


 $ sudo usermod- a -G apache ec2-user

 


 $ exit

 


 $ groups

 


 $ sudo chmod -R ec2-user:apache /var/www

 


 $ sudo chmod 2775 /var/www

 


 $ find /var/www -type d -exec sudo chmod 2775 {} \;

 


 $ find /var/www -type d -exec sudo chmod 0664 {} \;

 


 $ sudo yum install php72-fpm php72-pdo php72-common php72-opcache php72-mcrypt php72-cli php72-gd php72-curl php72-mysql php72-mysqlnd php72-xml php72-xmlrpc php72-soap php72-mbstring php72-json php72-process php72-imap php72-devel

 



② php.ini 설정 변경

 $ php -ini | grep php.ini

 


 $ sudo vim /etc/php.ini

 



③ php 설치 및 설정 변경 확인

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

 






 Data Base 설치



#01. MySQL 설치


 $ sudo yum install mysql157-server

 


 $ sudo service mysqld start

 


 $ sudo chkconfig mysql on

 


$ sudo chkconfig --list mysql

 






#02. MariaDB 설치


① MariaDB 설치 준비


 $ sudo vim /etc/yum.repos.d/MariaDB.repo 

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.4/centos6-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1


 $ sudo yum clean metadata

 



② MariaDB 설치


 $ sudo yum install MariaDB-server MariaDB-client

 


 $ sudo service mysql start

 


 $ sudo chkconfig mysql on

 


$ sudo chkconfig --list mysql

 




#03. root 계정 비밀번호 설정 및 접속가능여부 설정

 $ sudo mysql_secure_installation

① Enter current password for root (enter for none) : Enter

② Change root password? [Y/n] Y

③ New password : 사용자 지정 패스워드

④ Re-enter new password: 사용자 지정 패스워드

⑤ Remove anonymous users? [Y/n] Y

⑥ Disallow root login seremotely? [Y/n] Y

⑦ Remove test database and access to it? [Y/n] Y

⑧ Reload privilege tables now? [Y/n] Y



#04. root 계정 접속 및 DataBase 생성


$ sudo mysql -u root -p

 Enter password : placedb@031120##


MariaDB> CREATE DATABASE cmsdb;

MariaDB> use mysql;

MariaDB> INSERT INTO mysql.db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Execute_priv, Event_priv, Trigger_priv, Delete_history_priv) VALUE ('%', 'cmsdb', 'cmsdb', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

MariaDB> GRANT ALL ON *.* TO 'cmsdb'@'localhost' IDENTIFIED BY 'ppR346t4@fd' WITH GRANT OPTION;

MariaDB> GRANT ALL PRIVILEGES ON cmsdb.* TO 'cmsdb'@'%' IDENTIFIED BY 'ppR346t4@fd';

MariaDB> FLUSH PRIVILEGES;SHO

MariaDB> exit;







Name __

Password __

Link (Your Website)

Comment

SECRET | 비밀글로 남기기