I keep adding more vhosts and enabling them but all the sites always do to the default vhost in sites-available
here is what the default kind of looks like with me only changing the ip for security reasons
<VirtualHost 167.889.88.88:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
and here is my other which i named some-site.net
<VirtualHost *:80>
ServerName some-site.net
DocumentRoot "/var/www/vhosts/somesite.com/http/"
<Directory "/var/www/vhosts/somesite.com/http/">
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
and it turned on my this command
sudo a2ensite some-site.net
Enabling site some-site.net.
Run '/etc/init.d/apache2 reload' to activate new configuration!
then i reloaded
/etc/init.d/apache2 reload
* Reloading web server config apache2
...done.
but when i visit the url some-site.net i get the index page that is for the default vhost...what am i doing wrong
First guess, you need the NameVirtualHost statement in your httpd.conf file. Also, as a sanity check, I'm assuming you have the correct blocks?
What do you get when you run
apachectl -S
?In your first block you do not have a ServerName specified and Apache is matching the incoming request to the IP. The problem is with the mix of IP and Name based virtual server configuration.
To further rule out the problem out a ServerName directive in your virtual server directive which start as follows.
VirtualHost 167.889.88.88:80
Add following lines in
/etc/hosts
file: