◈windows XP◈ Apache Server 설정과 서버테스트
서버 호스트 네임 설정하기 <매우 중요>
C:\WINDOWS\system32\drivers\etc이라는 디렉토리로 이동합니다.
호스트 파일인 hosts파일을 문서편집기로 불러오세요.
아래는 제가 예제로 만든 겁니다.
=================================================================================
127.0.0.1 localhost
192.168.84.128 linuxsunny.pe.kr
192.168.84.128 sunny.linuxsunny.pe.kr
192.168.84.128 study.linuxsunny.pe.kr
192.168.84.128 www.linuxsunny.pe.kr
192.168.84.128 webmail.linuxsunny.pe.kr
192.168.84.128 blog.linuxsunny.pe.kr
192.168.84.128 mp3.linuxsunny.pe.kr
192.168.84.128 ftp.linuxsunny.pe.kr
==> 이 호스트네임을 지정하지 않으면 도메인서버를 이용해서 돌리는 방법이 있지만
그건 초보자들에게 어려운 입니다. 이렇게도 운영할수 있다는 점만 알아두시면 됩니다.
====================================================================================
C:\APM_Setup\Server\Apache\conf 디렉토리에 이동해서 httpd.conf이라는 설정파일을
편집한다. 가장 중요한 내용만 나열합니다.
==================================================================================================================
ServerRoot "C:/APM_Setup/Server/Apache"
#Listen 12.34.56.78:80
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule log_rotate_module modules/mod_log_rotate.so
<IfModule !mpm_winnt_module>
User daemon
Group daemon
ServerAdmin sunny@linuxsunny.pe.kr
ServerName linuxsunny.pe.kr
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>
<IfModule alias_module>
# Redirect permanent /foo http://www.example.com/bar
# Alias /webpath /full/filesystem/path
#ScriptAlias /cgi-bin/ "C:/APM_Setup/Server/Apache/cgi-bin/"
</IfModule>
<Directory "C:/APM_Setup/Server/Apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Include conf/extra/httpd-mpm.conf
#Include conf/extra/httpd-modsecurity.conf
#Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-userdir.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-php5.conf
Include conf/extra/httpd-alias.conf
Include conf/extra/httpd-vhosts.conf
#Include conf/extra/httpd-manual.conf
#Include conf/extra/httpd-dav.conf
Include conf/extra/httpd-default.conf
#Include conf/extra/httpd-ssl.conf
#### 빨강색으로 표시된 부분은 매우 중요합니다. 즉 가상호스트하고 엘리어스 부분 및 인덱스 적용이 가능하게 하는 모률입니다. 저 설정 파일들은 따로 자신의 서버 상황에 맞게 수정해야 합니다.
==================================================================================================================
이제 C:\APM_Setup\Server\Apache\conf\extra 디렉토리로 이동해서 나머지 설정파일을 편집합니다.
Include conf/extra/httpd-userdir.conf
==========================================================================================================================
UserDir "web"
## 주 계정 사용자 디렉토리 ##
<Directory "C:/APM_Setup/users/*/web">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
## 2차 계정 사용자 디렉토리 ##
<Directory "D:/HomeUser/*/web">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
==========================================================================================================================
Include conf/extra/httpd-vhosts.conf
===================================================================================================================
NameVirtualHost *:80
<Virtualhost *:80>
ServerAdmin sunny@linuxsunny.pe.kr
DocumentRoot "C:/APM_Setup/users/sunny/web"
ServerName www.linuxsunny.pe.kr
ServerAlias main.linuxsunny.pe.kr
#ThrottlePolicy Volume 300M 1d
ErrorLog "logs/www.linuxsunny.pe.kr-error.log"
CustomLog "logs/www.linuxsunny.pe.kr-access.log" common
</Virtualhost>
<Virtualhost *:80>
ServerAdmin sunny@linuxsunny.pe.kr
DocumentRoot "C:/APM_Setup/users/study/web"
ServerName study.linuxsunny.pe.kr
ServerAlias main2.linuxsunny.pe.kr
#ThrottlePolicy Volume 300M 1d
ErrorLog "logs/study.linuxsunny.pe.kr-error.log"
CustomLog "logs/study.linuxsunny.pe.kr-access.log" common
</Virtualhost>
===================================================================================================================================
Include conf/extra/httpd-php5.conf
==============================================================================================
LoadModule php5_module "C:/APM_Setup/Server/PHP5/php5apache2_2.dll"
AddType application/x-httpd-php .php .html
PHPIniDir "C:/APM_Setup"
===============================================================================================
Include conf/extra/httpd-autoindex.conf
=================================================================================================
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=*
Alias /icons/ "C:/APM_Setup/Server/Apache/icons/"
<Directory "C:/APM_Setup/Server/Apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
AddDescription "GZIP compressed document" .gz
AddDescription "tar archive" .tar
AddDescription "GZIP compressed tar archive" .tgz
AddDescription "써니 문서 파일-웹 보관 파일" .mht
AddDescription "어도비 공식 포맷 문서" .pdf
AddDescription "MS 공식 문서 포맷 문서" .chm
AddDescription "winamp 전용 음악 파일" .ogg
AddDescription "미디어 플레이어 전용 음악 파일" .mp3
AddDescription "일반 텍스트 문서 파일" .txt
AddDescription "그림 파일" .jpg .gif .bmp
AddDescription "리눅스 팩키지 파일" .srpm .rpm .RPM .SRPM
AddDescription "MS 오피스 포멧 파일" .doc .ppt .xls
AddDescription "리눅스 전용 문서" .ps .PS
AddDescription "프로그램밍 소스 파일" .c .so .h
AddDescription "RAR 압축 파일" .rar
AddDescription "ZIP+ARJ 압축 파일" .zip .arj
AddDescription "그래픽 포맷 파일" .jpg .bmp .gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
============================================================================================================
Include conf/extra/httpd-languages.conf
==================================================================================================
DefaultLanguage ko
AddLanguage en .en
AddLanguage ko .ko
AddLanguage kr .kr
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko kr ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset KOI8 .koi8
AddCharset KOI8-E .koi8-e
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-U .koi8-u
AddCharset KOI8-ru .koi8-uk .ua
AddCharset UTF-8 .utf8
AddCharset euc-kr .euc-kr
======================================================================================================
이 정도 파일만 이런식으로 편집하시면 가상호스트 구축이 가능합니다.
사용자 자신이 필요한 기능이 있다면 설정을 따로 불러와서 편집해서 사용하시면 됩니다.
솔직히 아파치 서버를 설치하고 사용하는게 중요한게 아니고
자기 자신이 설정파일을 얼마나 응용해서 서버기능을 높일려는 노력이 아주
중요하다는 사실을 잊지 마세요.