질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

아파치서버에서 포트로 멀티사이트운용법 좀 가르켜주세요

작성자 정보

  • 정기복 작성
  • 작성일

컨텐츠 정보

본문

혹시나 몰라서 httpd.conf 파일 내용을 올립니다. 좀 많이 깁니다.

보시고 틀린 부분이 있는지 봐주세요.

내용을 다시 말씀드리면 내부 IP로 아래와 같이 두개의 싸이트를 운영하는 겁니다.

http://192.162.108.100:1000

http://192.168.108.100:2000

물론 두개의 포트는 services에 http 포트로 등록은 했습니다.

--------------------------------------------------------------------------------------------------

##

## httpd.conf -- Apache HTTP server configuration file

##


#

# Based upon the NCSA server configuration files originally by Rob McCool.

#

# This is the main Apache server configuration file.  It contains the

# configuration directives that give the server its instructions.

# See <URL:http://www.apache.org/docs/> for detailed information about

# the directives.

#

# Do NOT simply read the instructions in here without understanding

# what they do.  They're here only as hints or reminders.  If you are unsure

# consult the online docs. You have been warned. 

#

# After this file is processed, the server will look for and process

# /usr/local/apache/conf/srm.conf and then /usr/local/apache/conf/access.conf

# unless you have overridden these with ResourceConfig and/or

# AccessConfig directives here.

#

# The configuration directives are grouped into three basic sections:

#  1. Directives that control the operation of the Apache server process as a

#     whole (the 'global environment').

#  2. Directives that define the parameters of the 'main' or 'default' server,

#     which responds to requests that aren't handled by a virtual host.

#     These directives also provide default values for the settings

#     of all virtual hosts.

#  3. Settings for virtual hosts, which allow Web requests to be sent to

#     different IP addresses or hostnames and have them handled by the

#     same Apache server process.

#

# Configuration and logfile names: If the filenames you specify for many

# of the server's control files begin with "/" (or "drive:/" for Win32), the

# server will use that explicit path.  If the filenames do *not* begin

# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"

# with ServerRoot set to "/usr/local/apache" will be interpreted by the

# server as "/usr/local/apache/logs/foo.log".

#


### Section 1: Global Environment

#

# The directives in this section affect the overall operation of Apache,

# such as the number of concurrent requests it can handle or where it

# can find its configuration files.

#


#

# ServerType is either inetd, or standalone.  Inetd mode is only supported on

# Unix platforms.

#

ServerType standalone


#

# ServerRoot: The top of the directory tree under which the server's

# configuration, error, and log files are kept.

#

# NOTE!  If you intend to place this on an NFS (or otherwise network)

# mounted filesystem then please read the LockFile documentation

# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);

# you will save yourself a lot of trouble.

#

ServerRoot "/usr/local/apache"


#

# The LockFile directive sets the path to the lockfile used when Apache

# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or

# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at

# its default value. The main reason for changing it is if the logs

# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL

# DISK. The PID of the main server process is automatically appended to

# the filename.

#

#LockFile /usr/local/apache/logs/httpd.lock


#

# PidFile: The file in which the server should record its process

# identification number when it starts.

#

PidFile /usr/local/apache/logs/httpd.pid


#

# ScoreBoardFile: File used to store internal server process information.

# Not all architectures require this.  But if yours does (you'll know because

# this file will be  created when you run Apache) then you *must* ensure that

# no two invocations of Apache share the same scoreboard file.

#

ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard


#

# In the standard configuration, the server will process httpd.conf (this

# file, specified by the -f command line option), srm.conf, and access.conf

# in that order.  The latter two files are now distributed empty, as it is

# recommended that all directives be kept in a single file for simplicity. 

# The commented-out values below are the built-in defaults.  You can have the

# server ignore these files altogether by using "/dev/null" (for Unix) or

# "nul" (for Win32) for the arguments to the directives.

#

#ResourceConfig /usr/local/apache/conf/srm.conf

#AccessConfig /usr/local/apache/conf/access.conf


#

# Timeout: The number of seconds before receives and sends time out.

#

Timeout 300


#

# KeepAlive: Whether or not to allow persistent connections (more than

