2016-07-23 3 views
0

나는 fedora에서 우분투 16.04로 옮겼다.하나의 파일에 복수의 가상 호스트 설정 방법

(fedora에서) 한 파일에 끝없는 가상 호스트를 나열 할 수 있습니다. 우분투에서 나는 각 가상 호스트에 대해 새로운 파일을 만들어야 만한다. 나는 이미 그것에있는 모든 유령과 내 목록을했습니다. 우분투에서 이것을 수행하는 방법은 무엇입니까?

# Virtual Hosts 
# 
# Required modules: mod_log_config 

# If you want to maintain multiple domains/hostnames on your 
# machine you can setup VirtualHost containers for them. Most configurations 
# use only name-based virtual hosts so the server doesn't need to worry about 
# IP addresses. This is indicated by the asterisks in the directives below. 
# 
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.4/vhosts/> 
# for further details before you try to setup virtual hosts. 
# 
# You may use the command line option '-S' to verify your virtual host 
# configuration. 

# 
# VirtualHost example: 
# Almost any Apache directive may go into a VirtualHost container. 
# The first VirtualHost section is used for all requests that do not 
# match a ServerName or ServerAlias in any <VirtualHost> block. 
# 
<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot /var/www/html/apecenergy.co.uk/public_html 
    ServerName www.apecenergy.co.uk 
    ServerAlias apecenergy.co.uk 
    ErrorLog "/var/log/httpd/apecenergy-error_log" 
    CustomLog "/var/log/httpd/apecenergy-access_log" common 
</VirtualHost> 

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot /var/www/html/plumbing_sites/crouchendplumber.co.uk/public_html 
    ServerName www.crouchendplumber.co.uk 
    ServerAlias crouchendplumber.co.uk 
</VirtualHost> 

답변

1

그건 바로 우분투의 아파치 단축키입니다. 같은 방식으로 작동합니다. 하나의 긴 파일을 여러 가상 호스트와 함께 sites_available 폴더에 저장하고 filename.conf 아래에 저장 한 다음 한 번에 사용할 수 있습니다.

sudo a2ensite filename 

처음에는 편리하지만 시간이 오래 걸리면 편리합니다.

+0

나는이 메시지를 받는다. 제어 프로세스가 오류 코드와 함께 종료 되었기 때문에 apache2.service 작업이 실패했다. 자세한 내용은 "systemctl status apache2.service"및 "journalctl -xe"를 참조하십시오. – alwayslearning

+0

그런 세부 정보의 오류는 무엇입니까? –

관련 문제