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
위젯 설치
# 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 설치
www.mysql.com/products/community/
진입 후 Download MySQL Community Edition => MySQL Yum Repository =>
리눅스 7 다운 => No thanks, just start my 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버전은 서버 설치과정에서 임시 비밀번호가 생성되며, 이 명령어로 확인 가능
(root@localhost: u=M)kGfld8H- 에서 u=부터 비밀번호임)
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 파일에 해당 내용 작성
?>
'구축' 카테고리의 다른 글
0405 공부(phpmyadmin db테이블 작성하기) (0) | 2022.04.06 |
---|---|
APM 구축하기(퍼옴) (0) | 2022.04.03 |
PHPMYADMIN 설치방법 (0) | 2022.04.03 |
APM 설치방법(Cent OS 기준) (0) | 2022.03.28 |