Vhost Config issues
Jasper Frumau
jasperfrumau at gmail.com
Fri Sep 3 02:48:06 PDT 2010
OK I have activated virtualhosts by uncommenting this line in
/opt/local/apache2/httpd.conf:
$ cat httpd.conf | grep httpd-v
Include conf/extra/httpd-vhosts.conf
in httpd-vhosts.conf I have:
$ sudo cat httpd-vhosts.conf
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry
about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# 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>
So all new VirtualHost configurations in conf/extra/vhosts/ should be
loaded, right?
On Fri, Sep 3, 2010 at 1:16 PM, Jasper Frumau <jasperfrumau at gmail.com>wrote:
>
>
>> And somehow you are asking for Apache to include everything in the
>> extra/vhosts directory?
>>
>
> In httpd.conf I just saw I do no include them as I have commented them out:
>
>
> # Virtual hosts
> #Include conf/extra/httpd-vhosts.conf
>
>
> And that I need to add a vhosts.conf or adjust the file name in httpd.conf
> . I wonder how I could add more vhost files...
>
>
>>
>> You need to define a default vhost as the first vhost it loads. That
>> means, if you're automatically loading everything in extra/vhosts, write a
>> file which will sort first alphabetically and set up your default vhost in
>> that. Or define the default vhost directly in httpd.conf.
>>
>>
>>
>> > I think I should different ips per setup on my localhost, which I will
>> try shortly, but I think I have mistakes in my vhost setup as well. Any help
>> would be appreciated...
>>
>> You can use IP-based virtual hosting if you want, but there's no need to;
>> name-based virtual hosting works fine if you set it up correctly, which
>> isn't hard to do.
>>
>
> So I d not need these lines:
>
>
> ##
> > 127.0.0.1 localhost
> > 127.0.0.1 jaspersmbp
> > 127.0.0.1 dev-wordpress.com
> > 255.255.255.255 broadcasthost
> > ::1 localhost
> > fe80::1%lo0 localhost
>
> in my HOSTS file as long as I have vhost files to takae care of it? I see
> it still only understand a tiny bit...
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100903/d57865b0/attachment.html>
More information about the macports-users
mailing list