안녕하세요. 

친구들과 DementiaHack 이라는 hackathon에서 AWS 사용하여 웹 서비스를 제공했던 경험을 정리해 볼까 합니다.

기본 환경은 Ubuntu, Apache, php, MySQL 사용하였구요 참고했던 문서는 첨부파일로 올립니다.

(참고로, 첨부파일은 저도 얻은것이라서 출처를 모르겠네요. 혹시 문제가 된다면 삭제 하겠습니다.) 

 

저는 리눅스만 설치 모든 것은 제가 설치하고 싶어서 </o:p>

Step 1. AMI 선택 화면에서 Amazon Linux AMI 2016.03.2 (HVM) 아닌,

Ubuntu Server 14.04 LTS (PV) 선택했습니다

 

Tip1. “.pem” 이용하여 SSH 서버 접속하기</o:p>

AWS 사이트에서 서버 설치 후 SSH로 접속하고 싶다면, 순간 멍해 질지도 모릅니다우리가 흔히 생각하는 방식 ID/PW 가 처음에는 막혀 있기 때문입니다.

기동중인 Instance들을 보여주는 화면에서 Connect 버튼을 누르면 어떻게 처음 발급받은 .pem 파일로 SSH를 접속할 수 있는지 방법을 보여줍니다.

만일 PuTTY를 사용한다면, connect using PuTTY 를 클릭해서 이동합니다방법이 조금 더 복잡하지만, 다행이도 한글 번역을 제공하고 있습니다.

 

 

Tip2. Enabling password authentication

sshd_config 의 ChanllegeResponseAuthentication과 PasswordAuthentication을 yes로 바꾼 후 재기동하면 됩니다.

이후 root user(ubuntu) 및 일반 유저들의 password 인증 방식 접속이 가능해 집니다.

$sudo vi /etc/ssh/sshd_config

47 # Change to yes to enable challenge-response passwords (beware issues with

48 # some PAM modules and threads)
49 #ChallengeResponseAuthentication no
50 # Changed by Dure on October 10, 2015
51 ChallengeResponseAuthentication yes
52
53 # Change to no to disable tunnelled clear text passwords
54 #PasswordAuthentication no
55 # Changed by Dure on October 10, 2015

56 PasswordAuthentication yes

 

$ sudo service ssh restart

ssh stop/waiting

ssh start/running, process 7690

 

Tip 4. FTP 설치

$ sudo apt-get install vsftpd

 

Tip5. PHPMYADMIN 설치

MySQL데이터베이스 내의 테이블 관리와 SQL 쿼리를 보다 쉽게 하기 위한 툴

 

$ sudo apt-get install phpmyadmin

 

설치 후 아래와 같은 에러 메시지를 만나면 config.inc.php 파일 수정 필요.

You are missing at least one of the phpMyAdmin configuration storage tables, or the configured table name does not match the actual table name.

See http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage.

A quick summary of what to do can be:

            1. On the shell: locate create_tables.sql.

            2. import /usr/share/doc/phpmyadmin/examples/create_tables.sql.gz using phpMyAdmin.

            3. open /etc/phpmyadmin/config.inc.php and edit lines 81-92: change pma_bookmark to pma__bookmark and so on.

 

Tip6. localhost가 아닌 곳에서 MySQL에 접속하기

ERROR 1045 (28000): Access denied for user 'daonadm'@'localhost' (using password: YES)

$ vi /etc/mysql/my.cnf 

  bind-address = 127.0.0.1 을 찾아서 주석처리 (제일 앞에 # 붙이면 주석)