실습 2 - LAMP 서버에 그누보드 설치하기

LAMP

가장 대중적인 웹사이트 기술스택
  • Linux - 운영체제
  • Apache - 웹서버
  • MySQL - 데이터베이스 시스템
  • PHP - 언어
 

그누보드

웹에서 게시글, 회원정보 등을편리하게 관리하는게시판(BBS - Bulletin Board System) 프로그램입니다.
notion imagenotion image
 
실습영상
Video preview
 
  1. Amazon Lightsail - 인스턴스 탭에서 인스턴스 생성 을 클릭합니다.
    1. notion imagenotion image
       
  1. 인스턴스 이미지를 선택합니다.
      • 플랫폼 : Linux/Unix
      • 블루프린트 : Lamp(PHP 7)
      notion imagenotion image
       
  1. 인스턴스 플랜 선택 - $3.5 USD 선택합니다.
    1. notion imagenotion image
       
  1. 인스턴스 확인 - 리소스 이름을 입력합니다. 규칙 : 유저아이디-gnuboard 예 : use001-gnuboard
    1. notion imagenotion image
       
  1. 인스턴스 생성 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 인스턴스가 생성 완료될때까지 기다립니다.
    1. notion imagenotion image
       
  1. 인스턴스가 활성화 되면 이름을 클릭합니다.
    1. notion imagenotion image
       
      notion imagenotion image
       
  1. 고정 IP 생성하기
      • 인스턴스를 재부팅하게 되면 퍼블릭IP가 매번 바뀌게 됩니다.
      • 항상 동일한 퍼블릭 IP를 유지하기 위해서 고정 IP를 생성하겠습니다.
    1. 화면에서 네트워킹 탭을 클릭합니다.
      1. notion imagenotion image
         
    2. 고정 IP 생성 버튼을 클릭합니다.
      1. notion imagenotion image
         
    3. 생성할 고정 IP의 이름을 입력합니다.
        • 규칙 : 유저ID-gnuboard-ip
        • 예 : user001-gnuboard-ip
        notion imagenotion image
         
    4. 생성 버튼을 클릭합니다.
      1. notion imagenotion image
         
      • 퍼블릭 고정 IP 주소를 확인합니다.
        • notion imagenotion image
           
      • 인스턴스 이름 (userXXX-gnuboard)를 클릭하여 인스턴스 상세화면으로 다시 돌아갑니다.
        • notion imagenotion image
           
  1. 퍼블릭 IP주소가 바뀐것을 확인합니다. 퍼블릭 IP주소를 복사 합니다.
    1. notion imagenotion image
       
  1. 웹브라우저에서 새탭을 열고 퍼블릭 IP주소를 입력하여 설치된 페이지로 접속합니다.
    1. notion imagenotion image
      이제 나만의 LAMP 서버가 생성되었습니다.
       
  1. 그누보드를 설치하기 위해서 SSH 연결을 하겠습니다. SSH를 사용하여 연결 을 클릭합니다.
    1. notion imagenotion image
       
  1. 터미널 팝업창이 뜬 것을 확인합니다.
    1. notion imagenotion image
       
  1. ls 명령을 실행하여 현재 존재하는 파일 목록을 확인합니다.
    1. ls
      • 여기에 파일들이 존재합니다.
      • bitnami_application_password : 설치된 MySQL 데이터베이스의 root 암호
      • bitnami_credentials : 설치된 MySQL 데이터베이스의 root 암호
      • htdocs : 웹사이트의 파일을 저장하는 곳입니다. 이곳에 파일을 넣어놓으면 웹브라우저를 통해서 볼 수 있습니다.
      • stack : 주요 실행 명령들이 보관되어 있는 곳입니다.
      notion imagenotion image
       
  1. 명령어를 실행하여 설치데이터베이스 암호를 조회합니다.
    1. # MySQL 데이터베이스 암호 조회 cat ~/bitnami_application_password
      notion imagenotion image
       
  1. 실행결과로 표시된 데이터베이스 암호를 복사합니다.
    1. notion imagenotion image
       
      메모장 앱을 실행하여 붙여넣습니다. 이후에 사용할 예정이므로 메모장앱을 끄지않고 유지합니다.
      notion imagenotion image
       
  1. 그누보드용 mysql 데이터베이스 생성 명령을 복사합니다.
    1. # 그누보드용 mysql 데이터베이스 생성 mysql -u root -p$(cat ~/bitnami_application_password) -e 'CREATE DATABASE gnuboard'
      notion imagenotion image
       
  1. 복사한 명령어를 터미널창에 붙여넣기 하여 실행합니다.
    1. notion imagenotion image
      notion imagenotion image
       
  1. 그누보드용 MySQL 데이터베이스 생성 조회 명령을 복사합니다.
    1. # 그누보드용 mysql 데이터베이스 생성조회 mysql -u root -p$(cat ~/bitnami_application_password) -e 'show databases'
      notion imagenotion image
       
  1. 복사한 그누보드용 MySQL 데이터베이스 생성조회 명령을 터미널창에 붙여넣기 합니다.
    1. notion imagenotion image
       
  1. 명령 입력결과 Database목록이 표시 됩니다. 결과 안에 gnuboard 데이터베이스가 생성되었는지 확인합니다. 이후에 설치될 그누보드는 이 gnuboard 데이터베이스를 사용할 예정입니다.
    1. notion imagenotion image
       
  1. 그누보드 소스코드를 설치하기 위하여 htdocs 디렉토리로 이동합니다. 이동 명령어로 cd htdocs 를 입력합니다.
    1. # 웹서비스 기본 폴더로 이동 cd htdocs
      notion imagenotion image
       
  1. 웹서비스 기본폴더 안에 존재하는 파일을 ls 명령어를 이용해서 확인합니다. 조회 결과 index.html 파일이 존재합니다.
    1. notion imagenotion image
       
  1. htdocs디렉토리안에 그누보드 소스코드를 받기 위하여 존재하는 index.html파일을 삭제합니다. 삭제명령어로 rm index.html을 입력합니다.
    1. # index.html파일 삭제 rm index.html
      notion imagenotion image
       
  1. 삭제 결과 htdocs 디렉토리 안에 아무 파일도 없는지 ls 명령어를 이용해서 조회합니다.
    1. ls
      notion imagenotion image
      notion imagenotion image
       
  1. 그누보드 소스코드를 현재 디렉토리로 git을 이용하여 다운받습니다.
    1. # 그누보드 github : https://github.com/gnuboard/gnuboard5 # 그누보드 소스코드를 현재폴더로 다운로드 git clone https://github.com/gnuboard/gnuboard5.git .
      notion imagenotion image
      notion imagenotion image
       
  1. git clone의 결과로 그누보드 소스코드가 잘 다운받아졌는지 ls 명령을 이용해서 확인합니다. 정상적으로 받아졌다면 다음과 같이 여러 php파일이 보입니다.
    1. notion imagenotion image
       
  1. 그누보드에서 사용할 data 디렉토리를 명령어를 이용해서 생성합니다.
    1. # data 디렉토리 생성 mkdir data
      notion imagenotion image
       
  1. data 디렉토리의 권한을 변경합니다.
    1. # data 디렉토리 권한 설정 chmod 707 data
      notion imagenotion image
       
  1. 이제 브라우저에서 설치를 이어가기 위해서 그누보드 인스턴스의 퍼블릭 IP를 복사합니다.
    1. notion imagenotion image
      notion imagenotion image
       
  1. 웹브라우저에서 새 탭을 열고 복사한 퍼블릭 IP를 붙여넣기 합니다.
    1. notion imagenotion image
       
  1. 설치화면이 나오면 그누보드5 설치하기 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 동의합니다 를 체크하고 다음 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 이전에 복사해 두었던 MySQL 데이터베이스 암호를 메모장앱에서 복사합니다.
    1. notion imagenotion image
       
      만약 보관해둔 암호가 없다면 터미널앱에서 조회 명령을 입력하여 암호를 조회합니다.
      # MySQL 데이터베이스 암호 조회 cat ~/bitnami_application_password
      notion imagenotion image
       
  1. 그누보드 설치화면에서 MySQL 설치정보들을 입력합니다.
      • MySQL 정보입력
        • Host : localhost
        • User : root
        • Password : 복사해둔 데이터베이스 암호
      notion imagenotion image
       
  1. 그누보드 설치화면에서 최고관리자 정보를 입력합니다.
      • 회원 ID : admin
      • 비밀번호 : admin (원하는 암호로 입력하시면 됩니다)
      • 이름 : 원하는 관리자 이름
      • E-mail : 내 이메일 주소
      notion imagenotion image
       
  1. 설치를 위한 정보를 모두 입력한 후 다음 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 새로운 그누보드5로 이동 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 설치된 그누보드 화면을 볼 수 있습니다.
    1. notion imagenotion image
       
  1. 상단의 쇼핑몰 버튼을 클릭하면 함께 설치된 영카드 쇼핑몰 솔루션을 볼 수 있습니다.
    1. notion imagenotion image
       
  1. 로그인을 위해서 이전에 입력한 관리자 아이디와 암호를 입력 후 로그인 버튼을 클릭하여 로그인합니다.
    1. notion imagenotion image
       
  1. 자유게시판에 글쓰기를 해보겠습니다. 자유게시판 옆 더보기 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 연필 아이콘을 클릭합니다.
    1. notion imagenotion image
       
  1. 제목과 내용을 입력한 뒤 작성완료 버튼을 클릭합니다.
    1. notion imagenotion image
       
  1. 작성된 글을 조회 할 수 있습니다.
    1. notion imagenotion image
       
  1. 상단의 쇼핑몰 버튼을 클릭하여 쇼핑몰 페이지로 이동합니다.
    1. notion imagenotion image
  1. 우측 상단의 로그인된 사용자명(최고관리자)를 클릭한 뒤 보조메뉴가 뜨면 보조메뉴안의 관리자 링크를 클릭합니다.
    1. notion imagenotion image
       
  1. 관리자 사이트로 들어오면 여러 관리 메뉴들을 볼 수 있습니다.
    1. notion imagenotion image
      notion imagenotion image
      notion imagenotion image