Strict Standards: Declaration of action_plugin_blog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/blog/action.php on line 13

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/indexmenu/action.php on line 13

Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldchangelog/action.php on line 8

Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldindex/action.php on line 8

Strict Standards: Declaration of action_plugin_include::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/include/action.php on line 19

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 211

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 421

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 594

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/cache.php on line 291

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/auth.php on line 154

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 73
debianでvirtualhost設定 [開発チーム]

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/f/f051c2f0d36c836bb3c4451716c0daf3.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parser/lexer.php on line 517
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/f/f051c2f0d36c836bb3c4451716c0daf3.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/f/f051c2f0d36c836bb3c4451716c0daf3.xhtml failed

▼はじめに

必ずapache2の導入されたwebサーバーで行ってください

▼設定

◇サーバー側

rootになり、apache2ディレクトリへ移動します

# cd /etc/apache2/

今回は、virtualhostのconfファイルをhost別に設定を行うため、
/etc/apache2」にvirtualhost専用ディレクトリ「vhosts.d」を作成します

/etc/apache2# mkdir vhosts.d

作成したら、apache2関連のファイルを編集します

/etc/apache2# vi httpd.conf

中身は何も書かれていないと思うので、下記を記入します
※下記は、「vhosts.d」ディレクトリ内の「conf」ファイルを読み込むことを指定しています

# Include Virtual Host Configs
Include /etc/apache2/vhosts.d/*.conf

virtualhost専用ディレクトリに移動します

/etc/apache2# cd vhosts.d

移動したら、まずテンプレートとなるものを作成してしまいます
⇒雛形として保存して、新規作成のときはコピーして使いましょう
※「test」の部分を適宜変更してください
※apache2の設定ファイルを参考にしているので、ログのフォーマットなどお好きなように変更してください

<VirtualHost *:80>
       ServerName test.com
       ServerAlias www.test.com
       DocumentRoot /var/www/test/html

       <Directory "/var/www/test.com/html">
               AllowOverride All
               allow from all
               Order Deny,Allow
               Allow from All
               DirectoryIndex index.php index.html index.htm
       </Directory>

       ServerSignature Off
       ErrorLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/error.test.%Y-%m-%d.log\" 86400 540"
       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\"" combined
       CustomLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/access.test.%Y-%m-%d.log\" 86400 540" combined
</VirtualHost>

では、雛形である「template」をコピーして、作成していきます

今回は、「kuma.conf」「neko.conf」の2つを作成していきます

kuma.conf
<VirtualHost *:80>
       ServerName kuma.com
       ServerAlias www.kuma.com
       DocumentRoot /var/www/kuma/html

       <Directory "/var/www/kuma/html">
               AllowOverride All
               allow from all
               Order Deny,Allow
               Allow from All
               DirectoryIndex index.php index.html index.htm
       </Directory>

       ServerSignature Off
       ErrorLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/error.kuma.%Y-%m-%d.log\" 86400 540"
       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\"" combined
       CustomLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/access.kuma.%Y-%m-%d.log\" 86400 540" combined
</VirtualHost>
neko.conf
<VirtualHost *:80>
       ServerName neko.com
       ServerAlias www.neko.com
       DocumentRoot /var/www/neko/html

       <Directory "/var/www/neko/html">
               AllowOverride All
               allow from all
               Order Deny,Allow
               Allow from All
               DirectoryIndex index.php index.html index.htm
       </Directory>

       ServerSignature Off
       ErrorLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/error.neko.%Y-%m-%d.log\" 86400 540"
       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\"" combined
       CustomLog "|\"/usr/sbin/rotatelogs\" \"/var/log/apache2/access.neko.%Y-%m-%d.log\" 86400 540" combined
</VirtualHost>

設定が完了したら、それぞれのドキュメントルートを作成し、index.htmlを作成します

# mkdir -p /var/www/kuma/html
# mkdir -p /var/www/neko/html

「/var/www」にapacheのデフォルトindexページがあるので、各htmlフォルダにコピーして書き換えます

# cp /var/www/index.html /var/www/kuma/html
# cp /var/www/index.html /var/www/neko/html
# vi /var/www/kuma/html/index.html
<html><body><h1>It 192.168.10.92 KUMA works!</h1></body></html>
# vi /var/www/neko/html/index.html
<html><body><h1>It 192.168.10.92 NEKO works!</h1></body></html>

apache2の再起動かリロードをします

# /etc/init.d/apache2 reload

◇PC側

リロードが完了したら、今度はhostsファイルの書き換えられるPCを探します
※サーバーと同じネットワーク内にあるPCにしなければ、ブラウザからアクセスできませんのでご注意

今回探し当てたのはXPだったので、
C:\WINDOWS\system32\drivers\etc」にある「hosts」ファイルを書き換えます
念のため、必ずバックアップを取ってください!!!!

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
192.168.10.92	kuma.com
192.168.10.92	neko.com

ファイルを書き換えたら、ブラウザから「http://kuma.com/」と「http://neko.com/」にアクセスし、それぞれのドキュメントルートのインデックスページが見れれば成功です

▼参考URL

debianでvirtualhost設定.txt · 最終更新: 2010/07/27 15:47 (外部編集)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 81