Apache Httpd 설치
의존 패키지 버전
PROGRAM | VERSION |
---|---|
apr | 1.6.2 |
apr-util | 1.5.3 |
curl | 7.30.0 |
pcre | 8.00 |
openssl | 1.0.2m |
httpd | 2.4.27 |
apr 설치
1. Configuration
./configure --prefix=/apps/share/apr/1.6.2
2. Build
make
3. Install
make install
apr-util 설치
1. Configuration
./configure --prefix=/apps/share/apr-util/1.5.3 \
--with-apr=/apps/share/apr
2. Build
make
3. Install
make install
curl 설치
1. Configuration
./configure --prefix=/apps/share/curl/7.30.0
2. Build
make
3. Install
make install
pcre 설치
1. Configuration
./configure --prefix=/apps/share/pcre/8.00
2. Build
make
3. Install
make install
openssl 설치
1. Configuration
./config --prefix=/apps/share/openssl/1.0.2m \
--openssldir=/apps/share/openssl/1.0.2m -fPIC
2. Build
make
3. Install
make install
httpd 설치
1. Configuration
./configure --prefix=/apps/httpd/2.4.27 --with-apr=/apps/share/apr \
--with-apr-util=/apps/share/apr-util --with-pcre=/apps/share/pcre \
--enable-module=so --enable-so --enable-mods-shared=ssl --with-ssl=/apps/share/openssl \
--enable-ssl=shared --enable-rewrite
2. Build
make
3. Install
make install
4. Httpd Configuration
vi /apps/httpd/2.4.27/conf/httpd.conf
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "/apps/httpd" ## 변경
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
Listen 80 ## 변경
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so ## 주석 해제
LoadModule proxy_module modules/mod_proxy.so ## 주석 해제
LoadModule proxy_http_module modules/mod_proxy_http.so ## 주석 해제
LoadModule php7_module modules/libphp7.so
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
User httpd ## httpd 데몬 실행 시스템 유저
Group httpd ## 위 유저의 그룹
</IfModule>
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin you@example.com ## 변경
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 192.168.179.84 ## 변경
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/data/docs/wp_bigdata" ## 변경
<Directory "/data/docs/wp_bigdata"> ## 변경
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.html ## 변경
</IfModule>
#
# ErrorLog: The location of the error log file.
#
ErrorLog "/logs/httpd/error_log" ## 변경
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "/logs/httpd/access_log" common ## 변경
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/apps/httpd/cgi-bin/" ## 경로 확인
</IfModule>
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .html ## 추가
</IfModule>
# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf ## virtual host 사용하는 경우 활성화한 다음 해당 파일 내용 수정
# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf ## TLS 사용하는 경우 활성화한 다음 해당 파일 내용 수정