[ 참조] http://aeac.tistory.com/20
1. 의존성 체크
rpm -qa libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel
및 설치
yum install libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel
2. Apache => Maria => PHP 순으로 설치
yum install httpd
yum install mariadb mariadb-server
yum install php php-mysql php-mbstring php-pdo php-gd
설치 확인 : rpm -qa httpd mariadb php
3. Apache/ FireWall 설정
3.1. vi /etc/httpd/conf/httpd.conf
66 User nobody (apache → nobody 변경)
67 Group nobody (apache → nobody 변경)
96 ServerName 192.168.223.129:80
3.2. vi /etc/sysconfig/iptables => Centos 7 부터는 iptables가 fiwalld 로 변경됨. ( 참조 : https://www.lesstif.com/pages/viewpage.action?pageId=22053128 )
vi /etc/firewalld/zones/public.xml 에 아래 추가
<service name="http"/>
<service name="https"/>
firewall-cmd --reload
4. Apache 시작
systemctl start httpd # service httpd start 로도 가능
systemctl enable httpd # 부팅후 자동 실행
ps -ef | grep httpd # 확인
webbrowswer 에서 http://ip 로 접속해서 Aapache 페이지가 뜨면 OK.
5. PHP 설정
vi /etc/httpd/conf/httpd.conf
165 DirectoryIndex index.html index.htm index.php # index.php 추가
285 AddType application/x-httpd-php .php .html .htm .inc # x-gzip 아래추가. mime_module.
286 AddType application/x-httpd-php-source .phps # 추가
vi /etc/php.ini # 실제 PHP 설정은 여기서 함.
# 당장 설정할 것은 없음.
6. PHP 설정 적용
service httpd restart
7. PHP 개발
cd /var/www/html/
vi phpinfo.php # 샘플
<?php phpinfo(); ?>
8. Maria DB 시작
systemctl start mariadb
mysql_secure_installation # 엔터나 Y, 암호 설정등 진행
mysql -u root -p # 접속
vi /etc/my.cnf # 설정시 필요
이상 APM 설정 완료