Vorrei segnalare il contenuto di un link postato da nosfevil passato in un post ormai vecchio che sta passando nel dimenticatoio delle pagine passate, è in inglese ma, credo, si capisca ugualmente:

Installation CCcam server on Ubuntu 6.06 server with firewall, automatic SofCam.Key, TPS.bin and DNS update, PHP webinfo and more


Meer informatie over Ubuntu kunt u vinden op Ubuntu:Hardy - .
More information about Ubuntu can be found at Ubuntu:Hardy -.

in this manual to make use of VIM as editor.
Dit is de standaard editor in Ubuntu Server.
This is the default editor in Ubuntu Server.
Voor informatie over VIM en alle opties type &undefined;vim --help&undefined; in de commandline.
For information on all the options and VIM type &undefined; vim - help &undefined; in the commandline.
uiteraard kun je iedere editor gebruiken die je wenst.
Of course you can use any editor that you want.
midnight commander (zie punt 19) is ideaal voor iederen die VIM lastig vind.
Midnight commander (see paragraph 19) is ideal for anyone who VIM find difficult.

1.
1.
Installeer Ubuntu 6.06 LTS (Long Time Support) server.
Install Ubuntu 6.06 LTS (Long Time Support) server.
Waarom 6.06 LTS en niet 7.04?
Why 6.06 LTS and not 7.04?
6.06 LTS server edition heeft een kernel die geoptimaliseerd is voor servers.
6.06 LTS server edition has a kernel that is optimized for servers.
Ubuntu server heeft geen desktop (totaal overbodig voor een cardserver mijn inziens) en heeft een daardoor installatie van amper 300 mb.
Ubuntu desktop server is not (totally unnecessary for a cardserver my opinion) and has thereby installation of a barely 300 mb.
Daarnaast wordt deze versie 5 jaar onderhouden door Ubuntu.
In addition, this version 5 years maintained by Ubuntu.
Krijg je voor 7.04 vanaf volgend jaar al geen updates meer, voor 6.06 LTS lopen deze door tot 2011.
Will you 7.04 from next year no more updates for 6.06 LTS run this until 2011.

2.
2.
Installeer SSH:
Install SSH:

Code:
# sudo apt-get install openssh-server
# Sudo apt-get install openssh server

Als je dit gedaan hebt kan de server in principe in de gangkast, op zolder, schuur of waar dan ook.
If you have done this, the server in principle in the gangkast, attic, barn or anywhere else.
Geen monitor en toetsenbord meer nodig want alles kan (mbv putty) extern gedaan worden.
No monitor and keyboard longer necessary because anything is possible (using putty) external done.
Uiteraard kun je ook verder gaan op de server zelf.
Of course, you can also go to the server itself.

3.
3.
Download putty en log in op je server:
Download putty and log into your server:
http://the.earth.li/~sgtatham/putty/.../x86/putty.exe
Http://the.earth.li/ ~ sgtatham/putty/latest/x86/putty.exe

4.
4.
Login als root:
Login as root:

Code:
# sudo –su
# Sudo su -
Voer je password in en je zult zien dat je nu root bent.
Enter your password and you will see that you are now root.

5.
5.
extra respotries aanzetten in Ubuntu:
Respotries additional incitement in Ubuntu:

Code:
# vim /etc/apt/sources.list
# Vim / etc / apt / sources.list

Haal de hekjes weg voor alle:
Remove the pound signs for all road:

Code:
# deb ......
Deb # ......
Sla dit op.
Save this.

6.
6.
update de sources.list:
Update the sources.list:

Code:
# apt-get update
# Apt-get update

7.
7.
Installeer een FTP server:
Install an FTP server:

Code:
# apt-get install proftpd
# Apt-get install proftpd
Important: Choose during installatievragen for &undefined; standalone &undefined; and not &undefined; initd &undefined;

8.
8.
Maak de verschillende mappen aan voor CCcam:
Make folders for the various CCcam:

Code:
# mkdir /var/keys
# Mkdir / var / keys
en
And
Code:
# mkdir /var/etc
# Mkdir / var / etc

9.
9.
Verander de volgende mappen van eigenaar (van root naar eigen username):
Change the following directories of ownership (from root to own username):

Code:
# chown jouwusername /var/keys
# Chown jouwusername / var / keys
# chown jouwusername /var/etc
# Chown jouwusername / var / etc
# chown jouwusername /usr/local/bin
# Chown jouwusername / usr / local / bin

