Vhost Config issues
Jasper Frumau
jasperfrumau at gmail.com
Thu Aug 19 00:12:02 PDT 2010
I used Scottt Haneda's instructions:
I use that file as my catch all for non configured hosts, [1] [2] [3] [4]
> [5] from above, with the following:
> $cat /opt/local/apache2/conf/extra/httpd-vhosts.conf
> # -- BEGIN --
> # Virtual Hosts
> # Use name-based virtual hosting. 'Catch All'
> NameVirtualHost *:80
>
> # Default, this will catch all non configured hosts
> # because there is no explicit ServerName or ServerAlias defined
> <VirtualHost *:80>
> ServerAdmin scott at example.com
> DocumentRoot "/opt/local/www"
> </VirtualHost>
>
> # Pull in all my virtual hosts, which are filename format of
> hostname.example.com.conf
> # ie: ends in .conf
> Include conf/extra/vhosts/*.conf
> # -- END --
>
> For your example:
> /opt/local/apache2/conf/extra/vhosts/dev.thesamiis.com.conf
> /opt/local/apache2/conf/extra/vhosts/phpmyadmin.conf
> /opt/local/apache2/conf/extra/vhosts/dev.lesamisdestan.com.conf
>
> Each of those will allow me to define for just that host, what I want the
> settings to be.
> * Below is a snipped version of my template file, in general it is more
> complex, with log locations, log levels, aliases, default favicon, etc but
> this should work for a dev box.
>
> $cat template.txt
> # START example.com
> <VirtualHost *:80>
> DocumentRoot "/opt/local/www/clients/last.first/example.com"
> ServerAdmin user at example.com
> ServerName example.com
> ServerAlias www.example.com
> DirectoryIndex index.html
>
> # php setttings
> php_admin_value open_basedir "/opt/local/www/clients/last.first/
> example.com/:/private/var/tmp/:"
> php_value engine off
>
> <Directory "/opt/local/www/clients/last.first/example.com">
> Options FollowSymLinks
> AllowOverride All
> Order allow,deny
> allow from all
> </Directory>
> </VirtualHost>
> # END example.com
>
> When I need to add a new host, I will:
> `cp -p /opt/local/apache2/conf/extra/vhosts/template.txt
> /opt/local/apache2/conf/extra/vhosts/foo.example.com.conf`
> I then find and replace relevant strings and issue `apachectl graceful`. I
> also have a template directory that I will copy in with:
> `cp -Rp /opt/local/www/clients/template
> /opt/local/www/clients/last.first/example.com`.
>
I created a vhosts folder and used an include in the standard
httpd-vhosts.conf to load those. In wordpress.conf I now have:
START example.com
<VirtualHost *:80>
DocumentRoot "/opt/local/www/wordpress/"
ServerAdmin user at example.com
ServerName dev-wordpess.com
ServerAlias www.dev-wordpress.com
DirectoryIndex index.php
# php setttings
# php_admin_value open_basedir "/opt/local/www/clients/last.first/
example.com/:/private/var/tmp/:"
#php_value engine off
<Directory "/opt/local/www/wordpress/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
# END example.com
And in httpd-vhosts.conf I have:
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster at dummy-host.example.com
DocumentRoot "/opt/local/www/"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
#
# Pull in all my virtual hosts, which are filename format of
hostname.example.com.conf
# ie: ends in .conf
Include conf/extra/vhosts/*.conf
# -- END --
#
#<VirtualHost *:80>
# ServerAdmin webmaster at dummy-host2.example.com
# DocumentRoot "/opt/local/apache2/htdocs/apt1"
# ServerName apt1
#</VirtualHost>
Which somehow leads to /opt/local/www/drupal-1.6.15 folder instead of
/opt/local/www/wordpress. In vhosts I added
127.0.0.1 dev-wordpress.com
As dev-wordpress is crealry wrongly redirected I made a mistake in the
wordpress.conf or hosts file. Anybody any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100819/9870572e/attachment.html>
More information about the macports-users
mailing list