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.

Web-accessible folder/script for all user accounts on WHM, how to?

Discussion in 'General Discussion' started by kenshin23, Jul 23, 2014.

  1. kenshin23

    kenshin23 Registered

    Joined:
    Jul 23, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi all, I have a question regarding a web-accessible folder/script for all user accounts on WHM; I'm quite new to WHM/cPanel, so please bear with me on this.

    (I've already seen this: http://forums.cpanel.net/f185/whm-domain-user-cross-folder-permission-286382.html, but couldn't/didn't know how to get it -specifically, the "b" option- to work.)

    Here's what I'm attempting to do:

    The server has a number of accounts, each connected to a web store. Someone from dataentry needs to upload images to every store, but it's annoying to upload the same images to each store separately.

    I wrote a PHP script that takes those images, and based on a previous store selection, uploads those images to each relevant store's image folder. However, I'm running into permission issues since I'm running the script from inside one of the stores (so, since the script is running from /home/store_a/public_html/... when trying to access /home/store_b/... it returns with a "permission denied" error), so I tried the above URL for options.

    I've tried placing a test script on /usr/local/apache/htdocs and /usr/local/cpanel/htdocs and calling it like this:

    http://server_ip/test.php

    but I get either a 500 error on the Apache folder or an "ERR_CONNECTION_RESET" error on the Cpanel folder. Any ideas or suggestions on how to do this? I should add that making and testing a simple HTML file on the Apache folder does work, just not a PHP script.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. kenshin23

    kenshin23 Registered

    Joined:
    Jul 23, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes, I'm aware of the security implications, but I'm just trying to find a way to get this to work.

    An outside-the-box approach (as explained by my employer) would be to set up a cron job as root, that checks the contents of the uploaded images folder for each account every n minutes, and if there are images there, move them to each user's images folder, as needed. He mentioned using a lock file to make sure that no files are moved if there's an upload operation in progress. I figure that would be better, security-wise (obviously, care will be taken to make sure only image files are moved to the folders.)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. kenshin23

    kenshin23 Registered

    Joined:
    Jul 23, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you very much for your help. The script + cron job solution is working perfectly so far, and with no security issues, I hope.
     
Loading...

Share This Page