10.
10.
Log met je je FTP programma in op je sever en upload de volgende bestanden van CCcam:
Sign with your FTP program into your server and upload files from CCcam the following:
CCcam.x86 naar /usr/local/bin
CCcam.x86 to / usr / local / bin
CCcam.cfg, CCcam.channelinfo, CCcam.providers naar /var/etc
CCcam.cfg, CCcam.channelinfo, CCcam.providers to / var / etc

11.
11.
Maak CCcam.x86 opstartbaaar met chmod:
Make CCcam.x86 opstartbaaar with chmod:

Code:
# chmod 755 /usr/local/bin/CCcam.x86
# Chmod 755 / usr/local/bin/CCcam.x86

Note: ikzelf rename CCcam.x86 altijd naar cccam.
Note: I always rename CCcam.x86 to cccam.
Verder in deze handleiding is CCcam.x86 dan ook cccam.
Further in this guide is CCcam.x86 therefore cccam.

12.
12.
Zorg dat cccam automatisch opstart bij (re)booten.
Make sure cccam automatically at startup (re) boot.

Code:
# vim /etc/rc.local
# Vim / etc / rc.local

Voeg onderstaande toe:
Add the following:

Code:
/usr/local/bin/cccam
/ Usr / local / bin / cccam

13.
13.
Omdat CCcam na verloop van tijd veel geheugen gaat gebruiken (en minder stabiel wordt) laat ik Cccam iedere nacht om 4 uur opnieuw opstarten.
Because CCcam over time are going to use a lot of memory (and less stable) let me Cccam every night for 4 hours to restart.
Maak een cron job aan:
Create a cron job:

Code:
# sudo crontab –e
# Sudo crontab-e

Voeg onderstaande toe:
Add the following:

Code:
00 04 * * * killall cccam && /usr/local/bin/cccam
00 04 * * * killall cccam & & / usr / local / bin / cccam

Opslaan met Ctrl X , yes, enter
Save with Ctrl X, yes, enter

14.
14.
Omdat ik geen zin heb om steeds zelf de Softcam.Key en tps.bin te updaten heb ik dit geautomatiseerd.
Because I have no sense to ever own Softcam.Key and tps.bin update, I have this automated.
Iedere nacht om 3:59 uur wordt de laatste Softcam gedownload.
Every night at 3:59 pm, the last Softcam downloaded.

14.1 Maak een bash bestand aan:
14.1 Make a bash file:

Code:
# vim /var/etc/keyupdater.sh
# Vim / var / etc / keyupdater.sh

14.2 Voeg aan de nieuwe file de volgende regels toeen sla het bestand op:
14.2 Add to the new file with the following lines toeen save the file:

Code:
#!
/bin/bash
/ Bin / bash
#
wget -qO /var/keys/SoftCam.Key http://www.l*xs*t.eu/hpengine/downl*...es/S*ftCam.K*y
Wget-qO / var / keys / SoftCam.Key OpenDNS xs * * t.eu / hpengine / downl ad_files * / * S * y ftCam.K
wget -qO /var/keys/tps.bin http://www.luxsat**************wnload_files/tps.bin
Wget-qO / var / keys / tps.bin OpenDNS ************** wnload_files / tps.bin

Note: Ik kan het volledige pad hier niet neerzetten, de meeste van jullie zullen wel genoeg hebben aan de hint!!!
Note: I can not drop full path here, most of you will still have enough to hint!

14.3 Maak de zojuist gemaakte file opstartbaar:
14.3 Make the newly created file bootable:

Code:
# chmod 755 /var/etc/keyupdater.sh
# Chmod 755 / var / etc / keyupdater.sh

14.4 Zorg dat het script bijvoorbeeld iedere nacht op 4 uur wordt uitgevoerd:
14.4 Make sure the script eg every night at 4 am to be done:

Code:
# crontab –e
# Crontab-e

Voeg de volgende regel toe:
Add the following line:
Code:
Code:
59 03 * * * /var/etc/keyupdater.sh
59 03 * * * / var / etc / keyupdater.sh

Sla op met met &undefined;Crtl X, yes, enter&undefined;
Save your &undefined; with Crtl X, yes, enter &undefined;

