All Category

공개범위 설정
Table
   
기본채널
Table
   
카테고리
Table
   
공개범위
[전체]전체 공개
Table
   
위치정보
[전체]나만 보기
Table
   
다운로드
[전체]로그인 공개
Table
   
슬라이드
Table
   
시작고정
Table
   
사진정보
0
Date: 2021-03-25
2021
March
25

[3]. WEB/WAS Server 구성 - 1. (WEB) Apache Web Server





[3]. WEB/WAS Server 구성 - 1. (WEB) Apache Web Server







(1). Web Server의 종류

  • Apache Web Server : 아파치 HTTP 서버(영어: Apache HTTP Server)는 아파치 소프트웨어 재단에서 관리하는 HTTP 웹 서버이다. BSD, 리눅스 등 유닉스 계열 뿐 아니라 마이크로소프트 윈도우나 노벨 넷웨어 같은 기종에서도 운용할 수 있다.
  • Nginx            : Nginx(엔진 X)는 웹 서버 소프트웨어로, 가벼움과 높은 성능을 목표로 한다. 웹 서버, 리버스 프록시 및 메일 프록시 기능을 가진다
  • Google Web Server  : 구글 웹 서버(Google Web Server, GWS)는 구글이 자사의 웹 서비스에 사용하고있는 웹 서버 소프트웨어의 이름이다.
  • IIS             : 마이크로소프트 인터넷 정보 서비스(Internet Information Services, IIS)는 마이크로소프트 윈도우를 사용하는 서버들을 위한 인터넷 기반 서비스들의 모임이다. 이전 이름은 인터넷 정보 서버(Internet Information Server)였다.
  • WebtoB : 웹투비(WebtoB)는 티맥스소프트사의 웹 서버 제품이다. 대규모 트랜잭션 처리에 적합하도록 설계되어 처리속도 지연, 서버 장애 등의 웹 시스템상의 문제점을 해결하는 아키텍처로 설계되었다.
  • Lighttpd          : 2003년 독일의 MySQL 개발자인 Jan Kneschke는 빠른 속도를 위해서 단일 스레드와 비블러킹(non-blocking) I/O를 가진 단일 프로세스로서 lighttpd를 고안했다
  • LightSpeed         : LiteSpeed 웹 서버는 독점 웹 서버 소프트웨어입니다. 2020 년 12 월 현재 웹 사이트의 8.1 %가 사용하는 것으로 추정되는 4 번째로 인기있는 웹 서버입니다. LSWS는 비공개 LiteSpeed Technologies에서 개발했습니다
  • Mongoose          : (경량 웹서버)Mongoose는 크로스 플랫폼 내장 웹 서버 및 네트워킹 라이브러리입니다. 소프트웨어 설치 공간이 작기 때문에 인터넷에 연결된 모든 장치가 웹 서버로 작동 할 수 있습니다.
  • Node.js           : 자체 웹 서버를 내장하고 있다.


- 출처 : wikipedia.org





(2). Apache 설치 및 설정 하기

  • DSO(Dynamic Shared Object) - 동적으로 모듈을 적재

   - 아파치를 먼저 컴파일하고 다른 모듈들을 추가로 설치할 때는 아파치를 재 컴파일하지 않고 아파치에서 모듈을 동적으로 로드 한다. 즉, DSO방식은 아파치를 단 한번만 컴파일한다는 것이다.

  

  • SO(Static Object) - apache와 컴파일 해서 모듈을 적재

  - Static 방식은 설치면에서 추가로 모듈을 설치하려고 하면 설정하려는 모듈만 설정하고 컴파일하는 과정이 필요할 뿐만 아니라 아파치 또한 그에 따라 컴파일을 하여야 한다.

  

 예전에는 아파치에서 DSO를 지원 하지 않던 시절에는 APM(Apache + PHP + Mysql + Oracle + GD + IMAP + Tomcat + zlib + gif + jpeg + freetype + openssl)을 설치 하려면 원하는 모듈과 함께 아파치를 컴파일을 해야 한다.

 # ./configure --prefix=/www/httpd --with-mpm=prefork --enable-ssl --with-ssl=/www/openssl --enable-deflate --with-z=/www/zlib --enable-dav --enable-dav-fs --enable-auth-digest --enable-info --enable-rewrite --enable-vhost-alias --enable-expires --enable-mime-magic 
 # make 
 # make install 

 이런식으로 컴파일 설치를 해야했다. 컴파일 오류가 발생하면 밤샘 하면서 빌드하고, clean 하고 다시 빌드하고를 반복했던 기억이 ㅜ.ㅜ ....

  


 아무튼 요증음 그런 수고를 할필요는 없다 아파치에서 DSO(Dynamic Shared Object)를 지원하면서 부터는 /etc/httpd/conf/httpd.conf 에서 해당 모듈 추가만 하면 된다.

LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule socache_dbm_module modules/mod_socache_dbm.so
LoadModule socache_memcache_module modules/mod_socache_memcache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule status_module modules/mod_status.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule version_module modules/mod_version.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule security2_module modules/mod_security2.so








1. 설치 (yum)

[root@localhost ~]# yum -y install httpd
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
ISO-repository                                                                                                  | 4.1 kB 00:00:00   
epel/x86_64/metalink                                                                                            | 3.1 kB 00:00:00   
epel                                                                                                            | 4.7 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-93.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-67.el7.x86_64 for package: httpd-2.4.6-67.el7.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-67.el7.x86_64 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================
 Package           Arch          Version                Repository      Size
