CentOS 7 에서 httpd 2.4.51, PHP 8.0 소스 설치하기
1. httpd 관련 패키지 설치
# yum -y install gcc gcc-c++ libtermcap-devel gdbm-devel zlib* libxml* freetype* libjpeg* gd-*
# yum -y install libpng* --skip-broken pcre-devel
2. apr 설치
# cd /usr/local/src
# wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
# tar xvzf apr-1.5.2.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/usr/local/apr
# make
# make install
3. apr-util 설치
# cd ..
# wget https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
# tar xvzf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
4. httpd 설치
# cd ..
# wget https://archive.apache.org/dist/httpd/httpd-2.4.51.tar.gz
# tar xvzf
# cd httpd-2.4.51
# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-rewrite --enable-ssl --enable-so
# make
# make install
5. PHP 관련 패키지 설치
# yum -y install sqlite-devel
6. PHP 설치
# cd ..
# wget https://www.php.net/distributions/php-8.0.12.tar.gz
# tar xvzf php-8.0.12.tar.gz
# cd php-8.0.12.tar.gz
# ./configure --prefix=/usr/local/php --with-mysqli --with-openssl=/usr/local/ssl --with-pdo-mysql=mysqlnd --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-zlib --disable-debug --enable-calendar --enable-ftp --enable-sockets --enable-sysvsem
# make
# make install
# cp -arp php.ini-production /etc/php.ini
6. httpd 및 PHP 기본 설정
# vi /usr/local/apache/conf/httpd.conf
ServerName localhost
<Directory /usr/local/apache/htdocs>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# vi /etc/php.ini
short_open_tag = On
date.timezone = "Asia/Seoul"
open_basedir = "/usr/local/apache/htdocs"
'리눅스 > APACHE' 카테고리의 다른 글
Rocky Linux 8.5 에서 Lighttpd + PHP + MariaDB 설치하기 (0) | 2022.05.24 |
---|---|
[보안 설정] HTTP 불필요한 method 취약점 제거 (Disable HTTP Trace) (0) | 2022.03.31 |
php 확장자 없이 페이지 접속 가능하게 하기 (0) | 2021.11.30 |
[에러] (13)Permission denied: [client ...] AH00035: access to ... denied ... because search permissions are missing on a component of the path (0) | 2021.11.08 |
httpd 특정 파일명 또는 확장자 로그 (access_log) 남기지 않기 (0) | 2021.07.01 |