Wednesday, July 26, 2017

20분만에 웹서버 올리기 Make your own web server online in 20-minute

구글에서 구글 클라우드 컴퓨팅을 런칭하였고, 현재 1년간 쓸수 있는 $300 크레딧 행사 중 입니다.
Google now offer Google Cloud Computing with $300 credit that can be used for 12-month as of July 2017.

구글 클라우드의 컴퓨트 엔진을 이용해 아주 간단하게 가상 서버를 만들어 인터넷에 올릴 수 있습니다.
Using Compute Engine from GCC, we can easily up and running web server very quickly.

먼저 GCC에 가입을 합니다.
First join GCC

TRY IT FREE를 누릅니다.
Click TRY IT FREE of course.

구글 아이디로 로그인 합니다. 
Login with Google Account

약관을 읽어보시고 기본 조건에 동의합니다. 약관 읽는 시간은 20분에서 제외합시다.
Check out Terms of Service. Let's not take reading Terms of Service from 20-minute countdown.

$300 크레딧을 받기 위해 신용카드 정보를 넣습니다. 구글은 $300 크레딧을 다 쓴 다음에 신용카드에서 차감 하기 전 고객의 동의를 얻겠다고 하였습니다. 네이버와는 다른 자세입니다. 귀찮은 정보 입력을 피하기 위해 Individual로 진행합니다.
Put credit card information, Google assured that they wouldn't charge you any money unless they get your confirmation again once $300 credit spent. Let's join as an individual to avoid extra setting
신용카드 정보를 입력하면 이제 준비가 다 되었습니다.
After input credit card information, now we are good to go.



좌상단의 Select a project를 누릅니다.
Click "Select a project" on upper left
 

OPEN을 누릅니다.
Press OPEN, if it's not open promptly, try press "getting started


만약 프로젝트가 열리지 않으면 구글앱스 계정으로 접속하였을 수 있다. 이때는 구글 앱스 관리자 화면에서 아래의 내용을 허용해 준다.
If the project is not opening and you get notification of error, you may logged in as Google Apps account. Go to Google Apps admin page as an Google Apps administrator and allow Google Development Console to the account (or for everyone)

프로젝트가 제대로 로드되지 않았다면 프로젝트를 새로 만든다.
You can also try create a new project

축하합니다. 이제 본론으로 들어갈 수 있습니다. Compute Engine dashboard를 클릭합니다.
Congratulation! now we can talk real stuff. Click Compute Engine dashboard

Create를 눌러서 바로 시작해 보자
Click create and let's get to it right now

이름과 위치, CPU 성능, OS를 정한다. 무엇이든지 필요에 따라 나중에 바꿀수 있으니 가볍게 시작해 보자. 지역에 따라서 가격이 조금 틀리다.
Set name of the server, CPU performance with memory, OS boot disk and region. All can be changed later. So let's begin lightly. Pricing would be little differ region to region.

파이어월에서 http와 https를 허용하게 하고 추가 설정 버튼을 누른다.
Let firewall allow http and https get in. Click Management, disks, networking SSH keys
네트워크 탭에서 펜 그림을 누른다.
Click Pen icon on Network tab
고정 아이피를 하나 만든다. 지역당 하나밖에 못 받을 것 이다.
Get a static IP. You would get only one at a region.


거의 끝났다. Create를 누르자. 원이 다 돌면 준비가 된 것이다.
Almost done. Click Create. When the circle stop turning, it's ready



이제 접속해 보자. SSH를 누르면 쉘로 접속할 수 있다.
Let's  login. Press SSH, you can login as shell










sudo도 되니 이제 Apache, Maria DB, PHP 를 설치하자.
we can sudo already, let's install Apache, Maria DB(or MySQL), PHP.

sudo apt-get update
sudo apt install -y mariadb-client mariadb-server
sudo apt install -y php7.0 php7.0-mysql
sudo apt install -y phpmyadmin

PHPMyAdmin 셋팅 화면이 나온다. apache2를 선택하고 dbconfig를 묻는 화면에서 yes를 누른다.
Here comes PHPMyAdmin setup screen Choose apache2, Choose yes to dbconfig

phpmyadmin에 쓰일 암호를 입력하고 재 확인 한다.
Set password for phpmyadmin and confirm

이제 phpmyadmin에 DB권한을 준다.
Now, give DB privileges to phpmyadmin

sudo mysql

grant all privileges on *.* to 'phpmyadmin'@'localhost';
flush privileges;
exit

이제 거의 다 되었다. phpmyadmin 설정을 복사하고 아파치를 재 시작하고 확인해 보자.
Almost done. Copy phpmyadmin configuration file to Apache configuration directory and restart apache

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo service apache2 restart







이것으로 20분만에 LAMP 웹 서버를 인터넷에 올릴 수 있었습니다. 행운을 빕니다!
So now we have fully working LAMP server on internet in 20-minute. Von voyage!

No comments: