1

I'm looking at something like this: Multiple domains (including www-"subdomain") on apache?

And I'm too dumb to figure out how to get 1 subdomain to direct to 1 place.

I need

phpmyadmin.site.com/

to go to

/vol/www/phpMyAdmin

# Listen for virtual host requests on all IP addresses
NameVirtualHost phpmyadmin.site.com

<VirtualHost phpmyadmin.site.com>
DocumentRoot /vol/www/phpMyAdmin
ServerName phpmyadmin.site.com

# Other directives here

</VirtualHost>

just goes to site.com (i've restarted)

Thanks in advance.

2 Answers2

0

Here's a sample:

NameVirtualHost *
<VirtualHost *>
    ServerName phpmyadmin.site.com
    DocumentRoot /vol/www/phpMyAdmin
    <Directory "/vol/www/phpMyAdmin">
        AllowOverride All
        Allow from all
    </Directory>
</VirtualHost>

This means receive requests to any ip (*)
This virtual host exists on all ips (*)

It responds to the request using ServerName in the URI
and it serves from the DocumentRoot specified

Make sure you have the <directory> directive too.

davidosomething
  • 175
  • 1
  • 8
0

Here is excerpt from my apache config:

<VirtualHost *:80>
    ServerAdmin webmaster@xxx.com
    ServerName  xxx.com
    ServerAlias www.xxx.com
    DocumentRoot /srv/www/htdocs/xxx.com
    ErrorLog  /var/log/apache2/xxx.com-error_log
    CustomLog /var/log/apache2/xxx.com-access_log combined

   <Directory "/srv/www/htdocs/xxx.com">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName  phpMyAdmin.xxx.com
    DocumentRoot /srv/www/htdocs/xxx.com/phpMyAdmin
    ErrorLog  /var/log/apache2/phpMyAdmin.xxx.com-error_log
    CustomLog /var/log/apache2/phpMyAdmin.xxx.com-access_log combined

   <Directory "/srv/www/htdocs/ccc.com/phpMyAdmin">
        AllowOverride All
        Options +FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
Andrejs Cainikovs
  • 1,621
  • 1
  • 14
  • 20