Web
25 02 2021
Haeng Ho Kang | OS, Server, Linux/Unix, Web
root권한으로 실행합니다. 1.필수 라이브러리 설치
|
[root@hae app]# yum install gcc gcc-c++ expat-devel.x86_64 pcre-devel |
3.apr, apr-util, pcre,httpd 다운로드 및 컴파일
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 31 32 33 34 35
|
[root@hae install]# wget http://mirror.apache-kr.org/httpd/httpd-2.4.46.tar.gz [root@hae install]# wget http://mirror.apache-kr.org/apr/apr-1.7.0.tar.gz [root@hae install]# wget http://mirror.apache-kr.org/apr/apr-util-1.6.1.tar.gz [root@hae install]# wget https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.gz [root@hae install]# tar zxvf apr-1.7.0.tar.gz [root@hae install]# tar zxvf apr-util-1.6.1.tar.gz [root@hae install]# tar zxvf httpd-2.4.46.tar.gz [root@hae install]# tar zxvf pcre-8.44.tar.gz [root@hae install]# mv apr-1.7.0 apr-util-1.6.1 pcre-8.44 httpd-2.4.46 /usr/local/src [root@hae install]# cd /usr/local/src/ [root@hae src]# ls apr-1.7.0 apr-util-1.6.1 pcre-8.44 - apr install [root@hae src]# cd apr-1.7.0/ [root@hae apr-1.7.0]# ./configure --prefix=/usr/local/src/apr-1.7.0 [root@hae apr-1.7.0]# make && make install - apr-util install [root@hae src]# cd apr-util-1.6.1/ [root@hae apr-util-1.6.1]# ./configure --prefix=/usr/local/src/apr-util-1.6.1 --with-apr=/usr/local/src/apr-1.7.0 [root@hae apr-util-1.6.1]# make && make install - pcre install [root@hae src]# cd pcre-8.44/ [root@hae pcre-8.44]# ./configure --prefix=/usr/local/src/apr-util-1.6.1 --with-apr=/usr/local/src/apr-1.7.0 [root@hae pcre-8.44]# make && make install - apache install [root@hae src]# cd httpd-2.4.46/ [root@hae httpd-2.4.46]#./configure --prefix=/app/web/apache2 --enable-so --enable-rewrite --enable-proxy --enable-ssl --enable-mods-shared=all --enable-modules=shared --with-apr=/usr/local/src/apr-1.7.0 --with-apr-util=/usr/local/src/apr-util-1.6.1 [root@hae httpd-2.4.46]# make && make install |
작동확인 [root@hae bin]# cd /app/web/apache2/bin [root@hae bin]# ./apachectl start [root@hae bin]# netstat -tulpn | grep LISTEN tcp 0 0 0.0.0.0:7990 0.0.0.0:* LISTEN 9188/ssh tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1001/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1595/master tcp 0 0 0.0.0.0:3389 […]
19 02 2021
Haeng Ho Kang | OS, Server, Linux/Unix, Web
1) yum install httpd 2) 확인 [root@hae sbin]# httpd -version Server version: Apache/2.4.6 (CentOS) Server built: Nov 16 2020 16:18:20 3) 방화벽설정 [root@hae sbin]# firewall-cmd – -state running [root@hae conf]# firewall-cmd – -permanent – -add-service=http success [root@hae conf]# firewall-cmd – -permanent – -add-service=https success [root@hae conf]# firewall-cmd – -reload success [root@hae conf]# systemctl enable httpd […]
12 03 2020
1. 아파치 설정값 확인 ./apachectl -V 환경 Linux apache 2.2.19 MPM은 Prefork 방식 참고 : MPM prefork 방식은 프로세스:쓰레드 = 1:1 방식 Worker 방식은 프로세스:쓰레드 = 1:n 방식 아파치 컴파일된 셋팅값 조회 # /usr/local/apache/bin/apachectl -V 설정 Httpd.conf 에서 /conf/extra/httpd-mpm.conf 을 Include 처리 (리마크 제외) 하고 Httpd-mpm.conf 파일을 열고 지시자 변경
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 31
|
[root@web1 bin]# ./apachectl -V Server version: Apache/2.4.37 (Unix) Server built: Dec 20 2018 17:37:42 Server's Module Magic Number: 20120211:83 Server loaded: APR 1.6.5, APR-UTIL 1.6.1 Compiled using: APR 1.6.5, APR-UTIL 1.6.1 Architecture: 64-bit Server MPM: <strong> event</strong> 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="/opt/web/apache2" -D SUEXEC_BIN="/opt/web/apache2/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" |
위의 MPM방법은 event 방식이다 여기에 맞는 설정값을 변경해야 한다. MaxRequestWorkers 을 변경한다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#<IfModule mpm_event_module> # StartServers 3 # MinSpareThreads 75 # MaxSpareThreads 250 # ThreadsPerChild 25 # MaxRequestWorkers 400 # MaxConnectionsPerChild 0 #</IfModule> <IfModule mpm_event_module> StartServers 8 ServerLimit 16 MinSpareThreads 64 MaxSpareThreads 256 ThreadsPerChild 64 <strong>MaxRequestWorkers 1024</strong> MaxConnectionsPerChild 0 </IfModule> |
2.Tomcat 의 경우 Server.xml에 maxThreads를 확인해서 숫자를 늘린다.
16 11 2016
Haeng Ho Kang | OS, Server, Linux/Unix, Web |
설치된 OS버젼을 확인
|
root@dev_was [/opt/hpws]# swlist -l bundle QPKBASE # Initializing... # Contacting target "dev_was"... # # Target: dev_was:/ # QPKBASE B.11.31.1603.421a Base Quality Pack Bundle for HP-UX 11i v3, March 2016 |
개별 환경 변수 설정의 경우는 cd ~ 해당 홈디렉토리 의 vi .profile 예 저장하시면 되구요 전체 공용 계정별 환경변수 저장은 vi /etc/profile에 설정 하면됩니다. 다운로드 https://h20392.www2.hp.com/portal/swdepot/displayProductsList.do?category=NSM 설치하기
|
root@dev_was [/tmp]# swinstall -s ./HP_UX_11.31_HPUXWS22ATW-B408-11-31-64.depot |
설치선택화면 설치선택완료화면(선택하고 Actions>Mark for Install 그다음 Actions>install하면 설치합니다. 설치중 화면 대화형 창이 뜨면 Space Bar로 apache를 선택 2)위의 명령어로 설치하면
|
root@dev_was [/opt/hpws22]# pwd /opt/hpws22 root@dev_was [/opt/hpws22]# ls -al total 112 drwxr-xr-x 8 bin bin 8192 Jul 16 2015 . dr-xr-xr-x 93 bin bin 8192 Nov 16 13:56 .. drwxr-xr-x 2 bin bin 96 Nov 16 15:46 LICENSES -r--r--r-- 1 bin bin 3853 Dec 16 2008 README drwxr-xr-x 22 bin bin 8192 Jul 16 2015 apache drwxr-xr-x 8 bin bin 8192 Nov 16 15:46 hp_docs drwxr-xr-x 13 bin bin 8192 Nov 16 15:46 tomcat dr-xr-xr-x 2 bin bin 96 Jul 16 2015 util drwxr-xr-x 19 bin bin 8192 Jul 16 2015 webmin |
위에서 […]
5 08 2016
Haeng Ho Kang | Server, Web |
1.아파치를 다운받는다. http://httpd.apache.org/download.cgi 아래는 설치 설명 URL http://httpd.apache.org/docs/current/platform/windows.html#down 64bit의 경우는 https://www.apachelounge.com/download/ 에서 다운받는다. 다운받은 폴더에 conf/httpd.conf 의 ServerRoot등의 경로가 c:\밑으로 되어있는데 현재 Apache서버의 경로로 바꿔주면 잘 실행됩니다. 2.mod_jk모듈을 다운받는다.(tomcat-connectors-1.2.40-windows-x86_64-httpd-2.4.x) mod_jk.so 를 다운받은후 apache/moules/밑으로 복사후 httpd.conf에서 LoadModule jk_module modules/mod_jk.so 추가한다. 하단에 # Mod_jk modules Include conf/mod_jk.conf 추가하고 3. 설정파일 : apache/conf/mod_jk.conf
|
JkWorkersFile "conf/workers.properties" JkLogFile "D:\server\logs\mod_jk.log" JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" JkRequestLogFormat "%w %V %T" JkMount /* loadbalancer |
4.설정파일: apache/conf/workers.properties
|
worker.list=worker1,worker2,loadbalancer worker.worker1.port=8009 worker.worker1.host=localhost worker.worker1.type=ajp13 worker.worker1.lbfactor=100 worker.worker2.port=18009 worker.worker2.host=localhost worker.worker2.type=ajp13 worker.worker2.lbfactor=100 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=worker1, worker2 worker.loadbalancer.sticky_session=1 |
[…]
7 01 2016
Haeng Ho Kang | Server, WAS, Web |
1)httpd.conf 설정 Include conf.d/mod_jk.conf # Virtual hosts Include conf/extra/httpd-vhosts.conf 2)/apache2/conf.d/ 안의파일 mod_jk.conf, uriworkermap.properties, workers.properties (1) mod_jk.conf
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 31 32 33 34 35 36 37 38 39
|
# Load mod_jk m odule # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf.d/workers.properties # Where to put jk logs #JkLogFile logs/mod_jk.log JkLogFile "| /web/apache2/bin/rotatelogs /web/apache2/logs/mod_jk.log.%Y%m%d 86400" # Set the jk log level [debug/error/info] #JkLogLevel debug #JkLogLevel info JkLogLevel error # Select the log form at JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE #JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkOptions +ForwardKeySize +ForwardURICompat +ForwardURICompatUnparsed -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications # The default setting only sends Java application data to mod_jk. # Use the commented-out line to send all URLs through mod_jk. # JkMount /* loadbalancer #JkMount /application/* loadbalancer #JkMountFile conf.d/uriworkermap.properties # Add sharedmemory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly JkShmFile logs/jk.shm |
(2)uriworkermap.properties
|
#/jkstatus=jkstatus #/jmx-console=loadbalancer #/jmx-console/*=loadbalancer #!/*.gif=loadbalancer #!/*.jpg=loadbalancer /=loadbalancer /*=loadbalancer |
(3)workers.properties
|
#worker.list=loadbalancer,jkstatus worker.list=aaa1,bbb1 worker.template.type=ajp13 worker.template.ping_mode=A worker.aaa1.reference=worker.template worker.aaa1.host=123.123.123.123 worker.aaa1.port=8109 worker.bbb1.reference=worker.template worker.bbb1.host=123.123.123.123 worker.bbb1.port=8209 |
3)httpd-vhosts.conf ServerAdmin webmaster@dummy-host.example.com DocumentRoot “/web/apache2/htdocs/aaa1” ServerName aaa1.nuriware.com ServerAlias aaa1.nuriware.com ErrorLog “| /web/apache2/bin/rotatelogs /web/apache2/logs/lms-error.log.%Y%m%d 86400” CustomLog “| /web/apache2/bin/rotatelogs /web/apache2/logs/lms-access.log.%Y%m%d 86400” common SetEnvIf Request_URI “/webimg/*” no-jk JkMount / aaa1 JkMount /* aaa1 ServerAdmin webmaster@dummy-host.example.com DocumentRoot “/web/apache2/htdocs/bbb1” […]
7 07 2015
Haeng Ho Kang | OS, Server, Linux/Unix, Web |
Nginx install 필수 라이브러리 sudo apt-get install gcc g++ make sudo apt-get install unzip apt-get install libpcre3-dev build-essential libssl-dev wget http://nginx.org/download/nginx-1.8.0.tar.gz PCRE NGINX는 Perl5에서 사용하는 정규표현식 라이브러리인 PCRE를 사용한다. 아래의 주소에서 다운로드 한다. 필자는 소스 다운로드 페이지를 경유해서 아래의 주소에서 가장 최신 버전의 파일을 다운 받았다. ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz tar xvf pcre-8.37.tar.gz openssl https 모듈인 […]
26 06 2015
Haeng Ho Kang | Server, WAS, Web |
#telnet localhost 포트 GET / 하면 반응이 옵니다.
24 06 2015
Haeng Ho Kang | OS, Server, Linux/Unix, Web |
설치할 폴더 /app/하위
|
mkdir /app cd /app mkdir install cd install |
다운로드(위치 install폴더)
|
wget http://apache.mirror.cdnetworks.com//httpd/httpd-2.4.12.tar.gz wget http://apache.mirror.cdnetworks.com/apr/apr-1.5.2.tar.gz wget http://apache.mirror.cdnetworks.com/apr/apr-util-1.5.4.tar.gz wget http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.35.tar.gz |
압축해제(위치install폴더)
|
tar -xvzf httpd-2.4.12.tar.gz tar -xvzf apr-1.5.2.tar.gz tar -xvzf apr-util-1.5.4.tar.gz tar -xvzf pcre-8.35.tar.gz |
APR관련 파일 Httpd/srclib로 이동
|
mv ./apr-1.5.2 ./httpd-2.4.12/srclib/apr mv ./apr-util-1.5.4 ./httpd-2.4.12/srclib/apr-util |
의존 Package Install
|
apt-get install libssl-dev |
|
apt-get install libpcre3-dev |
PCRE 설치구성
|
cd pcre-8.35 ./configure --enable-unicode-properties=yes |
make make install cd ../httpd-2.4.12
|
./configure \ --prefix=/app/httpd-2.4.12 \ --enable-so \ --enable-rewrite \ --enable-proxy \ --enable-ssl \ --enable-mods-shared=all \ --enable-modules=shared \ --enable-mpms-shared=all \ --with-included-apr \ --with-included-apr-util |
설치 확인
|
cd /app/httpd-2.4.12/bin/ |
|
root@ip-172-31-23-3:/app/httpd-2.4.12/bin# ps -ef|grep httpd root 9368 1 0 00:55 ? 00:00:00 /app/httpd-2.4.12/bin/httpd -k start daemon 9369 9368 0 00:55 ? 00:00:00 /app/httpd-2.4.12/bin/httpd -k start daemon 9370 9368 0 00:55 ? 00:00:00 /app/httpd-2.4.12/bin/httpd -k start daemon 9371 9368 0 00:55 ? 00:00:00 /app/httpd-2.4.12/bin/httpd -k start |
서비스 등록
|
cp /app/httpd-2.4.12/bin/apachectl /etc/init.d/httpd |
. /lib/lsb/init-functions 서비스에 올리기위해(chkconfig 와 거의 동일) 설치 apt-get install […]
Ubuntu, Apache
18 06 2015
Haeng Ho Kang | OS, Server, Linux/Unix, Web |
Linux Centos7: 참고 https://blog.bypass.kr/134 의존패키지 install
|
yum -y install gcc g++ cpp gcc-c++ make yum -y install pcre-devel yum -y install openssl openssl-devel yum -y install gd gd-devel |
현재 최신 안정화 버젼 Download wget http://nginx.org/download/nginx-1.8.0.tar.gz 압축해제 tar xvfz nginx-1.8.0.tar.gz cd nginx-1.8.0 Compile
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
|
./configure --prefix=/app/nginx \ --conf-path=/app/nginx/conf/nginx.conf \ --sbin-path=/app/nginx/sbin/nginx \ --lock-path=/var/lock/nginx.lock \ --pid-path=/var/run/nginx.pid \ --http-client-body-temp-path=/var/lib/nginx/body \ --http-proxy-temp-path=/var/lib/nginx/proxy \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ --http-scgi-temp-path=/var/lib/nginx/scgi \ --http-log-path=/app/nginx/log/access.log \ --error-log-path=/app/nginx/log/error.log \ --with-http_addition_module \ --with-http_degradation_module \ --with-http_flv_module \ --with-http_gzip_static_module \ --with-http_image_filter_module \ --with-http_mp4_module \ --with-http_random_index_module \ --with-http_realip_module \ --with-http_ssl_module \ --with-http_stub_status_module \ --with-http_sub_module \ --with-http_realip_module \ --user=nobody \ --group=nobody |
Install
Nginx 실행시 필요한 폴더 생성
서비스(Service)등록
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
#!/bin/sh # # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /app/nginx/conf/nginx.conf # pidfile: /var/run/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/app/nginx/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/app/nginx/conf/nginx.conf" lockfile=/var/lock/nginx.lock start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest || return $? stop start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } force_reload() { restart } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2 esac |
|
chmod +x /etc/init.d/nginx |
자동실행될수 있게
확인
시작/종료/재시작
|
service nginx start/stop/restart |
참고 1.http://blog.beany.co.kr/archives/2422 2.https://www.digitalocean.com/community/tutorials/how-to-compile-nginx-from-source-on-a-centos-6-4-x64-vps