15.
15.
Firewall installeren:
Firewall install:
Voor het configureren van de firewall gaan we geen gebruik maken van Netfilter/Iptables maar van Shorewall.
For the configuration of the firewall, we will not use Netfilter / Iptables but Shorewall.
Naar mijn mening is Shorewall verreweg de beste firewall oplossing voor Linux.
In my opinion, Shorewall far the best solution for Linux firewall.
Met behulp van een aantal files maakt Shorewall het mogelijk om relatief eenvoudig een zeer complexe firewall op te zetten.
With the help of a number of files Shorewall makes it possible for a relatively simple to very complex firewall.
De configuratie is natuurlijk erg afhankelijk van hoe en wat er allemaal op de server draait.
The configuration is obviously very dependent on how and what is on the server is running.
Ik ga uit van de meest voorkomende situatie.
I go out of the most common situation.
De meeste mensen zullen de server standalone hebben draaien en aangesloten hebben op een router.
Most people will have standalone server running and connected to a router.
De server heeft maar één netwerkaansluiting (NIC).
The server has a network connection (NIC).

15.1 Installeer de Firewall (Shorewall):
15.1 Install the Firewall (Shorewall):

Code:
# apt-get install shorewall
# Apt-get install shorewall

15.2 Om shorewall bij booten op te starten:
15.2 In order to boot the shorewall start:

Code:
# vim /etc/default/shorewall
# Vim / etc / default / shorewall

Vervang:
Replace:

Code:
startup = 0
Startup = 0

in
V

Code:
startup = 1
Startup = 1

Sla it op.
Save it.

15.3 Kopieer de voorbeeld configuratiefiles van shorewall naar de juiste directorie:
15.3 copy the example configuratiefiles of shorewall to the correct directory:

Code:
# cp /usr/share/doc/shorewall/default-config/* /etc/shorewall/
# Cp / usr / share / doc / shorewall / default-config / * / etc / shorewall /


15.4 Vanaf dit punt is het het beste om alle configuratiefies in /etc/shorewall/ door te nemen om shorewall te leren kennen.
15.4 From this point it is best for all configuratiefies in / etc / shorewall / shorewall to take in order to get to know.
Dit is nogal tijdrovend dus ik zal de belangrijkste zaken even doornemen.
This is a rather time consuming so I will just go through the main things.

15.5 Vertel shorewall welke netwerkzones je gebruikt.
15.5 Tell shorewall what netwerkzones you use.
In ons voorbeeld met één NIC heb je twee zones waarvan 1 de firewall zelf en de NIC.
In our example with a NIC there are two areas which 1 firewall itself and the NIC.

Code:
# vim /etc/shorewall/zones
# Vim / etc / shorewall / zones

Voeg onderstaande toe:
Add the following:

Code:
#ZONE TYPE OPTIONS IN OUT
# TYPE OF OPTIONS IN ZONE OUT
# OPTIONS OPTIONS
# OPTIONS OPTIONS
fw firewall
FW firewall
net ipv4
Just ipv4
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE
# LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE

Sla dit op.
Save this.

15.6 Vervolgens gaan we de interface configureren (de NIC):
15.6 Next, we configure the interface (NIC):

Code:
# vim /etc/shorewall/interfaces
# Vim / etc / shorewall / interfaces

Voeg onderstaande toe:
Add the following:

Code:
#ZONE INTERFACE BROADCAST OPTIONS
ZONE # INTERFACE BROADCAST OPTIONS
net eth0
Just eth0
#LAST LINE—ADD YOUR ENTRIES BEFORE THIS ONE—DO NOT REMOVE
# LAST LINE-ADD YOUR ENTRIES BEFORE THIS ONE-DO NOT REMOVE

15.7 Nu gaan we de staandaard firewallregels instellen:
15.7 Now we go into the firewall is set:

Code:
#vim /etc/shorewall/policy
# Vim / etc / shorewall / policy

Voeg onderstaande toe:
Add the following:

Code:
#SOURCE DEST POLICY LOG LIMIT:BURST
# SOURCE DEST POLICY LOG LIMIT: BURST
# LEVEL
# LEVEL
fw net ACCEPT
FW net ACCEPT
net all DROP
Net all DROP
all all REJECT
All All REJECT
#LAST LINE—DO NOT REMOVE
# LAST LINE-DO NOT REMOVE

maw verkeer afkomstig van de firewall naar buiten doorlaten
Ie traffic comes from outside the firewall to pass
alles vanaf het internet naar de firewall blokkeren
Everything from the Internet to the firewall block
all all reject is standaard en moet je zo laten staan.
All all rejection is standard and so you have to leave.

Sla dit op.
Save this.

15.8 Als laatste gaan we de firewall rules bepalen:
15.8 If we go into the last firewall rules provide:
Dit voorbeeld is van toepassing als je voor CCcam poort 12000 gebruikt en de webinterface 16001 en de webinterface alleen op een specifieke PC op het LAN met IP 192.168.1.10 beschikbaar te hebben.
This example is applicable if you CCcam port 12000 used in the web interface 16001 and the Web interface only in a specific PC on the LAN with IP 192.168.1.10 available.

Code:
#vim /etc/shorewall/rules
# Vim / etc / shorewall / rules

Voeg onderstaande toe:
Add the following:

Code:
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/
# ACTION SOURCE DEST PROTO DEST ORIGINAL SOURCE RATE USER /
# PORT PORT(S) DEST LIMIT GROUP
# PORT PORT (S) DEST LIMIT GROUP
ACCEPT net:192.168.1.10 fw tcp 16001
ACCEPT net: 192.168.1.10 fw tcp 16001
ACCEPT net fw tcp 12000
ACCEPT net FW TCP 12000
ACCEPT net fw tcp 22 (voor SSH)
ACCEPT net fw tcp 22 (SSH)
ACCEPT net fw tcp 21 (voor FTP)
ACCEPT net fw tcp 21 (FTP)

# Blok poort 12000 voor een bepaald IP
Block port # 12000 for a particular IP
DROP net:220.153.535.2 fw tcp 12000
DROP net: 220.153.535.2 fw tcp 12000

# Blok poort 12000 voor meerdere IP’s
Block port # 12000 for multiple IPs
DROP net:220.153.535.2, 233.233.111.33, 232.33.44.11 fw tcp 12000
DROP net: 220.153.535.2, 233.233.111.33, 232.33.44.11 fw tcp 12000

# Als je net als Spiderman Samba gebruikt om bestanden te delen moeten die poorten natuurlijk OOk open maar natuurlijk alleen op je Interne netwerk.
# If you are like Spiderman Samba used to share files, these gates course OOk open but of course only on your internal network.
ACCEPT net:192.168.1.10/20 fw tcp 137,138,139,389,445 -
ACCEPT net: 192.168.1.10/20 fw tcp 137138139389445 --
ACCEPT net:192.168.1.10/20 fw udp 137,138,139,389,445 -
ACCEPT net: 192.168.1.10/20 fw udp 137138139389445 --

enz.
Etc.
enz.
Etc.

Sla dit op.
Save this.

16.
16.
start shorewall:
Shorewall start:

Code:
# shorewall start
# Shorewall start

Als je ergens een fout hebt gemaakt krijg je dit te zien in je output.
If you have made a mistake somewhere you get to see in your output.

alle overige files in /etc/shorewall hoef je niet te veranderen.
All other files in / etc / shorewall you do not have to change.

Handigheidjes:

17.
17.
Installeer htop om je services te kunnen monitoren
Install htop services to be able to see your screens

Code:
# apt-get install htop
# Apt-get install htop

Opstarten met:
Booting with:

Code:
# htop
# Htop

18.
18.
Om het netwerkverkeer te kunnen monitoren installeer nload:
In order to be able to monitor network traffic to install nload:

Code:
# apt-get install nload
# Apt-get install nload

opstarten met:
Boot with:

Code:
# nload
# Nload

19.
19.
Om in de commandline makkelijk te navigeren door alle files en ze te editten installeer je Midnight Commander:
To meet the commandline easy to navigate through all the files and editing them install Midnight Commander:

Code:
# apt-get install mc
# Apt-get install mc

opstarten met:
Boot with:

Code:
# mc
# MC

20.
20.
Apache en PHP5 ten behoeve van PHP Webinfo Installeren
Apache and PHP5 for PHP Webinfo Installation

20.1 Installeer Apache HTTP Server:
20.1 Install Apache HTTP Server:

Code:
# apt-get install apache2
# Apt-get install apache2

20.2 Installeer PHP5:
20.2 Install PHP5:

Code:
# apt-get install php5
# Apt-get install php5
Vervolgens
Then
Code:
# /etc/init.d/apache2 restart
# / Restart etc/init.d/apache2

20.3 Open poort 80 in de Firewall
20.3 Open port 80 in the Firewall

Code:
# vim /etc/shorewall/rules
# Vim / etc / shorewall / rules

Voeg onderstaande toe:
Add the following: Code:
ACCEPT net: fw tcp 80
ACCEPT net: fw tcp 80

20.4 Herstart Shorewall
20.4 Restart Shorewall

Code:
# shorewall restart
# Shorewall restart

20.5 Test of Apache en PHP5 goed werken:
20.5 Test of Apache and PHP5 work:

