brunch

28. 모바일 홈페이지 만들기

by Master Seo

목적

서버에 홈페이지를 만들어 올려보자.

홈페이지를 만들기 위해 필요한 것을 알아보자

예상치 못한 것들을 해결해나가는 과정의 연속이다.



목차

<1> 모바일 홈페이지 접속해보기

<2> 서버에 접속해 웹서버 소스 다운로드 하기

<3> 웹서버 설치하기

<4> 웝서버 동작확인하기

<5> 모바일 홈페이지 소스로 변경하기

<6> 홈페이지 접속 해보기



<1> 모바일 홈페이지 접속해보기


PC로 접속해보기

스마트폰으로 접속해 보기

차이점은 ? PC나 스마트폰 , 타블릿 화면 크기에 따라 구성이 자동 변경된다.

http://toy1.serverchk.com/



서비스 구성도를 확인하고 웹서버 , FTP 서버를 구축해보자.

슬라이드1.JPG

간단하게 구축하는 방법


1) 웹서버 설치하기

# yum install httpd

# /usr/sbin/httpd


# ps -ef |grep httpd


2. 보여주는 파일 위치 확인하기.ㅣ

index.html 위치

#find / -name index.html

#/usr/share/httpd/noindex


3. 보여주는 파일 백업 하기

# cd /usr/share/httpd/noindex/

# mv index.html index.html-2019-0608-1


4. 보여주는 파일 내가 만들어보기.

# vi index.html

홈페이지 소스를 넣어본다.


샘플 소스가 있는곳. 복사해서 사용하면 된다. https://www.w3schools.com/




다른 방법은 아래와 같이 소스를 받아 하는 법도 있다.


<2> 서버에 접속해 웹서버 소스 다운로드 하기


슬라이드1.JPG




슬라이드1.JPG

웹서버 프로그램 중 Apache download 와 컴파일.

1) download

# ftp ftp.sayclub.co.kr

# yum install ftp


# cd /tmp

tmp # ftp ftp.sayclub.co.kr

Name (ftp.sayclub.co.kr:root): ftp

Password : <Enter>

ftp> cd /pub/apache/httpd

ftp> ha

ftp> bi

ftp> ls

ftp> mget httpd-2.4.38.tar.gz

ftp> quit

tmp]# tar zxvf httpd-2.4.38.tar.gz




<3> 웹서버 설치하기

설치하기

tmp]# cd httpd-2.4.38


httpd-2.4.28]# yum install apr*

httpd-2.4.28]# yum install gcc

httpd-2.4.28]# yum install pcre*

httpd-2.4.28]# ./configure --prefix=/usr/local/apache

httpd-2.4.28]# make ; make install

httpd-2.4.28]# /usr/local/apache/bin/apachectl start


httpd-2.4.28]# ps -ef |grep httpd

root 2694 1 0 11:29 ? 00:00:00 /usr/local/apache/bin/httpd -k start

daemon 2695 2694 0 11:29 ? 00:00:00 /usr/local/apache/bi






<4> 웝서버 동작확인하기


1. 웹브라우저로 Public IPs 로 접속 확인한다.

http://54.180.25.233/

It works!


2. IP를 기억 하지 못한다!!!

그래서 도메인 DNS를 사용한다.

DNS서버에 해당 서버 IP를 도메인으로 등록한다.

test10.serverchk.com A 54.180.25.233

슬라이드1.JPG


3. 도메인으로 접속해 확인한다.

http://test10.serverchk.com/




<5> 모바일 홈페이지 소스로 변경하기


1. 서버에 접속해 index.html 백업하기

2. 서버에서 index.html 교체하기



<6> 홈페이지 접속 해보기


PC로 접속 해보기 http://test10.serverchk.com/

스마트폰으로 접속해 보기 http://test10.serverchk.com/



감사합니다.

keyword
매거진의 이전글41. 웹서버,FTP서버,모바일 홈페이지 만들기