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.

Getting Alias in httpd.conf to work

Discussion in 'General Discussion' started by asmithjr, Nov 1, 2004.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I've been working to get an Alias to work in the httpd.conf and am stumped.

    I put "Alias /mlist/ /home/mlist/" in my httpd.conf and when I go to http://domain.com/mlist/ I get Internal Server Error.


    I have an index.php file
    Code:
    <?php
    echo "hello";
    ?>
    In the directory.

    If I make a standard .html file it works fine.

    Now, the same index.php works find in a working domain on the server.

    What gives?
     
  2. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    The directory must be enabled for PHP. If you put the file in one of your /home/username/public_html folders it should work. If I remember correctly, you may need to edit the php.ini to enable it in other directories, but I may be wrong.
     
  3. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    that does work but only if I use the domain name assiciated with the username in /home/username/public_html.

    Thanks though.

    I notice that Alias /mrtg/ /var/www/mrtg/ works just fine so I tried /var/www/mlist also.
     
  4. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    Try /usr/local/htdocs
     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    same issue.
    I must be brain dead.

    If I put a index.html file there is works just fine, if I use the index.php I get the error.

    I even tried embedding the
    <? echo "hello"; ?>
    in the index.html and it only displays the html page normally.
     
  6. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Now I am really confused.

    I did the same on another server to test it and it works as advertised.

    I believe the only diff in the apache is the PHP suEXEC Support on the server this is not working on.

    I have PHP suEXEC Support installed because I need the mail not to use nobody but the php mail scripts to run as the user.
     
  7. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    I have PHP suEXEC enabled and can run them from the /usr/local/htdocs/created_directory, without any problems. I set this up some time ago and the only thing I can think of is that I may have edited my php.ini file. Check your php.ini under the heading Paths and Directories.
     
  8. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Yes I checked this compared to other server it is working on and both match.

    I reread the post you had from before thinking that might be it, but since I had not made any changes that I could remember I had to make sure.

    The Paths and Directories both are identical on both servers.

    Thanks
     
  9. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Chirpy to the rescue

    Just wanted to post this message from chirpy;
    This fixed my problem.

    THANKS
     
    #9 asmithjr, Nov 3, 2004
    Last edited: Nov 3, 2004
  10. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    I remember that, now. Thanks for posting the resolution.
     
Loading...

Share This Page