Welcome to Satlover forums, full of great people, ideas and excitement.

Please register if you would like to take part. link..

Register Now

Alert: Don't Use Hotmail Email Accounts for registration


Before Access to all Forums and Trial accounts you must need to activate your account Email address

Howto: Building Debian Linux server with CCcam

This topic is closed.
This is a sticky topic.
  • Time
  • Show
Clear All
new posts
  • Satlover
    • Mar 2009
    • 582

    Howto: Building Debian Linux server with CCcam

    First download the netinstall cd of debian linux
    You can download it from the following URL:
    Link http://cdimage.debian.org/debian-cd/...86-netinst.iso

    This will install the basic debian linux system on you're harddisk.
    Boot the computer from the CD you just created.

    Just press enter here to start the installation

    Select the language you prefer

    Select the country you're in. Based on the language it selects a default country

    Here you can choose the keyboard layout. Make sure you select the proper layout otherwise installation might prove to be quite tricky.

    Set up the hostname of you're server here. I prefer to set up the first part of my DYNDNS account info here.

    Here you must enter the domain name. In the example above, you can see i put dyndns.org here

    Next up is the partition guide. Here you must choose

    Select the right harddisk. Usually in a stand-alone server, there will just be one entry

    Debian will let you choose to have everything in 1 partition, or have seperate partitions for the important directory's. One advantage of having seperate partitions, You cannot fill the root system by accident if you upload a lot to the home directory. Linux will NOT boot correct , if the root filesystem is full

    In the overview, You can check to see if all is set up correct before writing the changes to harddisk. Once you press finish, it will show you the next screen if you are really sure :smile:.

    Once you select yes, It will write the changes to harddisk and format all partitions.

    If Debian cannot guess you're timezone by looking at the bios, it will ask you for the timezone

    Next you will have to enter the root password. Do not choose an easy to guess password if you want the server to be reachable from the internet. (if you want to use SSH for example to manage the server from work)

    Next is setting up an account to use for FTP transfer.

    Again, do not use a simple to guess password. This account can also be used for SSH

    If you have the option, allways choose a network server.
    Make sure you select a fast and stable one.
    Usually univercity servers prove to be fast and stable

    In the software selection screen, select base system and webserver

    One of the last things it needs to know, is where to place the grub bootloader. Usually it is safe to place it on the MBR

    Congratulations, You just installed a fresh new DEBIAN server.

    As you might have noticed, during installation, debian uses dhcp to aquire an ip adress.
    For a cardserver, it's not recommened to have it's IP adress handled by DHCP.
    First thing we need to do is remove the DHCP and assign a static IP to the linux server

    Assigning static IP
    Log in as root with the right password
    then type in the following command
    vim /etc/network/interfaces
    now remove the following line
    iface eth0 inet dhcp
    and replace it with
    auto eth0
    iface eth0 inet static
    These IP adresses might be different for you're situation.
    Remember to replace them with the numbers you need.
    You can save the file with the following commands
    Once the file is saved, you can restart the network and check if you're linux server is running with it's new IP adress
    /etc/init.d/networking restart
    ifconfig should now look something like this

    Installing SSH
    Next thing that needs to be done is install a SSH deamon.
    This will allow you to log into the cardserver from you're own computer and the server does not require a keyboard and monitor if you want to change something.
    apt-get install openssh-server
    Once SSH is installed, you can logout of the server,remove the keyboard and monitor as we don't need it anymore.

    Getting Putty
    We need to download putty so we can log in with SSH

    Remove the CD-ROM drive from the apt-get mirror list:
    To make sure the server does not need the CD-ROM anymore to update or install software, we need to remove it from the mirror list of apt-get.
    vim /etc/apt/sources.list
    now remove the lines that point to the CD-ROM drive and save the file.

    Update apt-get software list
    To make sure, you locally have a good software list available, you have to update the apt-get database
    apt-get update
    Installing FTP server
    To be able to transfer files between you're computer and the linux server, a FTP server is needed.
    During the installation it will ask you one question,. Answer it with "stand-alone"
    This will consume a bit more memory but will prevent linux from spawning a new process every time you log in.
    apt-get install proftpd

    The server is now installed and all the needed files are in place.
    Now it's time to get it ready for CCcam.
    First thing we need to do is make 6 directory's and adjust the parameters.
    mkdir /emu
    mkdir /emu/cccam
    mkdir /emu/script
    mkdir /emu/log
    mkdir /var/etc
    mkdir /var/keys
    chmod 777 /emu
    chmod 777 /emu/*
    chown <username> /emu
    chown <username> /emu/*
    The username started above is the username you created during the installation. This name is going to be used for file transfer.

    Startup script for CCcam
    To prevent from having to change directory all the time we're gonna place a script on the server so CCcam can be started from any directory on the server.
    vim /emu/script/cccam
    CAMNAME="CCcam Server"
    # end
    # This method starts CCcam
    start_cam ()
    /emu/cccam/CCcam.x86 &
    sleep 2
    # This method stops CCcam
    stop_cam ()
    pkill CCcam.x86
    case "$1" in
    echo "[SCRIPT] $1: $CAMNAME"
    echo "[SCRIPT] $1: $CAMNAME"
    echo "Restaring $CAMNAME"
    "$0" stop
    exit 1
    exit 0
    chmod 755 /emu/script/cccam
    ln /emu/script/cccam /bin/cccam
    Now you can simply start, stop or restart CCcam from any directory by simply typing
    cccam start
    cccam stop
    cccam restart
    Upload CCcam
    Now use a FTP program to upload CCcam.x86 and CCcam.cfg to /emu/cccam

    Making CCcam executable
    Use putty again to give CCcam.x86 execution rights
    chmod 755 /emu/cccam/CCcam.x86
    Config update script
    When you're running a big server, restoring connections can take some time then you change you're config file. I like to do my config changes once a day. I use this script to backup the old config and put the new config in place. This is done at 3am so my peers don't notice it and they don't suffer from a freezing picture every time you make a change.
    vim /emu/script/configupdate.sh
    #Script to process new config and backup old one.
    #Script designed and written by CC_Share
    if test -f $SOURCE/$FILE ; then
     echo "New Config Present"
     if test -d $BACKUPDIR ; then
      if test -f $BACKUPDIR/$CONFIGOLD ; then
      echo "Removing OLD config file from backup directory"
      echo "No OLD config to remove."
                    if test -f $BACKUPDIR/$FILE ; then
                    echo "Renaming Backup to old config"
                    rm $BACKUPDIR/$FILE
                    echo "No Backupfile present yet"
                    if test -f $TARGET/$FILE ; then
                    echo "Copying Original config to Backup directory"
                    cp $TARGET/$FILE $BACKUPDIR
                    rm $TARGET/$FILE
                    echo "No Original Config File Present!?!?"
     echo "Backup directory does not exist."
     echo "making new directory"
     mkdir $BACKUPDIR
                    if test -f $TARGET/$FILE ; then
                    echo "Copying Original config to Backup directory"
                    cp $TARGET/$FILE $BACKUPDIR
                    echo "No Original Config File Present!?!?"
     echo "Moving New config file to "$TARGET
     rm $SOURCE/$FILE
    echo "No New Config present, Nothing to process"
    chmod 755 /emu/script/configupdate.sh
    Putting configupdate in crontab
    To make sure the config update script will run at 3 am everynight, we can place it in the crontab.
    cd /etc
    vim crontab
    and add the following line to it
    00 3 * * * root /emu/script/./configupdate.sh >>/emu/log/configupdate.log 2>&1
    This will run the script every day at 3am, and it's output will be writen in /emu/log/configupdate.log so you can check on occasion if all went well.

    Putting CCcam in bootsequence

    There's only one more thing to do. Add CCcam to the startup so it will start on the next reboot.
    vim /etc/rc.local
    and add the following line at the bottom
    /bin/cccam start &
    test the config update script created earlier to see if that works
    If it works, you can reboot the server and check if CCcam is running.