Skip to content

CHICPRO

  • Life Log
  • Cycling Log
  • Photo Log
    • Portrait
    • Landscape
    • Flower
    • Etc
  • Coding Log
  • Information

DigitalOcean 가상서버 세팅

2015-10-21 by 편리

DigitalOcean(이하 DO)에서 저렴한 가상서버를 신청하고 nginx, mariadb 10, php5.6.14 버전을 세팅하는 과정을 나만 알아볼 수 있게? 어느 정도 지식이 있다면 아래 단계로 따라하면 웹서버 세팅을 할 수 있을 것이다. CentOS 6.7 x64 버전으로 가상서버를 신청했고 이후 과정도 그에 맞춰서 진행을 했다.

0. 타임존 변경
# mv /etc/localtime /etc/localtime_old
# cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime

1. 시간설정
# yum install rdate
# rdate -s time.bora.net

2. NGINX 설치
# yum install wget
# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
# yum install nginx

3. MariaDB 설치
https://downloads.mariadb.org/mariadb/repositories/#mirror=kaist&distro=CentOS&distro_release=centos6-amd64--centos6&version=10.0

# yum install MariaDB-server MariaDB-client
# service mysql start
# /usr/bin/mysqladmin -u root password 'new-password'

4. PHP 5.6 설치
# yum groupinstall 'Development Tools'
# yum install epel-release
# yum install libxml2-devel
# yum install openssl-devel
# yum install pcre-devel
# yum install curl-devel
# yum install libmcrypt libmcrypt-devel
# yum install mhash mhash-devel
# yum install bzip2-devel
# yum install gdbm-devel
# yum install libjpeg-devel
# yum install libpng-devel
# yum install libXpm-devel
# yum install freetype-devel
# wget http://php.net/distributions/php-5.6.14.tar.gz
# tar zxvf php-5.6.14.tar.gz
# cd php-5.6.14
# ./configure --prefix=/usr/local/php --with-libdir=lib64 --with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-gd --with-curl --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-zlib --with-zlib-dir=/usr --with-gdbm --with-gettext --with-iconv --with-openssl --enable-gd-native-ttf --enable-exif --enable-sockets --enable-soap --enable-mbstring=all --enable-bcmath --with-libxml-dir=/usr --enable-ftp --with-mcrypt --enable-fpm --enable-zip --with-bz2 --with-pear --enable-calendar --with-mhash --enable-mbregex --with-pcre-regex --with-kerberos --enable-inline-optimization --enable-opcache

5. 시스템 설정 패키지 설치
# yum install ntsysv
# yum install setuptool
# yum install system-config-network system-config-network-tui
# yum install system-config-firewall system-config-firewall-tui


6. Git 설치
# yum install expat-devel
# yum install perl-devel
# yum remove git
# wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz
# tar zxvf git-1.9.0.tar.gz
# cd git-1.9.0
# make prefix=/usr/local all
# make prefix=/usr/local install

마지막의 Git 설치는 필요한 경우에만 하면 된다. 난 개발 작업에 Git를 사용하기 때문에 기존에 설치된 git 을 제거하고 새로 컴파일 설치를 진행했다. 아.. 참고로 DO의 가장 저렴한 플랜을 사용하는 경우 메모리가 512MB여서 PHP 컴파일 때 OOM(Out of Memory) 오류가 발생한다. 이 때는 모든 서비스를 종료하고 다음 내용대로 Swap 파일을 생성해서 컴파일을 정상적으로 진행할 수 있다. https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-swap-adding.html  페이지 하다의 5.2.3. Creating a Swap File 부분을 참고했다.

PHP7 컴파일 설치 대신 yum을 통한 설치는 https://chicpro.dev/12480 를 참고하면 된다.

Post navigation

Previous Post:

한글날 이포보 라이딩

Next Post:

2015년 10월 18일 라이딩

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • php 배열 연산에서 + 와 array_merge 의 차이
  • pcntl_fork 를 이용한 다중 프로세스 실행
  • 아이폰 단축어를 이용하여 주중 공휴일엔 알람 울리지 않게 하기
  • 구글 캘린더 전체일정 재동기화
  • OpenLiteSpeed 웹서버에 HTTP 인증 적용
  • OpenLiteSpeed 웹어드민 도메인 연결
  • WireGuard를 이용한 VPN 환경 구축
  • Ubuntu 22.04 서버에 OpenLiteSpeed 웹서버 세팅
  • 맥 vim 세팅
  • 우분투 시스템 터미널쉘 zsh 로 변경

Recent Comments

  • 편리 on 업무관리용 그누보드 게시판 스킨
  • 임종섭 on 업무관리용 그누보드 게시판 스킨
  • 캐논 5D 펌웨어 | Dslr 펌웨어 업그레이드 방법 82 개의 베스트 답변 on 캐논 EOS 30D 펌웨어 Ver 1.0.6 , EOS 5D 펌웨어 Ver 1.1.1
  • Top 5 캐논 5D 펌웨어 Top 89 Best Answers on 캐논 EOS 30D 펌웨어 Ver 1.0.6 , EOS 5D 펌웨어 Ver 1.1.1
  • 편리 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 임팀장 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 편리 on Notepad++ NppFTP 플러그인 수동 설치
  • paul-j on Notepad++ NppFTP 플러그인 수동 설치
  • YS on Windows 10 iCloud 사진 저장 폴더 변경
  • 편리 on Docker를 이용한 Centos7 + httpd + php 5.4 개발환경 구축

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2025 CHICPRO | Built using WordPress and SuperbThemes