nonneng.ee
Daeun-rithm
nonneng.ee
전체 방문자
오늘
어제
  • 분류 전체보기 (51)
    • Back-end (17)
      • Server (3)
      • Database (3)
      • Spring (9)
      • Node.js (1)
    • Book (1)
      • 이펙티브 자바 (0)
      • 대규모 시스템 설계 (1)
    • Algorithm (1)
      • Greedy, Implementation (6)
      • Dynamic Programming (5)
      • Data Structure (3)
      • Sorting (2)
      • Concept (1)
    • TIL (11)
    • Software (3)
      • Design Pattern (3)
    • Computer Science (1)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • node js
  • Restful API
  • API
  • 이펙티브 자바
  • 아이템9
  • 에러
  • Postman
  • 컴파일설치
  • 가상머신
  • 아이템 23
  • 서버
  • DP
  • 소스설치
  • Java
  • 아이템8
  • JPA
  • 수동설치
  • 구현
  • 우분투
  • 브루트포스
  • 백준
  • APM
  • 아이템 25
  • 자바
  • 아이템6
  • MySQL
  • jwt
  • 구동원리
  • Spring
  • 파이썬

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
nonneng.ee

Daeun-rithm

[Server] APM 소스설치 - 1. Apache
Back-end/Server

[Server] APM 소스설치 - 1. Apache

2021. 7. 22. 17:14

1. APM 구동원리

Apache : 웹 서버

Php : 백엔드 프로그래밍 언어

Mysql : 데이터베이스 관리 시스템

https://user-images.githubusercontent.com/77181984/126592612-b178a174-bbd6-4815-9816-2c5477c49019.png

  1. 손님이 홀서빙에게 주문
    ↔ 클라이언트측의 사용자가 원하는 정보를 apache에 요청
  2. 홀서빙이 주방장에게 전달함
    ↔ apache가 php에게 해당정보를 요청
  3. 주방장이 냉장고에서 재료를 가져와서 요리함
    ↔ mysql을 통해 데이터를 가져와서 php코드를 html형태로 변환함
  4. 완성된 요리를 홀서빙을 통해 손님에게 전달함
    ↔ 해당 html을 apache에 전송하고, 클라이언트에게 전달

2. Apache 소스설치

가상머신(Virtual Box) 기반의 우분투 환경에서 진행하였다.

https://user-images.githubusercontent.com/77181984/126599209-3f59dee8-714d-4f7a-b5ab-4f31758dd93a.png

💡 1. 필수패키지 설치

$ sudo su
$ apt-get install gcc
$ apt-get install --reinstall make
$ apt-get install libexpat1-dev
$ apt-get install g++

$ cd /usr/local
$ mkdir apache2.4
  • sudo su : 관리자모드로 변경
  • apt-get : 우분투 포함 리눅스에서 쓰이는 패키지 관리 명령어
  • mkdir : 새로운 디렉토리를 생성하는 명령어 (usr/local위치에 apache2.4 디렉토리를 생성)

💡 2. APR, APR-util, PCRE 설치

  • APR : Apache 웹서버를 지원하는 라이브러리
  • PCRE : 정규 표현식 C 라이브러리
$ cd /usr/local/
$ wget http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz
$ wget http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz
$ tar xvfz apr-1.7.0.tar.gz
$ tar xvfz apr-util-1.6.1.tar.gz

$ cd /usr/local/apr-1.7.0
$ ./configure --prefix=/usr/local/apr
$ make
$ make install

$ cd /usr/local/apr-util-1.6.1
$ ./configure --with-apr=/usr/local/apr --prefix=/usr/local/apr-util 
$ make
$ make install

$ cd /usr/local/
$ wget ftp://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
$ tar xvfz pcre-8.44.tar.gz
  • wget : 웹 상의 파일을 다운로드할 때 쓰이는 명령어
  • tar xvfz : tar.gz 형식의 압축을 풀 때 쓰이는 명령어
  • ./configure : 설치를 위한 설정
    ./configure —prefix=/usr/local/apr : /usr/local/apr 디렉토리에 설치한다
  • make : 소스를 컴파일
  • make install : make를 통해 컴파일된 파일들을 설치

pcre-8.44를 압축해제하는 과정에서 에러가 났다.

https://user-images.githubusercontent.com/77181984/126602653-85d5dd99-97a1-41ff-b18f-a592f5a2c1e1.png)https://user-images.githubusercontent.com/77181984/126602881-be1b4162-73f7-474f-b659-9cdba7196277.png

분명 pcre-8.44.tar.gz는 깔려있는데.. ( 빨간색 파일은 압축된 파일이라는 뜻)

pcre 8.43버전으로 다시 설치해보았다.

$ cd /usr/local/
$ wget ftp://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
$ tar xvfz pcre-8.43.tar.gz

$ cd /usr/local/pcre-8.43
$ ./configure --prefix=/usr/local/pcre
$ make
$ make install

정상적으로 설치가 진행되었다.

💡 3. Apache 설치

$ cd /usr/local 
$ wget http://apache.tt.co.kr//httpd/http-2.4.46.tar.gz 
$ tar xvfz httpd-2.4.46.tar.gz 

$ cd httpd-2.4.46 
$ ./configure --prefix=/usr/local/apache2.4 \ 
--enable-module=so --enable-rewrite --enable-so \ 
--with-apr=/usr/local/apr \ 
--with-apr-util=/usr/local/apr-util \ 
--with-pcre=/usr/local/pcre \ 
--enable-mods-shared=all 
$ make
$ make install

https://user-images.githubusercontent.com/77181984/126603583-96852644-d2c3-472c-b472-920388ec87c8.png

정상적으로 설치가 완료되었다 !

💡 4. Apache 실행

  • httpd -k start : 실행
  • httpd -k stop : 종료
$ sudo /usr/local/apache2.4/bin/httpd -k start
$ sudo /usr/local/apache2.4/bin/httpd -k start 
$ ps -ef | grep httpd | grep -v grep 
$ sudo netstat -anp | grep httpd
  • ps : process status
  • ef : 모든걸 보여준다
    → ps -ef : 모든 process status 출력
  • netstat : 네트워크 상태를 확인가능

그러나 이 과정에서 command not found 에러가 떴다.

https://user-images.githubusercontent.com/77181984/126604260-cf97a338-4727-4d28-9179-0426d3a5cdd3.png

$ cd /usr/local
$ sudo apt-get update
$ apt install net-tools

net-tools를 설치하고 다시 위의명령 실행

https://user-images.githubusercontent.com/77181984/126604666-407c2f81-f224-47ef-8e95-75578cd047d2.png


$ sudo apt install curl 
$ sudo curl http://127.0.0.1
  • curl : HTML 정보를 출력

https://user-images.githubusercontent.com/77181984/126605587-0aad6b1d-cfbc-47a5-946a-e1f31c87ca86.png

Apache 정상 실행중 !


  • firefox를 통해서도 Apache의 실행여부를 확인할 수 있다
    → 주소에 localhost 입력

https://user-images.githubusercontent.com/77181984/126607465-691c9bc9-cae1-4417-821a-8c6ff258c753.png

Apache가 정상적으로 실행되고 있음을 볼 수 있다.

'Back-end > Server' 카테고리의 다른 글

[Network] REST API 설계하기  (0) 2021.08.14
[Server] APM 소스설치 - 2. MySQL  (0) 2021.07.30
    'Back-end/Server' 카테고리의 다른 글
    • [Network] REST API 설계하기
    • [Server] APM 소스설치 - 2. MySQL
    nonneng.ee
    nonneng.ee

    티스토리툴바