Code:
# vim /var/www/testphp.php
# Vim / var / www / testphp.php

Voeg onderstaande toe:
Add the following:

Code:
(); ?>
();>

20.6 In je browser roep je het zojuist gemaakte php-bestand op met OpenDNS
20.6 In your browser you call the newly created php file with OpenDNS
Als alles is goedgegaan krijg je nu een mooi overzicht te zien van PHP.
If everything is goedgegaan you get a good overview of PHP.

21.
21.
Nu gaan we PHP Webinfo installeren.
Now we Webinfo PHP install.


21.1 Maak jezelf eigenaar van /var/www/
21.1 Make yourself owner / var / www /

Code:
# chown jouwusername /var/www/
# Chown jouwusername / var / www /

21.2 Upload de PHP Webinfo bestanden met FTP
21.2 Upload the PHP Webinfo files with FTP
Alleen index.php en de map data in /var/www/
Only index.php and the map data in / var / www /
profiles.ini naar /var/etc/
Profiles.ini to / var / etc /

Note: Certainly NOT profiles.ini in your webroot (/ var / www /), as standard intended. The log of your server in plain text in that file and for anyone up for grabs!

21.3 Geef schrijfrechten aan de map data:
21.3 Provide write to the directory data:

Code:
# chmod 777 /var/www/data
# Chmod 777 / var / www / data

21.4 Pas profiles.ini aan met de juiste gegevens:
21.4 Only profiles.ini in with the correct information:

Code:
vim /var/etc/profiles.ini
Vim / var / etc / profiles.ini

Volg de aanwijzingen, de file ziet er dan zo uit
Follow the instructions, the file looks like this
Code:
#replace the following lines with your dns, ftp port, user and pass for the cccam server
# Replace the following lines with your dns, ftp port, and pass user for the server cccam
127.0.0.1
21
username
Username
password
Password

21.5 Verander de initialprocess.php file:
21.5 Change initialprocess.php file:

Citaat
Quote
# vim /var/www/data/initialprocess.php
# Vim / var / www / data / initialprocess.php

Zoek in regel 62 naar:
Search in Rule 62 to:
Code:
if (file_exists("../profiles.ini")) {$accessdata=file("../profiles.ini");
If (file_exists ("../ profiles.ini ")) ($ accessdata = file ("../ profiles.ini");

Maak hiervan:
Do not forget this:
Code:
if (file_exists("/var/etc/profiles.ini")) {$accessdata=file("/var/etc/profiles.ini");
If (file_exists ( "/ var / etc / profiles.ini")) ($ accessdata = file ( "/ var / etc / profiles.ini");

Klaar!
Ready!

Navigeer met je browser naar OpenDNS en je ziet uitgebreide info over CCcam
Navigate your browser to OpenDNS and you see extensive information on CCcam [IMG]file:///C:/Documents%20and%20Settings/Administrateur/Bureau/CCCAM/Page%20web/translate_fichiers/translate_p_data/wink.gif[/IMG]

22 NO IP Client voor automatische DNS update:
22 NO IP Client for automatic DNS update:
Code:
apt-get install no-ip
Apt-get install no-ip

22.1 NO IP Client configureren:
NO 22.1 IP Client configuration:
Code:
no-ip -C
No-IP-C
Volg de 5 configuratie stappen en klaar.
Follow the steps and finished 5 configuration.
De updater doet zijn werk om de X minuten die je aangeeft in stap 5.
The updater is doing his work for the X minutes that you indicate in Step 5.
NO-IP start automatisch een reboot.
NO-IP start automatically reboot.

23 DynDNS Client voor automatische DNS update:
23 DynDNS Client for automatic DNS update:
Code:
apt-get install ddclient
Apt-get install ddclient

23.1 DynDNS Client configureren:
23.1 DynDNS Client configuration:
Code:
vim /etc/ddclient.conf
Vim / etc / ddclient.conf

Pas dit config bestand aan naar eigen inzicht zoals dit:
Only this config file to your insight like this:
Code:
#
# /etc/ddclient/ddclient.conf
# / Etc / ddclient / ddclient.conf
#
protocol=dyndns2
Protocol = dyndns2
use=web
Use = web
login=mylogin
Login = mylogin
password=mypassword
Password = mypassword
myhost.dyndns.org
Myhost.dyndns.org


Start DynDNS Client
Start DynDNS Client
Code:
/etc/init.d/ddclient start
/ Etc / init.d / ddclient start

DynDNS start automatisch bij een reboot.
DynDNS start automatically when a reboot.



Succes !
Success!