![]() |
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. |
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> For example: Code:
<VirtualHost xxx.xxx.xxx.xxx:80> |
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? |
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.
|
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 |
Oh ya server name, now it works
|
All times are GMT -5. The time now is 08:15 AM. |