Fri, 09 Apr 2004

top

virtual hosts and cgi

<<reverse < index > forward>>

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):

  1. Open /etc/httpd/httpd.conf
  2. Find the line #AddHandler cgi-script .cgi and remove the #
  3. Add the following lines to the end of /etc/httpd/httpd.conf: NameVirtualHost 127.0.0.1 Include /private/etc/httpd/virtualhosts
  4. In /private/etc/httpd/virtualhosts, create a file named _localhost
  5. 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>
  6. 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 with http://blog, create a file named blog
  7. The contents of this file should be as follows (Replace $USERNAME with your username and $VHOSTNAME with 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>
  8. Open a root shell by typing sudo bash and entering your password
  9. Run the following commands (again, replace $VHOSTNAME with 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'
  10. Restart apache with apachectl restart.

15:10:46 9 Apr 2004 > /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

Name:
URL/Email:
[http://... or mailto:you@w...] (optional)
Title:
(optional)
Comments:
Save my Name and URL/Email for next time
To prevent comment spam, please retype the characters in this image
Enter the text here: