Fri, 09 Apr 2004
topvirtual hosts and cgi
I had this working before, mostly with the help of this script [citation on macosxhints.com][post on patrickgibson.com] Because of my iBook mishaps, all my tweaks were wiped, and I haven't had the time to reinstate the changes.
So this is what I did (essentially doing everything that the script does manually):
- Open
/etc/httpd/httpd.conf - Find the line
#AddHandler cgi-script .cgiand remove the# - Add the following lines to the end of
/etc/httpd/httpd.conf:NameVirtualHost 127.0.0.1 Include /private/etc/httpd/virtualhosts - In
/private/etc/httpd/virtualhosts, create a file named_localhost - The contents of this file should be:
<VirtualHost 127.0.0.1> DocumentRoot "/Library/WebServer/Documents" ServerName localhost <Directory "/Library/WebServer/Documents"> Options All AllowOverride None <Directory </VirtualHost> - Again, in
/private/etc/httpd/virtualhosts, create a file with the same name as the virtual host name. For example, if you want a host that will be accessed withhttp://blog, create a file namedblog - The contents of this file should be as follows (Replace
$USERNAMEwith your username and$VHOSTNAMEwith your desired hostname<VirtualHost 127.0.0.1> DocumentRoot "/Users/$USERNAME/Sites/$VHOSTNAME" ServerName localhost <Directory "/Users/$USERNAME/Sites/$VHOSTNAME" Options Indexes FollowSymLinks ExecCGI AllowOverride All </Directory> </VirtualHost> - Open a root shell by typing
sudo bashand entering your password - Run the following commands (again, replace
$VHOSTNAMEwith your desired hostname):niutil -create . /machines/$VHOSTNAME niutil -createprop . /machines/$VHOSTNAME ip_address 127.0.0.1 niutil -createprop . /machines/$VHOSTNAME name $VHOSTNAME niutil -createprop . /machines/$VHOSTNAME serves './local' - Restart apache with
apachectl restart.
> /computers/macosx/unix > permalink > 4 comments
comments
Name/Blog: Kevlyn
URL: http://www.bing.com/
Title: zxHXPpvNxsGiuvCQxwL
Comment/Excerpt: Heck yeah this is exactly what I neeedd.
Name/Blog: zcdbubgvwim
URL: http://zksufvyhyoxv.com/
Title: OESipQofkzkB
Comment/Excerpt: bEkj2U <a href="http://oznjvttnqfef.com/">oznjvttnqfef</a>
Name/Blog: kaxwjkjlqgf
URL: http://rqlgypkgayed.com/
Title: StaEIdVOGkZTlej
Comment/Excerpt: M9RZD0 , [url=http://xytsdxbvmekr.com/]xytsdxbvmekr[/url], [link=http://mdmztfvhamvt.com/]mdmztfvhamvt[/link], http://vpyvexwzleyj.com/
Name/Blog: qfqcqvnkfs
URL: http://nenmrfjgbjqq.com/
Title: kNpxCbHiovuRusAA
Comment/Excerpt: HQk9eu <a href="http://gyliscwdzkpw.com/">gyliscwdzkpw</a>


Comment form