-
WEB/WAS Apache Web Application Server 설치Programming and Database/Web And Web Application Server 2024. 6. 27. 00:04728x90반응형
▣ WEB/WAS Apache 설치하는 방법
[root@Apache ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.9 (Maipo)
▶ 웹서비스 구동을 위한 Apache 설치 전에 설치 환경의 운영체제 버전을 확인합니다.
[root@Apache ~]# yum install libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel pcre-devel acc make 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. Localrepo_High | 2.8 kB 00:00:00 RHEL7_Localrepo | 2.8 kB 00:00:00 Package libjpeg-turbo-1.2.90-8.el7.x86_64 already installed and latest version Package 2:libpng-1.5.13-8.el7.x86_64 already installed and latest version Package 2:libpng-devel-1.5.13-8.el7.x86_64 already installed and latest version Package freetype-2.8-14.el7.x86_64 already installed and latest version Package freetype-devel-2.8-14.el7.x86_64 already installed and latest version Package gd-2.0.35-26.el7.x86_64 already installed and latest version Package gcc-4.8.5-44.el7.x86_64 already installed and latest version Package gcc-c++-4.8.5-44.el7.x86_64 already installed and latest version Package pcre-devel-8.32-17.el7.x86_64 already installed and latest version No package acc available. Package 1:make-3.82-24.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package gdbm-devel.x86_64 0:1.10-8.el7 will be installed ---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7 will be installed ---> Package libpng12.x86_64 0:1.2.50-10.el7 will be installed ---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================== Package Arch Version Repository Size ================================================================================================== Installing: gdbm-devel x86_64 1.10-8.el7 RHEL7_Localrepo 47 k libjpeg-turbo-devel x86_64 1.2.90-8.el7 RHEL7_Localrepo 99 k libpng12 x86_64 1.2.50-10.el7 RHEL7_Localrepo 171 k ncurses-devel x86_64 5.9-14.20130511.el7_4 RHEL7_Localrepo 713 k Transaction Summary ================================================================================================== Install 4 Packages Total download size: 1.0 M Installed size: 3.1 M Is this ok [y/d/N]: y Downloading packages: -------------------------------------------------------------------------------------------------- Total 15 MB/s | 1.0 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libpng12-1.2.50-10.el7.x86_64 1/4 Installing : libjpeg-turbo-devel-1.2.90-8.el7.x86_64 2/4 Installing : ncurses-devel-5.9-14.20130511.el7_4.x86_64 3/4 Installing : gdbm-devel-1.10-8.el7.x86_64 4/4 Verifying : gdbm-devel-1.10-8.el7.x86_64 1/4 Verifying : ncurses-devel-5.9-14.20130511.el7_4.x86_64 2/4 Verifying : libjpeg-turbo-devel-1.2.90-8.el7.x86_64 3/4 Verifying : libpng12-1.2.50-10.el7.x86_64 4/4 Installed: gdbm-devel.x86_64 0:1.10-8.el7 libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7 libpng12.x86_64 0:1.2.50-10.el7 ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 Complete!
▶ 웹서비스 구축을 위한 필요 패키지를 모두 yum 명령어를 통해서 설치하도록 합니다.
설치 대상(libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel pcre-devel acc make)[root@Apache ~]# yum install -y 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. Resolving Dependencies --> Running transaction check ---> Package httpd.x86_64 0:2.4.6-95.el7 will be installed --> Processing Dependency: httpd-tools = 2.4.6-95.el7 for package: httpd-2.4.6-95.el7.x86_64 --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.x86_64 --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.x86_64 --> Running transaction check ---> Package apr.x86_64 0:1.4.8-7.el7 will be installed ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed ---> Package httpd-tools.x86_64 0:2.4.6-95.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================== Package Arch Version Repository Size ================================================================================================== Installing: httpd x86_64 2.4.6-95.el7 RHEL7_Localrepo 1.2 M Installing for dependencies: apr x86_64 1.4.8-7.el7 RHEL7_Localrepo 104 k apr-util x86_64 1.5.2-6.el7 RHEL7_Localrepo 92 k httpd-tools x86_64 2.4.6-95.el7 RHEL7_Localrepo 93 k Transaction Summary ================================================================================================== Install 1 Package (+3 Dependent packages) Total download size: 1.5 M Installed size: 4.3 M Downloading packages: -------------------------------------------------------------------------------------------------- Total 28 MB/s | 1.5 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : apr-1.4.8-7.el7.x86_64 1/4 Installing : apr-util-1.5.2-6.el7.x86_64 2/4 Installing : httpd-tools-2.4.6-95.el7.x86_64 3/4 Installing : httpd-2.4.6-95.el7.x86_64 4/4 Verifying : httpd-tools-2.4.6-95.el7.x86_64 1/4 Verifying : apr-1.4.8-7.el7.x86_64 2/4 Verifying : httpd-2.4.6-95.el7.x86_64 3/4 Verifying : apr-util-1.5.2-6.el7.x86_64 4/4 Installed: httpd.x86_64 0:2.4.6-95.el7 Dependency Installed: apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-95.el7 Complete!
▶ yum install -y httpd 명령어를 통해서 httpd 데몬 서비스 패키지를 설치합니다.
[root@Apache ~]# httpd -v Server version: Apache/2.4.6 (Red Hat Enterprise Linux) Server built: Apr 21 2020 10:19:09
▶ httpd -v 명령어를 통해서 현재 httpd 즉 Apache의 버전이 2.4.6 인 것을 확인할 수 있습니다.
[root@Apache ~]# apachectl -v Server version: Apache/2.4.6 (Red Hat Enterprise Linux) Server built: Apr 21 2020 10:19:09
▶ apachectl -v 명령어를 통해서 현재 apache의 버전이 2.4.6 인것을 확인할 수 있습니다.
[root@Apache ~]# systemctl start httpd [root@Apache ~]# systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
▶ 웹서비스 작동을 위해서 httpd 데몬을 활성화 합니다. 추가적으로 데몬 활성화 후에 방화벽을 사용한다면 80 포트를 포트에 추가해줘야 합니다.
[root@Apache ~]# systemctl status httpd * httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2023-11-08 17:02:30 KST; 14s ago Docs: man:httpd(8) man:apachectl(8) Main PID: 23772 (httpd) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service |-23772 /usr/sbin/httpd -DFOREGROUND |-23774 /usr/sbin/httpd -DFOREGROUND |-23775 /usr/sbin/httpd -DFOREGROUND |-23776 /usr/sbin/httpd -DFOREGROUND |-23777 /usr/sbin/httpd -DFOREGROUND `-23778 /usr/sbin/httpd -DFOREGROUND Nov 08 17:02:30 Apache systemd[1]: Starting The Apache HTTP Server... Nov 08 17:02:30 Apache httpd[23772]: AH00558: httpd: Could not reliably determine the serve...age Nov 08 17:02:30 Apache systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full.
▶ httpd 서비스를 기동 후 정상적으로 기동 되었는지 확인합니다.
[root@Apache ~]# curl -i localhost:80 HTTP/1.1 200 OK Date: Wed, 08 Nov 2023 08:03:28 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) Last-Modified: Tue, 21 Apr 2020 14:17:39 GMT ETag: "f91-5a3cdad8ee6c0" Accept-Ranges: bytes Content-Length: 3985 Content-Type: text/html; charset=UTF-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Test Page for the Apache HTTP Server on Red Hat Enterprise Linux</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> /*<![CDATA[*/ body { background-color: #fff; color: #000; font-size: 0.9em; font-family: sans-serif,helvetica; margin: 0; padding: 0; } :link { color: #c00; } :visited { color: #c00; } a:hover { color: #f50; } h1 { text-align: center; margin: 0; padding: 0.6em 2em 0.4em; background-color: #900; color: #fff; font-weight: normal; font-size: 1.75em; border-bottom: 2px solid #000; } h1 strong { font-weight: bold; } h2 { font-size: 1.1em; font-weight: bold; } hr { display: none; } .content { padding: 1em 5em; } .content-columns { /* Setting relative positioning allows for absolute positioning for sub-classes */ position: relative; padding-top: 1em; } .content-column-left { /* Value for IE/Win; will be overwritten for other browsers */ width: 47%; padding-right: 3%; float: left; padding-bottom: 2em; } .content-column-left hr { display: none; } .content-column-right { /* Values for IE/Win; will be overwritten for other browsers */ width: 47%; padding-left: 3%; float: left; padding-bottom: 2em; } .content-columns>.content-column-left, .content-columns>.content-column-right { /* Non-IE/Win */ } img { border: 2px solid #fff; padding: 2px; margin: 2px; } a:hover img { border: 2px solid #f50; } /*]]>*/ </style> </head> <body> <h1>Red Hat Enterprise Linux <strong>Test Page</strong></h1> <div class="content"> <div class="content-middle"> <p>This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page, it means that the Apache HTTP server installed at this site is working properly.</p> </div> <hr /> <div class="content-columns"> <div class="content-column-left"> <h2>If you are a member of the general public:</h2> <p>The fact that you are seeing this page indicates that the website you just visited is either experiencing problems, or is undergoing routine maintenance.</p> <p>If you would like to let the administrators of this website know that you've seen this page instead of the page you expected, you should send them e-mail. In general, mail sent to the name "webmaster" and directed to the website's domain should reach the appropriate person.</p> <p>For example, if you experienced problems while visiting www.example.com, you should send e-mail to "webmaster@example.com".</p> <p>For information on Red Hat Enterprise Linux, please visit the <a href="http://www.redhat.com/">Red Hat, Inc. website</a>. The documentation for Red Hat Enterprise Linux is <a href="http://www.redhat.com/docs/manuals/enterprise/">available on the Red Hat, Inc. website</a>.</p> <hr /> </div> <div class="content-column-right"> <h2>If you are the website administrator:</h2> <p>You may now add content to the directory <tt>/var/www/html/</tt>. Note that until you do so, people visiting your website will see this page, and not your content. To prevent this page from ever being used, follow the instructions in the file <tt>/etc/httpd/conf.d/welcome.conf</tt>.</p> <p>You are free to use the image below on web sites powered by the Apache HTTP Server:</p> <p align="center"><a href="http://httpd.apache.org/"><img src="/icons/apache_pb2.gif" alt="[ Powered by Apache ]"/></a></p> </div> </div> </div> </body> </html>
▶ curl -i localhost:80 명령어를 통해서 자기 자신의 IP의 WEB 서비스 기동되는지 홈페이지를 들어가지 않고 확인이 가능합니다.
PS. 포스팅의 내용은 제 기준으로 작성한 것이기 때문에 참고해서 보시면 감사하겠습니다.
포스팅 과정의 오류 및 오타 그리고 궁금한 점에 대해서는 댓글 남겨주세요.
728x90반응형'Programming and Database > Web And Web Application Server' 카테고리의 다른 글
WEB/WAS Tmax WebtoB 설치하는 방법(2) (116) 2024.06.26 WEB/WAS Tmax WebtoB 설치하는 방법(1) (130) 2024.06.25