# one request per connection). Set to "Off" to deactivate.

#

KeepAlive On


#

# MaxKeepAliveRequests: The maximum number of requests to allow

# during a persistent connection. Set to 0 to allow an unlimited amount.

# We recommend you leave this number high, for maximum performance.

#

MaxKeepAliveRequests 100


#

# KeepAliveTimeout: Number of seconds to wait for the next request from the

# same client on the same connection.

#

KeepAliveTimeout 15


#

# Server-pool size regulation.  Rather than making you guess how many

# server processes you need, Apache dynamically adapts to the load it

# sees --- that is, it tries to maintain enough server processes to

# handle the current load, plus a few spare servers to handle transient

# load spikes (e.g., multiple simultaneous requests from a single

# Netscape browser).

#

# It does this by periodically checking how many servers are waiting

# for a request.  If there are fewer than MinSpareServers, it creates

# a new spare.  If there are more than MaxSpareServers, some of the

# spares die off.  The default values are probably OK for most sites.

#

MinSpareServers 5

MaxSpareServers 10


#

# Number of servers to start initially --- should be a reasonable ballpark

# figure.

#

StartServers 5


#

# Limit on total number of servers running, i.e., limit on the number

# of clients who can simultaneously connect --- if this limit is ever

# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.

# It is intended mainly as a brake to keep a runaway server from taking

# the system with it as it spirals down...

#

MaxClients 150


#

# MaxRequestsPerChild: the number of requests each child process is

# allowed to process before the child dies.  The child will exit so

# as to avoid problems after prolonged use when Apache (and maybe the

# libraries it uses) leak memory or other resources.  On most systems, this

# isn't really needed, but a few (such as Solaris) do have notable leaks

# in the libraries. For these platforms, set to something like 10000

# or so; a setting of 0 means unlimited.

#

# NOTE: This value does not include keepalive requests after the initial

#       request per connection. For example, if a child process handles

#       an initial request and 10 subsequent "keptalive" requests, it

#       would only count as 1 request towards this limit.

#

MaxRequestsPerChild 0


#

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

#

#Listen 3000

#Listen 12.34.56.78:80

Listen 1000

Listen 2000

Listen 192.168.108.100:1000

Listen 192.168.108.100:2000

#

# BindAddress: You can support virtual hosts with this option. This directive

# is used to tell the server which IP address to listen to. It can either

# contain "*", an IP address, or a fully qualified Internet domain name.

# See also the <VirtualHost> and Listen directives.

#

#BindAddress *


#

# Dynamic Shared Object (DSO) Support

#

# To be able to use the functionality of a module which was built as a DSO you

# have to place corresponding `LoadModule' lines at this location so the

# directives contained in it are actually available _before_ they are used.

# Please read the file http://httpd.apache.org/docs/dso.html for more

# details about the DSO mechanism and run `httpd -l' for the list of already

# built-in (statically linked and thus always available) modules in your httpd

# binary.

#

# Note: The order in which modules are loaded is important.  Don't change

# the order below without expert advice.

#

# Example:

# LoadModule foo_module libexec/mod_foo.so


LoadModule vhost_alias_module libexec/mod_vhost_alias.so

관련자료

댓글 2

홍진규님의 댓글

  • 홍진규
  • 작성일
아래 잘린 부분에 버추얼호스트 설정부분이 있습니다.
버추얼호스트 설정부분을 다시 보여 주십시오.

홍진규님의 댓글

  • 홍진규
  • 작성일
우선 제가 어설프게 운영하는 개인서버의 버추얼호스트 설정을 참고해 보십시오.

Listen 3000
Listen 8080
Listen 3030

NameVirtualHost *:3000
NameVirtualHost *:8080
NameVirtualHost *:3030

<VirtualHost *:3000>
#    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /home/gooya/public_html
    ServerName goldeye.co.kr
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:8080>
#    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /home/frenz/public_html
    ServerName gooya.co.kr
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *:3030>
#    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /home/gooya2/public_html
    ServerName gooya.pe.kr
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

공지사항


뉴스광장


  • 현재 회원수 :  60,351 명
  • 현재 강좌수 :  37,010 개
  • 현재 접속자 :  347 명