The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Alias in httpd.conf

Discussion in 'General Discussion' started by asmithjr, Dec 27, 2008.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I have software that I want to share with all clients on the server. In the past years ago I installed something similar in /var/www/html/folder then in the httpd.conf I used Alias /folder/ /var/www/html/folder/ and it worked but I cannot for the life of me remember the steps to make this work other than what I just stated.
    I seem to remember I had to touch some other file btu it may just be a case of Apache 2 not suporting this.

    Does anyone know what I am missing?
     
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    ok so after a long night I finally place a index.html in the folder and it works so the issue is the index.php brings up a 500 error.

    I tried changing perms to 755 (not needed) and did not help.

    So with my Alias directive
    Alias icons /var/www/icons

    the index.html works when I go to www.domain.com/icons/index.html but the www.domain.com/icons/index.php gives a 500 error.
     
  3. Voltar

    Voltar Well-Known Member

    Joined:
    Apr 30, 2007
    Messages:
    269
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bakersfield, California
    Shouldn't it be...

    Alias /icons /var/www/icons


    Also, as for the 500 error, are you running suPHP? If so you may have to chown/chmod the files correctly and add a directive or two along with your Alias directive to get it working properly. Check your error logs.
     
  4. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Sorry that was a typo. Yes it is Alias /icons /var/www/icons and I tried Alias /icons/ /var/www/icons/ also.
    the index.html works fine it is the index.php or any .php file I try to use even something simple like
    <?php echo "hello"; ?>

    I even tried placing that inside the body of that index.html that works.
     
  5. Voltar

    Voltar Well-Known Member

    Joined:
    Apr 30, 2007
    Messages:
    269
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bakersfield, California
    If you're getting 500 errors with any PHP content then, it would make me think you're running suPHP and the owner of the files (possibly root?) is below the minimum UID. Try accessing the script and then check /usr/local/apache/logs/error_log right afterward to see if you have some info to help.
     
  6. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Alias /helpers/ /var/www/html/helpers/
    when I access I get this. so the UID is the issue but what to do to work around this?

    [Mon Dec 29 07:25:13 2008] [error] [client 67.191.190.202] SoftException in Applic
    ation.cpp:303: UID of script "/var/www/html/helpers/index.php" is smaller than min
    _uid
    [Mon Dec 29 07:25:13 2008] [error] [client 67.191.190.202] Premature end of script
    headers: index.php
    [Mon Dec 29 07:25:13 2008] [error] [client 67.191.190.202] File does not exist: /h
    ome/janescri/public_html/500.shtml
     
  7. Voltar

    Voltar Well-Known Member

    Joined:
    Apr 30, 2007
    Messages:
    269
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bakersfield, California
    I believe you would have to do something like this, although this is off the top of my head...

    Code:
    Alias /icons /var/www/icons
    <Directory /var/www/icons>
        <IfModule mod_suphp.c>
            suPHP_UserGroup user group
        </IfModule>
    </Directory> 
     
  8. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Thanks!!!!!!
     
Loading...

Share This Page