LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2003, 11:34 AM   #1
spoody_goon
Member
 
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Rep: Reputation: 30
Apache set up


I am setting up my pc to run like an internet server so I may test my cgi programs locally. I want to set up my apache server so I may have each individual test site run independantly from each other. In each folder under /var/www/html I would like them to have their own cgi-bin, I am able to run cgi/perl from /var/www/cgi-bin but not from the subdirectorys. And also set up each with their own mysql db instead of trying to run them all from localhost.
Please remember I am new to Linux and will need step by step instructions.
 
Old 10-19-2003, 11:44 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
You have 2 choices you either need to specify these directories to be script aliased - see the scriptAlias directive that is in httpd.conf for the current cgi-bin or add a Directory directive in httpd.conf for those directories and set the ExecCGI option.

For example:
Code:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.domain1.com
DocumentRoot /var/www/domain1/html
<Directory "/var/www/domain1/html">
    AllowOverride AuthConfig
    Options Includes
    Order allow,deny
    Allow from all
</Directory>
<Directory "/var/www/domain1/html/cgi-bin">
    Options ExecCGI
</Directory>
</VirtualHost>
Or:
For example:
Code:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.domain1.com
DocumentRoot /var/www/domain1/html
<Directory "/var/www/domain1/html">
    AllowOverride AuthConfig
    Options Includes
    Order allow,deny
    Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/domain1/cgi-bin/"
<Directory "/var/www/domain1/cgi-bin">
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
 
Old 10-19-2003, 01:50 PM   #3
spoody_goon
Member
 
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Original Poster
Rep: Reputation: 30
So I should place this code right after?

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.four_flags.com
DocumentRoot /var/www/four_flags/html
<Directory "/var/www/four_flags/html">
AllowOverride AuthConfig
Options Includes
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/four_flags/html/cgi-bin">
Options ExecCGI
</Directory>
</VirtualHost>


how does my web browser know that this is local and doesnt try to go to the internet for the domain name?

Last edited by spoody_goon; 10-19-2003 at 01:59 PM.
 
Old 10-19-2003, 02:14 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
If you edit /etc/hosts you should have a line with the loopback address 127.0.0.1 - just add "www.four_flags.com" after the last entry - all entries seperated by white space.
 
Old 10-19-2003, 02:44 PM   #5
spoody_goon
Member
 
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Original Poster
Rep: Reputation: 30
Hmm I'm getting the test page, I must have over looked something. The first few lines are for reference so you know where I am in httpd.config

# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.four_flags.com
DocumentRoot /var/www/four_flags
<Directory "/var/www/four_flags">
AllowOverride AuthConfig
Options Includes
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/four_flags/cgi-bin">
Options ExecCGI
</Directory>
</VirtualHost>

<IfModule mod_cgid.c>
#
# Additional to mod_cgid.c settings, mod_cgid h
 
Old 10-19-2003, 03:41 PM   #6
spoody_goon
Member
 
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Original Poster
Rep: Reputation: 30
Oh ya server name, now it works
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Set Up? carlosinfl Debian 3 08-29-2005 11:18 AM
Apache set up darkgamer20 Linux - General 17 12-11-2004 07:34 PM
how do i set up apache?? snakeo2 Linux - Newbie 1 03-27-2004 02:28 PM
How to set up apache ? sameermanagoli General 1 06-26-2003 09:34 PM
apache set up myquestion Linux - Software 1 02-21-2002 03:11 PM


All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration