document 가 많은 ubuntu를 사용하고 

apt-get을 이용한 apache2를 설치할수도 있는데 알고있으면 쉽겠지만 어디든 자동으로 설정파일들이 생성되고 이러는게 짜증나서.

소스코드로 apache를 설치해보려고 한다.


우선 google에 apache httpd download를 치면 

https://httpd.apache.org/download.cgi


apache 사이트가나오는데  이글쓸때 기준 가장 최신버전으로설치를 해보려고한다.

Apache HTTP Server 2.4.25 (httpd): 2.4.25 is the latest available version 2016-12-20




tar.gz 부분 링크주소 복사를한뒤


wget http://mirror.navercorp.com/apache//httpd/httpd-2.4.25.tar.gz 을 하면 

다운받는다 원하는곳에 풀고 


configure 실행


root@/env/httpd-2.4.25# ./configure 

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure: 

configure: Configuring Apache Portable Runtime library...

configure: 

checking for APR... no

configure: error: APR not found.  Please read the documentation.

root@/env/httpd-2.4.25# 



APR 이없다고 하고 document를 읽어보라고 하네요.
document를 열고 find 로 찾아봤자 없네요 commnet 부분에 누가 써놓은게 다인데 아 apache document 발로만들었나



구글신에게 물어보니 apache configure apr not found

바로 나오네요 




APR lib 를 설치해야하네요.

에효 뭐 깔게이리많은지

https://apr.apache.org/download.cgi


APR 과 APR-util을 이용해서 설치합니다.

각각 파일을 다운받은뒤

configure

make 

make install합니다.


APR-UTIL을 configure 할때는

./configure --with-apr=/env/apr-1.5.2


apr 설치 했는 폴더경로를 줘야하네요

이제 드뎌 설치하나했더니



configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


찾아보니 pcre-config 를 설치해야합니다.

ubuntu 에서는


apt-get install libpcre3-dev


./configure --prefix=설치경로


make


make install 


하면 끝


cd 설치경로/bin

httpd -k start 


http://ip주소 브라우저에서 입력하시면 

it works 확인하실수있습니다.







Posted by App.SHIN
:

로컬에서는 한번만 실행하면 되는데 linux 서버에 올리면 두번이 실행되었다.

왜그런지 블로그 다른글을 찾아보니 원인이 잘정리 되어있는듯 하지만 무슨말인지 이해하기가 힘들었다.


http://blog.ajkuhn.com/116

블로그내용을 보니 아래와같은 내용이 있었다.

Tomcat에서 동일한 Web Application Context 두 개가 뜬다한들 작동에는 별 문제가 없을 것이다. 둘의 ContextPath가 다르다면 말이다. 위의 경우 Host에서는 "test"라는 ContextPath로 webapp가 떴을 것이고, Context에서는 지정한대로 ""(=루트) ContextPath로 떴으니 아무런 문제가 없었던 건이다.

여튼 Tomcat설정시 Host의 appBase위에 Context로 설정할 app를 올리지 말아야한다. 이는 의도하지않은 작동을 야기한다. 본인은 다양한 이유로 appBase의 위치를 바꾸는 방법을 택했다.


이해가안가서 영문으로된걸로 찾아보니 스택오버플로우에 완전히 잘정리된 글이있었다.

http://stackoverflow.com/questions/7223108/quartz-job-runs-twice-when-deployed-on-tomcat-6-ubuntu-10-04lts

When using automatic deployment, the docBase defined by an XML Context file should be outside of the appBase directory. If this is not the case, difficulties may be experienced deploying the web application or the application may be deployed twice. The deployIgnore attribute can be used to avoid this situation.

Finally, note that if you are defining contexts explicitly in server.xml, you should probably turn off automatic application deployment or specify deployIgnore carefully. Otherwise, the web applications will each be deployed twice, and that may cause problems for the applications.


해결책은 


1.위에분과같이 톰켓 host 설정의 appBase를 바꾸는 방법과



2.  오토디플로이 옵션과 , 디플로이온 스탈트업을 끄는 방법이있다.

<Host name="localhost" 
        deployOnStartup="false"  
        appBase="webapps" 
        unpackWARs="false" 
        autoDeploy="false">

2번에 관해정리된곳이 없는거같아 글을 써본다.

구글봇이 잘긁어갔으면 좋겠다.

'서버' 카테고리의 다른 글

[ubuntu] apache 서버 소스코드 설치  (0) 2017.04.10
Posted by App.SHIN
:

BLOG main image
by App.SHIN

공지사항

카테고리

분류 전체보기 (27)
안드로이드 (12)
추천앱 (0)
맛집 (0)
영화 (0)
핫이슈 (2)
서버 (2)
mac os 적응기 (8)
java (1)
mysql (1)
tomcat (1)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Total :
Today : Yesterday :