| >> HOME >> FC5 MENU >> Apache バーチャルホスト設定 |
 |
|
|
|
|
|
|
|
|
|
|
| |
|
|
| |
|
|
| |
[root@linux ~]# useradd virtual
[root@linux ~]# passwd virtual
Changing password for user virtual.
New UNIX password: xxxxxxxxxx
Retype new UNIX password: xxxxxxxxxx
passwd: all authentication tokens updated successfully.
|
|
|
| |
|
|
| |
[root@linux ~]# chmod 711 /home/virtual 
|
|
|
|
|
|
| |
[root@linux ~]# su - virtual
[virtual@linux ~]$ mkdir /home/virtual/html
[virtual@linux ~]$ mkdir /home/virtual/cgi-bin
[virtual@linux ~]$ chmod 755 /home/virtual/html /home/virtual/cgi-bin
[virtual@linux ~]$ exit 
|
|
|
|
|
|
| |
|
|
| |
[root@linux ~]# vi /etc/httpd/conf/httpd.conf
:
:
### Section 3: Virtual Hosts
#
# VirtualHost: 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.2/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.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
#
# Directives to allow use of AWStats as a CGI
#
#Alias /awstatsclasses "/root/wwwroot/classes/"
#Alias /awstatscss "/root/wwwroot/css/"
#Alias /awstatsicons "/root/wwwroot/icon/"
#ScriptAlias /awstats/ "/root/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
#<Directory "/root/wwwroot">
# Options None
# AllowOverride None
# Order allow,deny
# Allow from all
#</Directory>
<Directory "/home/virtual/html">
Options Includes ExecCGI FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/home/virtual/cgi-bin">
Options None
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName mountainbigroad.jp
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@virtual.jp
ServerName virtual.jp
DocumentRoot /home/virtual/html/
ErrorLog logs/virtual-error_log
CustomLog logs/virtual-access_log combined env=!no_log
ScriptAlias /cgi-bin/ "/home/virtual/cgi-bin/"
</VirtualHost>
|
|
|
|
|
|
| |
|
|
| |
|
|
| |
[root@linux ~]# vi /etc/httpd/conf.d/ssl.conf
:
:
# Per-Server Logging:
# The home of a custom SSL log file. Use this when you want a
# compact non-error SSL logfile on a virtual host basis.
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "logs/rewrite_log"
RewriteLogLevel 0
RewriteCond %{HTTP_HOST} !mountainbigroad.jp$
RewriteRule ^/(.*)?$ http://%{HTTP_HOST}/$1 [L,R]
</IfModule>
</VirtualHost>
|
|
|
|
|
|
| |
|
|
| |
[root@linux ~]# service httpd restart
httpdを停止中: [ OK ]
httpd を起動中: [ OK ]
|
|
|
|
|
|
| |
|
|
| |
[root@linux ~]# vi /etc/named.conf
:
:
|
|
|
| |
|
|
| |
[root@linux ~]# vi /var/named/virtual.jp.db
$TTL 86400
@ IN SOA virtual.jp. root.virtual.jp.(
2006071100 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS virtual.jp.
IN MX 10 virtual.jp.
IN A 192.168.1.11
www IN CNAME virtual.jp.
|
|
|
|
|
|
| |
|
|
| |
[root@linux ~]# service named restart
namedを停止中: [ OK ]
namedを起動中: [ OK ]
|
|
|
|
|
|
| |
|
|
 |
|
 |
 |