Announcement

Collapse
No announcement yet.

Howto : Building Debian Linux server with CCcam

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Howto : Building Debian Linux server with CCcam

    This How-to will give you a handout to install CCcam php webinfo tool by Toogoody on you're debian linux server.

    Requirements:
    Putty
    cccamPHPinfo

    Changing apache2
    If you followed the above how-to, there is allready an apache2 server up and running on you're server. All we have to do is make some small modifications to get it ready to run the PHP webinfo tool.

    Log into you're linux server with putty so we can change the owner of the webroot directory and enable you to upload files to it.
    You need to replace <username> with the username you created during the installation

    Code:
    chmod 775 /var/www chown <username> /var/www


    Now you can use an FTP program to upload the content of the cccamphpinfo.zip to /var/www

    Once you've done this, you can use putty again to edit config.php and the default apache2 config so the right index file will be accessed when you use explorer.

    Code:
    vim /var/www/config.php


    You can remove these 2 lines

    Code:
    $CCCamWebInfo[] = array("localhost","12345","user","pass"); // for CCcam webinterface with user and pass $CCCamWebInfo[] = array("localhost","12345");          // for CCcam webinterface with different port than default and without user and pass


    and edit this line

    Code:
    $work_path = ""



    $work_path = "/tmp/"

    Once you have done this, the webinfo tool is allready working however it will not be the default page when you open the homepage of you're linux server in mozilla or internet explorer. When you try it, all you will see is a big text stating

    To change this we have to change the following:

    vim /etc/apache2/sites-enabled/000-default

    Code:
     <Directory /var/www/>                 Options Indexes FollowSymLinks MultiViews                 AllowOverride None                 Order allow,deny                 allow from all                 # This directive allows us to have apache2's default start page                 # in /apache2-default/, but still have / go to the right place                 RedirectMatch ^/$ /apache2-default/         </Directory>
    into

    Code:
            <Directory /var/www/>                 Options Indexes FollowSymLinks MultiViews                 AllowOverride None                 Order allow,deny                 allow from all         </Directory>
    When you restart apache (/etc/init.d/apache2 start|stop|reload|restart|configtest), it's default starting page will now be the cccam webinfo tool.

    Adding cronjobs

    With the latest ccamPHPinfo tools, you can add cronjobs to refresh the statistics on an hourly base.
    This can be done by adding 2 cronjobs.

    Code:
    vim /etc/crontab
    and add these 2 lines

    Code:
    02 * * * * root wget -O - http://localhost/cron_update.php?p=1 >/dev/null 2>&1 30 * * * * root wget -O - http://localhost/cron_ping.php?p=1 >/dev/null 2>&1
    Code:
    this will refresh the online page every 2 minutes past the hour.
    It will also ping all you're peers every 30 minutes past the hour
     
    :coffee2:Good luck
    Adding Automatic Keyupdate 
    This script does not work anymore, But you can use it if you have a different URL for the bundle.
     
    As i am kind of lazy, I like my server to download the latest keybundle  every hour, compare it to the previous one, and if new keys are  available upload them to all my sat recievers. This also put's the  latest keys on the server aswel.
     
    I use this script for that.
    Code:
    vim /emu/script/keys.sh

    Code:
    #!/bin/sh ## Key Distribution to various recievers from 1 single location ## Used to automate further distro Keybundle for CCcam ## Script should be placed in crontab to make sure it runs at regular intervals ## Made by CC_Share ##First let's make some basic definitions. You can change this to you're needs if you want. SATAN="/tmp/satan.tar.gz"   ##Location of satan bundle SATANBACK="/tmp/satan.old"  ##Location and name of old bundle AUTHFILE1="dbox2"           ##Password for Dbox AUTHFILE2="dreambox"        ##Password for dreambox DIRECTORY="/var/keys"       ##Location of CCcam Keys DBOXIP="1.1.1.1"      ##Local IP of DboxII DREAMIP="1.1.1.1"     ##Local IP of Dreambox ## These lines should not be changed unless you know what you are doing ## First test if key update is needed date if [ -e /tmp/satan ]; then rm -rf /tmp/satan fi if [ ! -e /var/keys ]; then mkdir /var/keys fi if [ ! -e /var/scce ]; then mkdir /var/scce fi wget http://keyupdater.ascofun.**/satan.tar.gz -O /tmp/satan.tar.gz if [ $SATAN -nt $SATANBACK ] ; then         mkdir /tmp/satan         tar -xzf /tmp/satan.tar.gz -C /tmp/satan/         rm -rf /var/keys/nagra_roms         cd /tmp/satan/var/keys         mv -f * /var/keys/         cd /tmp/satan/var/scce         mv -f * /var/scce/         cd /tmp         rm -rf /tmp/satan/*         rm -rf /tmp/satan         mv -f /tmp/satan.tar.gz /tmp/satan.old         rm -rf /tmp/satan.tar.gz         echo "" >>/tmp/key.txt         echo "key-update finished." else         echo "No new keys available in keybundle"         rm -rf /tmp/key.txt fi if [ -e "/tmp/key.txt" ] then ftp -n $DBOXIP <<End-Of-Session user root "$AUTHFILE1" bin hash cd "$DIRECTORY" lcd "$DIRECTORY" put AutoRoll.Key put SoftCam.Key put tps.bin bye End-Of-Session echo "Key update Dbox complete" ftp -n $DREAMIP <<End-Of-Session user root "$AUTHFILE2" bin hash cd "$DIRECTORY" lcd "$DIRECTORY" put AutoRoll.Key put SoftCam.Key put tps.bin bye End-Of-Session echo "Key update Dreambox Complete" else echo "No FTP update needed" fi exit

    In this script there are 2 recievers,
    1 dreambox and 1 dbox2.
    All you need to do is replace


    Code:
    DBOXIP="1.1.1.1"      ##Local IP of DboxII DREAMIP="1.1.1.1"     ##Local IP of Dreambox
    with the right ip adresses
    and replace

    keyupdater.ascofun.**

    With the valid URL

    When you have saved the file, don't forget to make it "executable"

    Code:
    chmod 755 /emu/script/keys.sh

    You can simply make a new cronjob to make sure this script is run every hour.


    vim /etc/crontab

    and add this line

    Code:
    00 * * * * root /emu/script/./keys.sh >>/emu/logfiles/keys.log 2>&1

    when you restart the cron deamon, the script will run every whole hour.


Working...
X