1. 관련 모듈 설치
1
|
$ yum install lua-devel libxml2-devel gcc gcc-c++ flex compat-gcc-* libjpeg-devel libpng-devel freetype-devel gd-devel expat-devel
|
cs |
2. libnghttpd2 설치
1
2
|
$ yum install epel-release
$ yum install --enablerepo=epel libnghttp2 libnghttp2-devel
|
cs |
3. openssl 설치 (1.0.1e 버전 이상만 되면 된다)
1
2
3
4
5
|
$ ./config --prefix=/usr/local/openssl shared zlib
$ make && make install
$ ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
( 이 작업 전에 기존에 등록되어 있는 파일이 있다면 백업정돈 하자)
$ openssl version
|
cs |
마지막 명령줄을 실행하면 openssl 의 버전이 나오면서 내가 설치한 버전이 잘 설치 되었는지 확인할 수 있다.
하지만,! 설치고 에러가 날 수 있는데, libssl.so.1.1 / libcrypto.so.1.1 이 없다는 ...
위 에러 발생시 openssl 의 압축을 해제 한 폴더를 보면 두 파일이 있다.
/usr/lib64 로 복사하면 정상 실행 된다.
4. apr 설치
1
2
|
$ ./configure
$ make && make install
|
cs |
만약 configure 하는 도중 libtoolT 가 없다고 하면, ln -s libtool libtoolT 를 한다
5. apr-util 설치
1
2
|
$ ./configure --with-apr=/usr/local/apr --with-expat=builtin
$ make && make install
|
cs |
6. pcre 설치 (pcre2를 해선 안된다. pcre2 는 컴파일 시 아파치가 인식하지 못한다)
1
2
|
$ ./configure --prefix=/usr/local/pcre
$ make && make install
|
cs |
7. Apache 설치 (run.sh 와 같은 파일에 작성 후 실행시키면 편하다)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
./configure \
--prefix=/apps/httpd-2.4.33 \
--enable-module=most \
--enable-mods-shared=all \
--enable-so \
--with-mpm=event \
--enable-cache \
--enable-deflate \
--enable-expires \
--enable-cgi \
--enable-vhost-alias \
--enable-rewrite \
--enable-mime-magic \
--enable-ssl \
--enable-http2 \
--with-ssl=/usr/local/openssl \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr \
--with-pcre=/usr/local/pcre/bin/pcre-config
|
cs |
8. httpd.conf 수정 (HTTP2 사용을 위해서 추가작업이 필요하다)
1
2
3
4
5
|
LoadModule http2_module modules/mod_http2.so
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
</IfModule>
|
cs |
9. HTTP2 는 SSL 환경에서만 동작이 가능하기 때문에 http-ssl.conf 파일도 수정하도록 한다.
1
2
|
SSLProtocol ALL -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
|
cs |
10. 서비스 등록하기
1
2
3
|
$ cp {설치폴더}/bin/apachectl /etc/init.d/httpd
$ service httpd start
$ service httpd stop
|
cs |
위 설정까지만 해도 충분히 아파치는 잘 동작한다.
단, PHP 와 연결을 위한 설정 몇개를 더 쓴다
11. httpd.conf 에서
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mime_module>
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
<Directory "/home/*">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
Require all granted
</Directory>
|
cs |
서비스 자동 실행 등록 등의 작업이 필요하다면 #여기로
'기억할것들 > CentOS' 카테고리의 다른 글
증분백업. rsnapshot 사용하기. (0) | 2019.01.11 |
---|---|
PEM Key 로 public Key 생성하기 (0) | 2018.08.13 |
Apache Log 가상호스트 별로 쌓기 (0) | 2017.11.28 |
2TB 를 초과하는 용량의 HDD 또는 Raid Disk 를 마운트 하는법 (0) | 2017.11.28 |
RSYNC 사용하기. (0) | 2017.06.26 |