[ Server ][ Linux ] 리눅스 호스팅 서버 관리 > linux

본문 바로가기
사이트 내 전체검색

linux

[ Server ][ Linux ] 리눅스 호스팅 서버 관리

페이지 정보

작성자 웹지기 댓글 0건 조회 8,278회 작성일 18-09-30 18:12

본문

■리눅스 호스팅서버 관리 

***********************************************************

* 리눅스 호스팅서버 관리

***********************************************************

* 호스팅서비스에 필요한 것들

- 리눅스 운영체제

- 아파치 웹서버

- MySQL 데이터베이스

- PHP, Perl 등과 같은 웹프로그래밍언어

- 메일서비스 지원을 위한 Sendmail, Qmail, POP, IMAP

- Webalizer와 accesswatch 등을 이용한 웹로그분석 제공

- Proftpd, vsftpd를 이용한 FTP서비스

- BIND를 이용한 DNS서비스

- 여러가지 라이브러리 및 어플리케이션들

- 백업서버 구축

* 신규 호스팅가입자 서버셋팅


1. 사용자 ID, 패스워드 생성

# useradd bible

# passwd bible


2. 사용자 호스팅용 홈디렉토리 구성하기

# mkdir /home/bible/www

# mkdir /home/bible/www_log

# mkdir /home/bible/www/weblog

# mkdir /home/bible/ftp

# mkdir /home/bible/ftp_log

# cp index.html /home/bible/www

# chmod 701 /home/bible

# chown -R bible:bible /home/bible


3. DNS에 사용자 도메인 설정하기

# vi /etc/named.conf

zone "bible.co.kr" {

type master;

file "bible.co.kr.zone";

};

# vi /var/named/bible.co.kr.one

$TTL 86400

@  IN SOA ns.dns.co.kr. root.bible.co.kr. (

2006040101 ; serial number

28800  ; secondaries refresh every 8 hours

14400  ; if refresh fails, retry every 4 hours

2419200  ; if cannot refresh, expire IN 30 days

86400  ; default ttl

)

IN NS 192.168.0.2

IN MX 10 bible.co.kr.

IN A 192.168.0.101

www  IN A 192.168.0.101

ftp  IN A 192.168.0.101


4. 아파치에 가상호스트 설정하기

# vi /usr/local/apache2/conf/httpd.conf

#<VirtualHost *:80>

<VirtualHost 192.168.0.2>

ServerAdmin webmaster@bible.co.kr

DocumentRoot /home/bible/www

ServerName bible.co.kr

ServerAlias www.bible.co.kr

ErrorLog /home/bible/www_log/error_log

CustomLog /home/bible/www_log/access_log common

Alias /bible/ "/home/bible/www/"

<Directory /home/bible/www>

Options ExecCGI

AllowOverride AuthConfig

</Directory>

</VirtualHost>


5. 일hit수와 일트랙픽량 제한 설정하기

# vi /usr/local/apache2/conf/httpd.conf

#<VirtualHost *:80>

<VirtualHost 192.168.0.2>

ServerAdmin webmaster@bible.co.kr

DocumentRoot /home/bible/www

ServerName bible.co.kr

ServerAlias www.bible.co.kr

ErrorLog /home/bible/www_log/error_log

CustomLog /home/bible/www_log/access_log common

Alias /bible/ "/home/bible/www/"

ThrottlePolicy Volume  2048M 1d

ThrottlePolicy Request 20000 1d

<Directory /home/bible/www>

Options ExecCGI

AllowOverride AuthConfig

</Directory>

</VirtualHost>


6. 메일사용을 위한 메일설정하기

# vi /etc/mail/access

bible.co.kr RELAY

# makemap hash /etc/mail/access.db < /etc/mail/access

# vi /etc/mail/local-host-names

bible.co.kr

# vi /etc/mail/virtusertable

webmaster@bible.co.kr bible

# makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable


7. 데이터베이스 사용을 위한 MySQL 설정하기

# /usr/local/mysql/bin/mysql -u root -p mysql

Enter password: ********

mysql> create database bible;

mysql> grant all on bible.* to bible@'localhost' identified by '1234';


8. 웹로그분석서비스를 위한 webalizer 설정하기

# cp /etc/webalizer.conf.sample bible.co.kr.conf

# bible.co.kr.conf

LogFile  /home/bible/www_log/access_log

OutputDir /home/bible/www/weblog

HistoryName bible.co.kr

ReportTilte bible.co.kr WebSite

HostName www.bible.co.kr


9. 디스크사용량 제한을 위한 Quota 설정하기

# edquota -u bible

Disk quotas for user bible (uid 600):

Filesytem blocks soft hard inodes soft hard

/dev/sda2 1200 307200 358400 34 0 0


10. 가상 FTP호스팅을 위한 proftpd의 가상호스트 설정하기

# vi /usr/local/proftpd/etc/proftpd.conf

<VirtualHost ftp.bible.co.kr>

ServerName  "ftp.bible.co.kr FTP Server"

ServerAdmin  webmaster@bible.co.kr

Port   40001

TranferLog  /home/bible/ftp_log/xferlog

MaxClients  10

MaxClientPerHost 3


11. 아파치, FTP, MySQL, DNS, 메일서비스 재시작하기

# /usr/local/apache2/bin/apachectl restart

# /usr/local/mysql/bin/mysqladmin -u root -p reload

# killall -9 proftpd

# /usr/local/proftpd/sbin/proftpd

# /etc/init.d/sendmail restart

# /etc/init.d/named restart

* 메일포워딩 서비스 설정

.forwar 파일에 포워딩할 이메일주소를 등록한다.

* 도메인포워딩 설정

<meta http-equiv="Refresh" content="0; url=http://soback.kornet.net/~bible">

[이 게시물은 웹지기님에 의해 2019-03-15 15:38:39 knowledge에서 이동 됨]
추천0 비추천0

댓글목록

등록된 댓글이 없습니다.

Total 103건 8 페이지
게시물이 없습니다.
게시물 검색

회원로그인

접속자집계

오늘
4,322
어제
13,204
최대
33,828
전체
8,388,381

그누보드5
Copyright © funyphp.com. All rights reserved.