서버 버전
더보기 접기
[root@ 2017 ~]# grep . /etc/*-release
/etc/centos-release:CentOS release 6.8 (Final)
/etc/lsb-release:LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
/etc/redhat-release:CentOS release 6.8 (Final)
/etc/system-release:CentOS release 6.8 (Final)
접기
시작 전 상황 : 아파치가 두개 설치되어 있는데 하나는 기본으로 설치된 것이고 하나는 다른분이 설치해둔 것이다.
그런데 원하는대로 작동이 안되고 있어서 새로 설치를 하려고 한다.
1. /etc/rc.d/init.d/httpd stop 로 기본으로 설치된 http를 내렸다.
2. 현재 설치해둔 아파치를 기준으로
/home/Server/apache/bin/httpd stop
/home/Server/apache/bin/httpd start
하면 아파치 서버를 내렸다 올렸다 할 수 있다.
-> 내려두고 새로 설치할 예정
########################################################################################
* 아파치 설치확인했을 때 ( http://madebykaus.com/?p=568 )
[root@2017 ~]# find / -name apachectl
/usr/sbin/apachectl
/home/Server/apache/support/apachectl
/home/Server/apache/bin/apachectl
########################################################################################
* 아파치 버전확인
[root@2017 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Jan 12 2017 17:09:39
########################################################################################
3.
오래된 글이긴 하지만.. https://kjvvv.kr/59926 여기 따라해볼 예정
########################################################################################
[root@2017 ~]# find / -name apachectl
/usr/sbin/apachectl
/home/Server/apache/support/apachectl
/home/Server/apache/bin/apachectl
[root@2017 ~]# ps -ef | grep httpd
root 13888 13542 0 10:25 pts/0 00:00:00 grep httpd
[root@2017 ~]# /etc/rc.d/init.d/httpd stop
httpd (no pid file) not running
[root@2017 ~]# yum remove -q httpd <-기본으로 설치되어 있는 아파치 삭제
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
httpd x86_64 2.2.15-56.el6.centos.3 @updates 3.0 M
Removing for dependencies:
httpd-devel x86_64 2.2.15-56.el6.centos.3 @updates 528 k
php x86_64 5.3.3-48.el6_8 @updates 3.5 M
php-devel x86_64 5.3.3-48.el6_8 @updates 3.0 M
Transaction Summary
================================================================================
Remove 4 Package(s)
Is this ok [y/N]: y
service httpd does not support chkconfig
warning: erase unlink of /etc/httpd/conf/httpd.conf failed: No such file or directory
[root@2017 ~]# find / -name apachectl
/home/Server/apache/support/apachectl
/home/Server/apache/bin/apachectl
-> 기존에 설치해둔 부분은 지우지 않았다.
########################################################################################
4.
이 링크로 넘어옴
http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%B5%9C%EC%8B%A0%EB%B2%84%EC%A0%84_%EC%84%A4%EC%B9%98_(%EC%BB%B4%ED%8C%8C%EC%9D%BC)
cd /usr/local/src
wget http://ftp.neowiz.com/apache/httpd/httpd-2.4.25.tar.bz2
wget http://ftp.neowiz.com/apache/apr/apr-1.5.2.tar.bz2
wget http://ftp.neowiz.com/apache/apr/apr-util-1.5.4.tar.bz2
wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2
더보기 접기
########################################################################################
[root@ 2017 src]# wget http://ftp.neowiz.com/apache/httpd/httpd-2.4.25.tar.bz2
--2017-04-14 10:28:47-- http://ftp.neowiz.com/apache/httpd/httpd-2.4.25.tar.bz2
Resolving ftp.neowiz.com... 122.152.116.24
Connecting to ftp.neowiz.com|122.152.116.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6398218 (6.1M) [application/x-bzip]
Saving to: “httpd-2.4.25.tar.bz2”
100%[=======================================================================>] 6,398,218 1.80M/s in 3.8s
2017-04-14 10:28:51 (1.61 MB/s) - “httpd-2.4.25.tar.bz2” saved [6398218/6398218]
[root@ 2017 src]# wget http://ftp.neowiz.com/apache/apr/apr-1.5.2.tar.bz2
--2017-04-14 10:28:55-- http://ftp.neowiz.com/apache/apr/apr-1.5.2.tar.bz2
Resolving ftp.neowiz.com... 122.152.116.24
Connecting to ftp.neowiz.com|122.152.116.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 826885 (808K) [application/x-bzip]
Saving to: “apr-1.5.2.tar.bz2”
100%[=======================================================================>] 826,885 943K/s in 0.9s
2017-04-14 10:28:56 (943 KB/s) - “apr-1.5.2.tar.bz2” saved [826885/826885]
[root@ 2017 src]# wget http://ftp.neowiz.com/apache/apr/apr-util-1.5.4.tar.bz2
--2017-04-14 10:29:01-- http://ftp.neowiz.com/apache/apr/apr-util-1.5.4.tar.bz2
Resolving ftp.neowiz.com... 122.152.116.24
Connecting to ftp.neowiz.com|122.152.116.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 694427 (678K) [application/x-bzip]
Saving to: “apr-util-1.5.4.tar.bz2”
100%[=======================================================================>] 694,427 1.35M/s in 0.5s
2017-04-14 10:29:01 (1.35 MB/s) - “apr-util-1.5.4.tar.bz2” saved [694427/694427]
[root@2017 src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2
--2017-04-14 10:29:05-- http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2 [following]
--2017-04-14 10:29:06-- https://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2
Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:df0:2ed:feed::feed
Connecting to jaist.dl.sourceforge.net|150.65.7.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1440869 (1.4M) [application/octet-stream]
Saving to: “pcre-8.33.tar.bz2”
100%[=======================================================================>] 1,440,869 1.61M/s in 0.9s
2017-04-14 10:29:07 (1.61 MB/s) - “pcre-8.33.tar.bz2” saved [1440869/1440869]
접기
5. /usr/local/src 여기서 다운로드 받은 것 확인 할 수 있다
6.압축해제
tar xvf apr-1.5.2.tar.bz2
tar xvf apr-util-1.5.4.tar.bz2
tar xvf httpd-2.4.25.tar.bz2
tar xvf pcre-8.33.tar.bz2
mv apr-1.5.2 ./httpd-2.4.25/srclib/apr
mv apr-util-1.5.4 ./httpd-2.4.25/srclib/apr-util
더보기 접기
########################################################################################
[root@ 2017 src]# ll
total 9156
-rw-r--r--. 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2
-rw-r--r--. 1 root root 694427 Sep 20 2014 apr-util-1.5.4.tar.bz2
drwxr-xr-x. 11 501 games 4096 Dec 17 03:24 httpd-2.4.25
-rw-r--r--. 1 root root 6398218 Dec 20 02:29 httpd-2.4.25.tar.bz2
drwxr-xr-x. 7 1169 1169 4096 May 28 2013 pcre-8.33
-rw-r--r--. 1 root root 1440869 May 30 2013 pcre-8.33.tar.bz2
########################################################################################
접기
7. pcre 설치[편집]
cd /usr/local/src/pcre-8.33
./configure
make
make install
8. 아파치 설치
cd /usr/local/src/httpd-2.4.20 -> 난 cd /usr/local/src/httpd-2.4.25
./configure --prefix=/usr/local/apache2
*configure: error: Cannot use an external APR-util with the bundled APR 오류 발생하면[2] ./configure --prefix=/usr/local/httpd --with-included-apr를 해보자.
make
make install
9. 아파치 시작을 해야 하는데
/usr/local/apache2/bin/httpd -k start 이렇게 따라하면 폴더가 없다고 나온다.
실제로도 없고.
*configure: error: Cannot use an external APR-util with the bundled APR 오류 발생하면[2] ./configure --prefix=/usr/local/httpd --with-included-apr를 해보자.
이렇게 했기 때문인 것같고..
/usr/local/httpd/bin/httpd -k start 로 해보려고 한다.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using kpa2017.cafe24.com. Set the 'ServerName' directive globally to suppress this message
에러남
/usr/local/httpd/conf/httpd.conf 이 파일 열어서
ServerName localhost:80 이거 추가함
더보기 접기
########################################################################################
[root@ 2017 httpd-2.4.25]# /usr/local/httpd/bin/httpd -k start
httpd (pid 21347) already running
[root@ 2017 httpd-2.4.25]# ps -ef | grep httpd | grep -v grep
root 21347 1 0 10:51 ? 00:00:00 /usr/local/httpd/bin/httpd -k start
daemon 21348 21347 0 10:51 ? 00:00:00 /usr/local/httpd/bin/httpd -k start
daemon 21349 21347 0 10:51 ? 00:00:00 /usr/local/httpd/bin/httpd -k start
daemon 21377 21347 0 10:51 ? 00:00:00 /usr/local/httpd/bin/httpd -k start
[root@ 2017 httpd-2.4.25]# netstat -anp | grep httpd
tcp 0 0 :::80 :::* LISTEN 21347/httpd
[root@ 2017 httpd-2.4.25]# curl http://127.0.0.1
<html><body><h1>It works!</h1></body></html>
########################################################################################
접기 결국 http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%B5%9C%EC%8B%A0%EB%B2%84%EC%A0%84_%EC%84%A4%EC%B9%98_(%EC%BB%B4%ED%8C%8C%EC%9D%BC ) 여기 다 따라함
확인하기
[root@2017 httpd-2.4.25]# /usr/local/httpd/bin/httpd -V
더보기 접기
[root@2017 httpd-2.4.25]# /usr/local/httpd/bin/httpd -V
Server version: Apache/2.4.25 (Unix)
Server built: Apr 14 2017 10:41:42
Server's Module Magic Number: 20120211:67
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr/local/httpd"
-D SUEXEC_BIN="/usr/local/httpd/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
접기
서버 접속해보면 It works! 뜸