Ciekawy Posted October 5, 2008 Share Posted October 5, 2008 I have a weird problem that i cannot find answer for anywhere. I have a DYNDNS domain (somedomain.selfip.org) with wildcards enabled that points to a router/firewall/NAT running Tomato (a.somedomain.selfip.org). On the router i have a forwarding of port 80 enabled pointing to a host on a local network (b.somedomain.selfip.org), that is running a Apache 2.2 server. On that server i would like to host following domains: 1. somedomain.selfip.org, www.somedomain.selfip.org, b.somedomain.selfip.org, b pointing to /var/www/apache2-default 2. user1.somedomain.selfip.org, user2.somedomain.selfip.org pointing to /var/www/user12 My current config is: In /etc/apache2/httpd.conf NameVirtualHost *:80 <IfModule mod_ssl.c> NameVirtualHost *:443 </IfModule> In /etc/apache2/sites-available/default <VirtualHost *:80> ServerName somedomain.selfip.org ServerAlias somedomain.selfip.org b.somedomain.selfip.org b ServerAdmin [email protected] DocumentRoot /var/www/apache2-default/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/default/error.log LogLevel debug CustomLog /var/log/apache2/default/access.log combined ServerSignature On </VirtualHost> In /etc/apache2/sites-available/user12 <VirtualHost *:80> ServerName user1.somedomain.selfip.org ServerAlias user2.somedomain.selfip.org ServerAdmin [email protected] DocumentRoot /var/www/user12/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/user12/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/user12/error.log LogLevel debug CustomLog /var/log/apache2/user12/access.log combined ServerSignature On </VirtualHost> The problem is that whatever subdomain i enter: user1.somedomain.selfip.org user1.somedomain.selfip.org (even a non-existent ones line - idontexist.somedomain.selfip.org) i get the site form first virtual host. What could be the problem. Ciekawy Link to comment https://forums.phpfreaks.com/topic/127108-problem-with-virtual-hosts/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.