Apache2 & Virtual Hosts - picking up ports but all direct to same directory

Hello, I think this is an easy one for the Apache gurus.

My problem is that I seem to be able to add ports but not virtualhosts on the ports pointing to different directories. I ran YaST httpd once but I deleted the files it created in /etc/apache2/vhosts.

Then I did as suggested at the bottom of /etc/apache2/httpd.conf and editted /etc/sysconfig/apache2 so it reads

APACHE_CONF_INCLUDE_FILES="/home/Server/web/httpd.conf"

In this file it points to I did the following:

#Default port 80.
<VirtualHost *:80>
  DocumentRoot "/home/Server/web/monsterhunter"
  <Directory "/home/Server/web/monsterhunter">
      Options Indexes FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>
</VirtualHost>

#phpMyAdmin
Listen 8090
<VirtualHost *:8090>
  DocumentRoot "/srv/www/htdocs/phpMyAdmin"
  <Directory "/srv/www/htdocs/phpMyAdmin">
      Options Indexes FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>
</VirtualHost>

And a few more blocks like below the #phpMyAdmin comment to point to different ports/directories.
The “Listen ##” part seems to work as my server is accessible on several ports, everything below that however doesn’t seem to be working. The file is definitely being read as adding more listen ports works 100% fine, but they all point to the same directory as defined for port 80.

So the question is how do I get the different ports to point to different directories?

#phpMyAdmin
Listen 8090
NameVirtualHost *:8090
<VirtualHost *:8090>
  DocumentRoot "/srv/www/htdocs/phpMyAdmin"
  <Directory "/srv/www/htdocs/phpMyAdmin">
      Options Indexes FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>
</VirtualHost>

Fixed, marked the change in pink. Amazing how a lot of forum posts and even how to’s on this subject list things you all need to do the same thing spread out miles apart. I much prefer have it all in one clump like this so adding (copy/paste/edit) or removing can be done much more easily.

Well, since this is on openSUSE: use Yast’s http module. It’ll do the job for you.

I never was able to successfully pull this this off in YaST. I tried fiddling around in the vhost section of the http server module before but I never got it to run on multiple ports and still not sure if that’s even possible. Biggest problem for me is that it makes all changes in /etc/apache2/vhosts which makes backing things up more complicated.