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