apache alias and script alias problem

apache alias and script alias problem

Post by Andr » Sun, 24 Mar 2002 08:57:09



Hello .linux.misc.

I am trying to set Apache to run for me using Alias and Script Alias
options and I am having problems doing it.  I figured this may be a
common rookie mistake.  I am running version 1.3.22 with basically the
default install.

I thought (as you will see from my httpd.conf file) I set the alias's
to achieve my desired affect of "http://localhost/cgi-bin/user1"
translating to a cgi directory on the filesystem at
"/home/user1/cgi-bin/" and the user1 script however when I check my
logs I see the alias is not working.  I could not get a regular Alias
to work either.  I check the logs the location the logs say are
attempting to be accessed are:

[Fri Mar 22 16:31:55 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 16:32:05 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 18:05:18 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 18:07:45 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 18:07:53 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 18:08:38 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1
[Fri Mar 22 18:08:42 2002] [error] [client 127.0.0.1] File does not
exist: /var/www/html/cgi-bin/user1

The file does exist with the proper permissions (755) at
"/home/user1/cgi-bin/"

RH 7.2
kernel 2.4.7-10

Am I missing something obvious?  I appreciate any feedback and thanks
for the advice in advance.

---
Andrew

Please remove TOREMOVE chars to e-mail me

I have listed potentially important parts of my httpd.conf file below
in case it helps:

ServerType standalone

ServerRoot "/etc/httpd"

LockFile /var/run/httpd.lock

PidFile /var/run/httpd.pid

ScoreBoardFile logs/apache_runtime_status

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

MinSpareServers 5
MaxSpareServers 20

StartServers 8

MaxClients 150

MaxRequestsPerChild 1000

# module info in here

User apache
Group apache


DocumentRoot "/var/www/html"
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">

    Options Indexes FollowSymLinks

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

<IfModule mod_alias.c>

    #
    # 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/ "/var/www/icons/"
    #Alias /cgi-bin/ "/home/user1/cgi-bin/"

    <Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    # This Alias will project the on-line documentation tree under
/manual/
    # even if you change the DocumentRoot. Comment it if you don't
want to
    # provide access to the on-line documentation.
    #
    # Alias /manual/ "/etc/httpd/htdocs/manual/"
    #
    # <Directory "/etc/httpd/htdocs/manual">
    #     Options Indexes FollowSymlinks 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/ "/var/www/cgi-bin/"
    ScriptAlias /cgi-bin/ /home/user1/cgi-bin

    #
    # "/var/www/cgi-bin" should be changed to whatever your
ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

</IfModule>

 
 
 

apache alias and script alias problem

Post by Adaptr » Sun, 24 Mar 2002 13:04:59



<over-spurious snippage>

Quote:>     # 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/ "/var/www/icons/"
>     #

READ what this says...CLOSELY

<snipped>

Quote:>     #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>     ScriptAlias /cgi-bin/ /home/user1/cgi-bin

You forgot to include the trailing / on the directory name...
Yes, you're going to kick yourself.

 
 
 

1. script alias problem - Re: apache alias and script alias problem

I actually did not have the <Directory> setup properly.

I am still having a problem with the script alias.

For example.

I set an alias -

Alias / /home/user1/html/

and a Script Alias -
ScriptAlias /cgi-bin/ /home/user/cgi-bin/

However the script alias is not working because the log shows that
when entering:
http://localhost/cgi-bin/

/home/user/html/cgi-bin/ is actually being referenced.

When I remove the first Alias statement the cgi-bin script directory
is properly aliased.

Any suggestions.

Thanks.

---
Andrew

Please remove TOREMOVE chars to e-mail me

2. problems with FIND cmd

3. aliases, aliases, aliases...

4. /dev/cua0: Permission Denied...

5. SENDMAIL problem: Aliasing non-local names in /etc/mail/aliases

6. mouse not found

7. Apache Permissions, Directory Indexes, Script Alias

8. Flickering Screen

9. Apache/Script Alias

10. how to get the alias directories in apache in a CGI script?

11. APACHE 0.8.10 AND SCRIPT ALIAS FOR VIRTUAL DOMAINS

12. listing aliases w/o /etc/aliases

13. SB Live Value...alias char-major-14 is alias'd twice ???