※ CentOS 7 환경으로 설치 진행
1. 필수패키지 설치 진행
# yum -y install gcc* openssl*
2. httpd-2.2.23 설치
# tar xvfz httpd-2.2.23.tar.gz
# cd httpd-2.2.23
# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-mods-shared=shared --enable-modules=so --enable-ssl --with-included-apr --with-mpm=worker
# make && make install
3. httpd 설정
# vi /usr/local/apache/conf/httpd.conf
아래 내용 주석처리 해제
ServerName www.example.com:80
아래 내용 추가
<Directory /home/*>
AllowOverride All
Require all granted
</Directory>
4. 자동실행 실정
# cp -arp /usr/local/apache/bin/apachectl /etc/init.d/apachectl
# vi /etc/init.d/apachectl
아래내용 추가
#!/bin/sh
#
# chkconfig: 2345 90 90
# description: init file for Apache server daemon
# processname: /usr/local/apache/bin/apachectl
# config: /usr/local/apache/conf/httpd.conf
# pidfile: /usr/local/apache/logs/httpd.pid
#
# chkconfig –add apachectl
# chkconfig apachectl on
# vi /etc/systemd/system/httpd.service
아래내용 추가
[Unit]
Description=The Apache HTTP Server
[Service]
Type=forking
PIDFile=/usr/local/apache/logs/httpd.pid
ExecStart=/usr/local/apache/bin/apachectl start
ExecReload=/usr/local/apache/bin/apachectl graceful
ExecStop=/usr/local/apache/bin/apachectl stop
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable httpd
5. 방화벽 추가
# vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT
# service iptables restart
6. 서비스 시작
# /etc/init.d/apachectl# systemctl start httpd
'LINUX > WEB' 카테고리의 다른 글
PHP 5.5 소스설치 (0) | 2019.05.27 |
---|---|
PHP 5.3 소스설치 (0) | 2019.05.27 |
PHP 5.2 소스설치 (0) | 2019.05.27 |
Apache 설치 시 에러사항 (0) | 2019.05.27 |
Apache 2.4 소스설치 (0) | 2019.05.27 |