Tool-BarfreeBSD ArticlesSearch Our SiteHOMEfreeBSD LinksContribute to FreeBSD HelpFreeBSD FilesFreeBSD Script Corner

Setting up Virtual Domains in FreeBSD / Apache

Well with several question in the channel, and just general questions on this topic, figured I would sit down and write something... 

1. Modify the httpd.conf that is located in /usr/local/etc/apache you will need to enter the following information for a standard virtual domain :

Below is a section of the httpd.conf :

ServerAlias *
DocumentRoot /usr/home/freebsd/public_html/
ScriptAlias /freebsd-cgi-bin/ "/usr/home/freebsd/pubic_html/cgi-bin/"
ErrorLog /var/log/www/
TransferLog /var/log/www/

 ====================] END [===========================
 Once you have then modified the httpd.conf you then need to refire apache to make the changes take affect. To do this, do the following command:

                 /usr/local/sbin/apachectl restart

2. In the /etc/namedb we need to make a new .db file. We now need to edit and modify the named.conf thats located in /etc/namedb. In the named.conf
you need to have something that looks like this for this virtuals.

===================] Top [=============================
zone "" {
    type master;
    file "freebsd.db";
===================] END [============================

3. Now Kill -HUP named  if you dont know how to do this, you need to type
 "top" and look for the PID for named, once you get the number for example:

70197 root      2  0 2552K 1160K select 1  3:16 0.00% 0.00% named

we would type "kill -HUP 70197" which would restart the named daemon.


© 1997 - 20013 Defcon1, , Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of and the content's original author.

Tool-Bar-2Defcon1  Webmail