/etc/apache2/sites-available/phpmyadmin.conf
Код: Выделить всё
<VirtualHost *>
DocumentRoot "/home/anton/vhosts/phpmyadmin"
ServerName phpmyadmin
ServerAdmin webmaster@localhost
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Directory "/home/anton/vhosts/phpmyadmin">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Код: Выделить всё
127.0.0.1 localhost phpmyadmin
127.0.1.1 anton-MS-7392
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Код: Выделить всё
$ curl -sH "Host: phpmyadmin" http://127.0.0.1/
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>
Код: Выделить всё
$ apache2ctl -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server localhost (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default.conf:1)
*:* is a NameVirtualHost
default server phpmyadmin (/etc/apache2/sites-enabled/phpmyadmin.conf:1)
port * namevhost phpmyadmin (/etc/apache2/sites-enabled/phpmyadmin.conf:1)
port * namevhost phpmyadmin (/etc/apache2/sites-enabled/phpmyadmin.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used