Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localhost structure

Status
Not open for further replies.

PROFESSORSPARKIE

Instructor
Oct 24, 2002
181
0
0
US
I submitted a question back a long time ago about setting up an apache localhost for perl & mysql testing on my home computer before I run on a real server. Xampp was recommended and I got it, installed it but then was off on another project before I got it running. I am back now and have one question from those that have used this program set up. Where do I place my cgi-bin folders for my html & Perl programs?
Do I just place the two folders & their program components us sub folders in the c:\ localhost folder?

Thanks in advance for any feed back.

Computer thought: I teach a lot of programming so I can learn. You can never learn it all.
 
I don't think there are any hard and fast rules but some structure makes finding you files easier in the future.
Mine on a windows box is

c
perl
htdocs
domain1
cgi-bin
images
... files
domain2
cgi-bin
images
... files
domain3
cgi-bin
images
... files

MySQL is in program files

Keith
 
In Apache's configuration look for the DocumentRoot, this is where your will be located.

There's one global/default docroot, and then (if you have VirtualHosts set up for hosting multiple sites on different domains on the same server), each VirtualHost will probably have its own document root.

Code:
DocumentRoot /var/[URL unfurl="true"]www/html[/URL]

<Directory /var/[URL unfurl="true"]www/html>[/URL]
   Options Indexes Includes ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

...

NameVirtualHost *:80

<VirtualHost *:80>
   ServerName [URL unfurl="true"]www.mydomain.com[/URL]
   ServerAlias mydomain.com *.mydomain.com
   DocumentRoot /home/mydomain/public_html
   <Directory /home/mydomain/public_html>
      Options Indexes Includes ExecCGI
      AllowOverride None
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

These are common paths for a unix apache server but you get the idea.

You'll need a <Directory> block like those shown to set up what the settings and permissions are for the directory. ExecCGI allows perl/cgi scripts to be executed anywhere and not only in the cgi-bin.

Apache usually has a default Alias directive for /cgi-bin/, so search the config for that too and change that to where you want it to be.

Kirsle.net | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top