Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default /scripts/wwwacct modification problem

    Hi,
    I am trying to modify my wwwacct script, to change the permissions of "public_html" of new accounts, it was discussed here:
    http://forums.cpanel.net/showthread.php?t=40360
    The newly modified wwwacct works fine, does what I need it to do, but the problem is,
    after a while it gets owerwritten back to old version, as if I never modifyed it.
    Does anyone know why is it happening? How can I make permanent changes to wwwacct ?
    I never had this problem on my old 2 servers, but on this new one something keeps owerwriting my modifyed wwwacct...
    Thank you
    Alex

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Whenever you run upcp (e.g. when it runs overnight) it will replace any modified scripts. If you want to have code run after wwwacct then you should create a new script called /scripts/postwwwacct and chmod +x it and it will be run after wwwacct, i.e. put your chmod into that file after creating it. That said, why are you changing the default public_html permissions?
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    Thank you for your reply,
    I need it for my php scripts, they need to be able to create new files in newly created accounts.
    Strange thing is, on my other servers modified wwwacct is never owerwritten, it just stays the way I need it.
    How can I disable runing of upcp completely?
    If its not possible to do that, can I use wwwacct variables in postwwwacct?
    Will this work in postwwwacct?

    chmod(0777,"$mnt/$user/public_html");

    Thank you,
    Alex

  4. #4
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    Tryed to create postwwwacct, but it does not seem to execute... ((
    here it is:
    --------------------------------------------------------
    #!/usr/bin/perl
    chmod(0777,"$mnt/$user/public_html");
    mkdir("$mnt/$user/public_html/zz",0755);
    -------------------------------------------------------
    last line, mkdir, is just to see if its working, but it does not work
    it does not create public_html/zz

    ps. I did chmod it +x

  5. #5
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Take a look at some of my postwwwacct scripts for some samples and the variables.
    (scripts link in my sig)
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  6. #6
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    Thank you, I checked the scripts, and changed my postwwwacct to:
    ------------------------
    #!/usr/bin/perl
    print "Creating ZZ dir\n";
    chmod(0777,"/home/$ARGV[1]/public_html");
    mkdir("/home/$ARGV[1]/public_html/zz",0755);
    ------------------------
    But it still does not work, it does not print anything, and it does not create public_html/zz

  7. #7
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    Just a shot in the dark . . . since your postwwwacct script doesn't do anything it probably isn't being executed, perhaps you could check the ownership and permissions?

  8. #8
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    That's a possibility. The script should be owned by root and set to 700.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  9. #9
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    here is my postwwwacct permissions:

    -rwxr-xr-x 1 root root 134 Sep 3 12:49 postwwwacct*

  10. #10
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Try adding this line

    use CGI::Carp qw(fatalsToBrowser);

    to the script after the first line and see if it prints anything to the screen.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  11. #11
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    I've tried that and it still does not seem to work

    I've disabled cron job for "upcp", and everything seems to be fine now, my modified wwwacct
    is not overwritten anymore, but I wonder, does "upcp" do something usefull?
    Is it not a good idea to disable it?
    Thanks a lot to all replyed
    Alex

  12. #12
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    PM me if you want me to take a look.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

Similar Threads & Tags
Similar threads

  1. /scripts/wwwacct errors
    By jefferyw18 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-03-2009, 08:44 PM
  2. Apache /scripts/wwwacct
    By easyhoster1 in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 08-26-2005, 06:35 AM
  3. changed wwwacct in scripts
    By dory36 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-19-2004, 01:41 PM
  4. /scripts/wwwacct / Modernbill
    By jackal in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-06-2003, 08:03 PM
  5. Modifying /scripts/wwwacct
    By nu-steve in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 07-25-2002, 03:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube