ich möchte auf meinem SUSE 12.1 Server sowohl das /srv/www/htdocs Verzeichnis (nur für hausinternen Zugriff) als auch die vHosts unter /srv/www/vhosts/* (externe Zugriffe) nutzen.
Dazu habe ich diese vHost Konfigurationsdatei unter /etc/apache2/vhosts.d/ angelegt:
NameVirtualHost *
<VirtualHost *> DocumentRoot "/srv/www/htdocs" <Directory "/srv/www/htdocs"> <IfModule sapi_apache2.c> php_admin_value open_basedir "/srv/www/htdocs:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_value open_basedir "/srv/www/htdocs:/tmp" </IfModule> Order deny,allow Deny from all Allow from 192.168 Options +Indexes </Directory> </VirtualHost>
Pro VHost lege ich immer eine Datei an die dem Aufbau deines Ersten VHosts ähnelt und einen NameVirtualHost hat. So hat ein VHost jetzt zwei "Domains" die nicht differiert werden. Lies dir mal http://httpd.apache.org/docs/1.3/vhosts/examples.html durch.