[SLUG] Apache Web Server (httpd.conf Configuration file)

Mark Feather akwexavante at hotmail.com
Mon Mar 3 22:19:01 GMT 2003


Before i make what will be a significant alteration to my Apache configuration file (httpd.conf) as detailed below, does anybody have any comments or advice!?    Proposed alterations are indented. 



I want to create cgi-bins in my user account html directories for perl and cgi scripts.  Each user account is actually a diferent project and i want to keep the scripts for each project in its own cgi-bin.   Each users home directory currently has a symlink for redirection to there html directory, these html directories are set as Default root in the (proftpd.conf) configuration file.



I want to change things for various reasons but mainly to keep projects together in there own directories, each complete with there own scripts. All projects will then be inside the directory (ftp) to allow tarred, compressed backups in one command line for all projects and there subdirectories and files.



######################################

# Aliases: Add here as many aliases as you need (with no limit). The format is 

# Alias fakename realname

 

<IfModule mod_alias.c>



Alias /user1/ "/usr/local/ftp/user1/"

Alias /user2/ "/usr/local/ftp/user2/"



<Directory "/usr/local/ftp/user*">

Authuserfile /etc/httpd/passwd

AuthGroupfile /etc/httpd/group



Options -FollowSymLinks +Includes -Multiviews +ExecCGI

AllowOverride None

Order allow,deny

Allow from All



</Directory>

 

# Note that if you include a trailing / on fakename then the server will

# require it to be present in the URL.  So "/icons" isn't aliased in this

# example, only "/icons/".  If the fakename is slash-terminated, then the 

# realname must also be slash terminated, and if the fakename omits the 

# trailing slash, the realname must also omit it.

 

Alias /icons/ "/usr/local/httpd/icons/"

 

<Directory "/usr/local/httpd/icons">

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>

 

# 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/ "/usr/local/httpd/cgi-bin/"

ScriptAlias /user1/cgi-bin/ "/usr/local/ftp/user1/cgi-bin/"

ScriptAlias /user2/cgi-bin/ "/usr/local/ftp/user2/cgi-bin/"

 

<IfModule mod_perl.c>

# Provide two aliases to the same cgi-bin directory, 

# to see the effects of the 2 different mod_perl modes.

# for Apache::Registry Mode

 

ScriptAlias /perl/          "/usr/local/httpd/cgi-bin/"

 

# for Apache::Perlrun Mode

 

ScriptAlias /cgi-perl/      "/usr/local/httpd/cgi-bin/"

</IfModule>

 

# "/usr/local/httpd/cgi-bin" should be changed to whatever your ScriptAliased

# CGI directory exists, if you have that configured.

 

<Directory "/usr/local/httpd/cgi-bin">

AllowOverride None

Options None

Order allow,deny

Allow from all

</Directory>

 

<Directory "/usr/local/ftp/user*/cgi-bin">

AllowOverride None

Options None

Order allow,deny

Allow from all

</Directory>

 

</IfModule>

# End of aliases.

 

# set /cgi-bin for CGI execution

 

<Location /cgi-bin>

AllowOverride None

Options +ExecCGI +Includes

SetHandler cgi-script

</Location>

 

<Location /user*/cgi-bin>

AllowOverride None

Options +ExecCGI +Includes

SetHandler cgi-script

</Location>



######################################



At the mo all scripts are in the servers default cgi-bin and a typical link for user1 currently reads <!--#exec cgi = "/cgi-bin/counter.pl"--> when i change things should the link be changed to read <!--#exec cgi = "/user1/cgi-bin/counter.pl"-->



Mark

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/scarborough/attachments/20030303/c0b7a19c/attachment.html


More information about the Scarborough mailing list