1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

HOWTO: Install all templates automatically

Discussion in 'Legacy Sitebuilder Software' started by citrus, Jan 4, 2006.

  1. citrus

    citrus Guest

    0
     
    Here is a linux shell-script, which installs all available sitebuildertemplates automatically.

    It parses the sourcecode of the SW-Soft template-download-page and installs all available templates.

    Log on your machine, where the Sitebuilder is installed.
    Create a file called templateinstaller.sh and fill it with the following code:

    Code:
    !#/bin/sh
    # This works only on Debian!
    
    touch source.txt
    > source.txt
    
    rm -rf index.html
    wget http://www.swsoft.com/en/download/sitebuilder2/templates/
    
    echo "Start downlading templates..."
    cat index.html | grep zip |  awk '{ print $2 }' > source.txt
    sed -i 's/href="//g' source.txt
    sed -i 's/">ZIP//g' source.txt
    
    mkdir tpl_zip
    
    for DOWNLOAD in `cat source.txt`
     do
            echo ""
           wget $DOWNLOAD -P ./tpl_zip
     done
    
    echo "Downloading finished..."
    
    # Installing Themes
    
    cd tpl_zip
    ls *.zip > files.txt
    sed -i 's/.zip//g' files.txt
    
    mkdir files
    for FILE in `cat files.txt`
     do
            unzip "$FILE".zip -d ./files/$FILE
     done
    
    cd files
    
    for DIR in `cat ../files.txt`
     do
            cd $DIR
            mv *.zip ../
            cd ../
     done
    
    ls *.zip > templatelist.txt
    
    sed -i 's/.zip//g' templatelist.txt
    
    for TEMPLATE in `cat templatelist.txt`
     do
            unzip "$TEMPLATE".zip -d /usr/local/sitebuilder/htdocs/repository/templates/$TEMPLATE
     done
    
    cd ../
    cd ../
    
    chown -R www-data:www-data /usr/local/sitebuilder/htdocs/repository/templates/*
    # use apache:apache on Redhat Systems, or nobody:nobody on a cPanel machine (but my experiences on a cPanel system weren't good).
    ls /usr/local/sitebuilder/htdocs/repository/templates/ > /usr/local/sitebuilder/htdocs/repository/templates/tmpl_inst
    
    echo "Install complete!"
    echo "you can delete the folder tpl_zip"
    exit 0
    
    Now do:

    # chmod +x templateinstaller.sh
    # ./templateinstaller.sh

    It takes some minutes to finish.
    After it's done you have to logon to the admininterface.

    Hope that helps somebody.

    citrus
     
  2. 'Wax'

    'Wax' Guest

    0
     
    WOW! :D

    Cool, man! Thanks a lot!
     
  3. First Hosting

    First Hosting Guest

    0
     
    A couple of errors...

    chown: `www-data:www-data': invalid user

    and none of the templates are added the admin section :(
     
  4. eilko

    eilko Regular Pleskian

    28
    73%
    Joined:
    Aug 1, 2001
    Messages:
    468
    Likes Received:
    4
    Location:
    Enschede, Netherlands
    on RHEL/CentOS systems you should use apache.apache .
     
  5. First Hosting

    First Hosting Guest

    0
     
    Thanks.

    Any reason why the templates do not show? What am I missing?
     
  6. eilko

    eilko Regular Pleskian

    28
    73%
    Joined:
    Aug 1, 2001
    Messages:
    468
    Likes Received:
    4
    Location:
    Enschede, Netherlands
    if the template directory is not owned by apache (the webuser) then the webclient can't access the direc tory and the templates don't show up.

    run

    chown -R apache:apache /usr/local/sitebuilder/htdocs/repository/templates/*

    and see if they show up
     
  7. First Hosting

    First Hosting Guest

    0
     
    Thanks, tried that - the three default ones show up fine - just none of the others :(

    Thanks anway.
     
  8. citrus

    citrus Guest

    0
     
    do you run cpanel?
    then it's nobody:nobody

    what is in your /usr/local/sitebuilder/htdocs/repository/templates/ ? there should be a lot of folders.

    You have to
    # ls /usr/local/sitebuilder/htdocs/repository/templates/ > /usr/local/sitebuilder/htdocs/repository/templates/tmpl_inst
    everytime you wan't to update your skins.
     
  9. CruzMark

    CruzMark Basic Pleskian

    24
    23%
    Joined:
    Mar 6, 2006
    Messages:
    84
    Likes Received:
    0
    This might help some of you, so I thought I'd post it.

    I just attempted to use this script for FreeBSD 5.3 and discovered that the version of sed on my machine doesn't like the '-i' flag without the name of a file extension to save a backup to.

    I changed the sed lines as follows:

    sed -i bak 's/href="//g' source.txt
    sed -i bak 's/">ZIP//g' source.txt
    sed -i bak 's/.zip//g' files.txt
    sed -i bak 's/.zip//g' templatelist.txt

    Also, FreeBSD requires the apache:apache perms, FYI.

    Otherwise, it worked perfectly! Thanks!

    (Note, modified to fix the sed lines)
     
  10. CruzMark

    CruzMark Basic Pleskian

    24
    23%
    Joined:
    Mar 6, 2006
    Messages:
    84
    Likes Received:
    0
    Hmmm... just found a problem with this. While the script worked perfectly as far as I can see, none of the templates are showing up in their categories.

    When I go into the sitebuilder interface and go to the templates section, all of the templates are listed, but their category is listed as 'none'.

    Anybody know how to link the categories back up? I can see that they are in the xsl file for each template.

    Any advice?
     
Loading...