구축

APM 구축하기(퍼옴)

김띵똥 2022. 4. 3. 00:45

아파치 (Apache)

apache 설치

# yum -y isntall httpd

 

# systemctl enable httpd	//부팅시 자동시작
# systemctl start httpd		//서비스 시작
# systemctl stauts httpd	//상태확인

 

포트 열어주기

# firewall-cmd --zone=public --permanent --add-port=80/tcp	//80포트 개방
# firewall-cmd --reload						//방화벽 리로드
# firewall-cmd --zone=public --list-all				//열린 포트 확인

 

 

웹 서비스 구동 확인

 

PHP

weget 설치

# yum -y install wget

 

repository 설정

# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
# yum install yum-utils
# yum-config-manager --enable remi-php74

 

php 7.4 설치

yum install -y php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql

 

MySQL

MySQL 설치 다운로드 링크

www.mysql.com/products/community/

 

MySQL :: MySQL Community Edition

MySQL Community Edition MySQL Community Edition is the freely downloadable version of the world's most popular open source database. It is available under the GPL license and is supported by a huge and active community of open source developers. The MySQL

www.mysql.com

Download MySQL Community Edition 클릭

CentOS이므로 Yum 레포지토리로 설치

CentOS7이므로 두번째 Download 클릭

링크 주소 복사

 

MySQL Repository 설치

# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm

 

MySQL 설치

# yum install -y mysql-server

 

# systemctl start mysqld
# systemctl enable mysqld
# systemctl status mysqld

MySQL 접속

# grep 'temporary password' /var/log/mysqld.log		
//mysql 8.0버전은 서버 설치과정에서 임시 비밀번호가 생성되며, 이 명령어로 확인 가능

# mysql -u root -p

접속 성공

MySQL 계정 비빌번호 변경

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssw0rd!';

 

Apache와 php 연동

# vi /etc/httpd/conf/httpd.conf		//아파치 설정 파일
<IfModule dir_module>
	DirectoryIndex index.html   >   DirectoryIndex index.html index.php
</IfModule>

위 부분을 찾아 DirectoryIndex index.html을 DirectoryIndex index.html index.php으로 수정

 

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig /etc/mime.types
 
    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
 
    ~
    .
    .
    .
    .
     
    #
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

위 부분의 내용을 찾아 마지막 부분에

 

.
    .
    #
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
 
    AddType application/x-httpd-php .html .htm .php .inc
    AddType application/x-httpd-php-source .phps
</IfModule>
두줄을 넣어주고 저장

 

# systemctl restart httpd	//시스템 재시작

 

Apache와 php 연동 확인

#vi /var/www/html/phpinfo.php	//기본 홈페이지의 디렉토리에 phpinfo.php 파일 생성
<?php
    phpinfo();			//phpinfo.php 파일에 해당 내용 작성
?>

브라우저에서 http://ip주소:포트/phpinfo.php를 입력해서 확인

'구축' 카테고리의 다른 글

0405 공부(phpmyadmin db테이블 작성하기)  (0) 2022.04.06
PHPMYADMIN 설치방법  (0) 2022.04.03
초기셋팅(APM,PHPMYADMIN)  (0) 2022.04.03
APM 설치방법(Cent OS 기준)  (0) 2022.03.28