LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache set up (https://www.linuxquestions.org/questions/linux-newbie-8/apache-set-up-105920/)

spoody_goon 10-19-2003 10:34 AM

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.

david_ross 10-19-2003 10:44 AM

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>


spoody_goon 10-19-2003 12:50 PM

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?

david_ross 10-19-2003 01:14 PM

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.

spoody_goon 10-19-2003 01:44 PM

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

spoody_goon 10-19-2003 02:41 PM

Oh ya server name, now it works


All times are GMT -5. The time now is 08:15 AM.