=====================================================================================================================
Installing:
 httpd            x86_64         2.4.6-67.el7.x86_64    epel            2.7 M
Installing for dependencies:
 httpd-tools      x86_64         2.4.6-67.el7.x86_64    epel            92 k

Transaction Summary
=====================================================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 2.8 M
Installed size: 9.5 M
Downloading packages:
(1/2): httpd-tools-2.4.6-67.el7.x86_64.x86_64.rpm                       | 92 kB 00:00:00
(2/2): httpd-2.4.6-67.el7.x86_64.rpm                                    | 2.7 MB 00:00:00
---------------------------------------------------------------------------------------------------------------------
Total                                                          5.8 MB/s | 2.8 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : httpd-tools-2.4.6-67.el7.x86_64                   1/2
 Installing : httpd-2.4.6-67.el7.x86_64                         2/2
 Verifying : httpd-tools-2.4.6-67.el7.x86_64                    1/2
 Verifying : httpd-2.4.6-67.el7.x86_64                          2/2

Installed:
 httpd.x86_64 0:2.4.6-67.el7.x86_64

Dependency Installed:
 httpd-tools.x86_64 0:2.4.6-67.el7.x86_64

Complete!



2. Apache 데몬 시작

[root@localhost etc]# systemctl start httpd



3. Apache 상태 확인

[root@localhost ~]# systemctl status httpd
 httpd.service - The Apache HTTP Server
  Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Active: active (running) since  2021-03-09 11:39:43 KST; 2 weeks 2 days ago
   Docs: man:httpd(8)
      man:apachectl(8)
 Process: 28100 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 3759 (httpd)
  Status: "Total requests: 0; Current requests/sec: 0; Current traffic:  0 B/sec"
  CGroup: /system.slice/httpd.service
      ├─ 3759 /usr/sbin/httpd -DFOREGROUND
      ├─ 3765 /usr/libexec/nss_pcache 753679 off
      ├─ 8283 /usr/sbin/httpd -DFOREGROUND
      ├─ 8339 /usr/sbin/httpd -DFOREGROUND
      ├─ 8340 /usr/sbin/httpd -DFOREGROUND
      ├─10274 /usr/sbin/httpd -DFOREGROUND
      ├─10275 /usr/sbin/httpd -DFOREGROUND
      ├─10667 /usr/sbin/httpd -DFOREGROUND
      ├─18688 /usr/sbin/httpd -DFOREGROUND
      ├─27975 /usr/sbin/httpd -DFOREGROUND
      ├─28137 /usr/sbin/httpd -DFOREGROUND
      ├─28138 /usr/sbin/httpd -DFOREGROUND
      ├─29000 /usr/sbin/httpd -DFOREGROUND
      └─29888 /usr/sbin/httpd -DFOREGROUND

 3 09 11:39:42 localhost systemd[1]: Starting The Apache HTTP Server...
 3 09 11:39:43 localhost systemd[1]: Started The Apache HTTP Server.
 3 15 03:32:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 15 03:32:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 15 03:32:02 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 20 03:45:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 21 03:37:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 21 03:37:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 21 03:37:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
 3 23 03:29:01 localhost systemd[1]: Reloaded The Apache HTTP Server.
[root@localhost ~]







(3). Apache 기본 설정


- apache 설정 파일 : /etc/httpd/conf/httpd.conf


1. ServerRoot 설정

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "/etc/httpd"


2. Listen 포트

#
# 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 12.34.56.78:80
Listen 80


3. ServerName 설정

#
# 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 www.example.com:80
ServerName 127.0.0.1




4. Directory Access 설정

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
  AllowOverride none
  Require all denied

  #Options FollowSymLinks
  #AllowOverride None
</Directory>


 

5. DocumentRoot 설정

#
# 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 "/var/www/html"

 


6. Directory Access 설정

# Further relax access to the default document root:
<Directory "/var/www/html">
  #
  # Possible values for the Options directive are "None", "All",
  # or any combination of:
  #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  #
  # Note that "MultiViews" must be named *explicitly* --- "Options All"
  # doesn't give it to you.
  #
  # The Options directive is both complicated and important. Please see
  # http://httpd.apache.org/docs/2.4/mod/core.html#options
  # for more information.
  #
  Options Indexes FollowSymLinks

  #
  # AllowOverride controls what directives may be placed in .htaccess files.
  # It can be "All", "None", or any combination of the keywords:
  #  Options FileInfo AuthConfig Limit
  #
  AllowOverride None

  #
  # Controls who can get stuff from this server.
  #
</Directory>




7. 시작 페이지 작성

<html>
  <head>
  </head>
  <body>
    This is a test page......
  </body>
</html>

- 접속 확인 : http://localhost:80




8. 아파치 시작/종료

[root@localhost etc]# systemctl start httpd   # 아파치 데몬 시작


[root@localhost etc]# systemctl stop httpd    # 아파치 데몬 종료


[root@localhost etc]# systemctl status httpd   # 아파치 데몬 상태















URL : http://www.epari.net/@architecture/vlink/b/b4
목록
도움이 되는 유익한 내용이었다면 힘이 될 수 있는 댓 글을 남겨주세요.
4
0
  • 뎃글달기
Upload
v
Name Type Size