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.

Add Forwarder Cpanel Problem

Discussion in 'General Discussion' started by slinky, Feb 10, 2009.

  1. slinky

    slinky Well-Known Member

    Joined:
    Jul 26, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Here's a good one and hopefully someone can help me fix the solution I received. My cpanel doesn't work properly in entering a pipe - if you want to add a new pipe on some servers, you need to do the following in shell:

    Modify /etc/valias/yourdomain.com so it is like this:

    mailaccount@yourdomain.com: "|/usr/bin/php -q
    /home/youraccount/public_html/support/cli/index.php"

    This is because cpanel adds the /home/youraccount/ to the beginning of the entry for piping. This is annoying but it is what it is. Now that I know the problem of cpanel adding the bad paths, how can I modify this file? I couldn't navigate it even though I have shell access and ability to use vi. This is a very useful piece of info but I can't make use of it for my second account! LOL.
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    Try to set the pipe this way:

    Code:
    mailaccount@yourdomain.com: "| /home/youraccount/public_html/support/cli/index.php"
    and make sure you php file is executable (you can set x attribute from shell or FTP) and start with
    Code:
    #!/usr/bin/php -q
    <?
     
  3. slinky

    slinky Well-Known Member

    Joined:
    Jul 26, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    I think I found it. Need to login as root and then go back to the server root to find the etc directory.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I recommend just inserting public_html/support/cli/index.php as the pipe and performing the minor modifications to the PHP script to make it a shell script.

    This means adding this line above the first line of your file:

    Code:
    #!/usr/bin/php -q
    And also changing the file permissions to have executable permissions.

    It's much easier than constantly modifying stuff via SSH :).
     
Loading...

Share This Page