Saturday, January 14, 2017

HTTP Status 404 - /ccmadmin/showHome.do


If you are working with CUCM, and you meet this error after restart/boot:

type: Status report
message: /ccmadmin/showHome.do
description: The requested resource is not available.


Most probably it just means, that the server is not fast enough.. just wait for a little more. Probably Cisco Tomcat can start up much more faster then the other services, so it fails to proxy properly.

Tuesday, March 3, 2015

Apache 2.2 mod-authnz-external UNIX user auth howto with pwauth


This howto is for Debian linux, and for Apache version 2.2. Directories and installation types may differ on other distributions.

1. Install apache module (it will also install pwauth as a dependency)

apt-get install libapache2-mod-authnz-external

2.Enable apache2 module

a2enmod authnz_external

3.Check if module is loaded:

apache2ctl -M | grep  authnz_external

should see:

 authnz_external_module (shared)

4. Set up vhost:

4.1: In the selected directory:
 
AuthType Basic
AuthName Your-Site-Name
AuthBasicProvider externalAuthExternal pwauthrequire valid-user


4.2: In the beginning of the vhost file:

AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe


Possible problems:

Invalid AuthExternal keyword (pwauth)

You have no pwauth installation or you pwauth is not in the /usr/sbin directory, search it!


 Action 'configtest' failed.
The Apache error log may have more information.
 failed!


You have misspelled some command in the configuration file, check it!

Wednesday, February 11, 2015

Cisco IOU with web interface

What is IOU? IOU stands for IOS on Unix, special versions of IOS, which can be run as x86 services. These IOS versions are very light weight, they need less memory and CPU than GNS3 (or dynamips).

I had some problems during the installation of Cisco IOU, so I will show you how to do that easily. We will use IOU with a web interface (iou-web).

1. First of all, you will need a 32bit version of debian (or ubuntu, gentoo, whatever linux). If they are 32bit systems, your life will be better, trust me.

2. Then download the iou-web interface files from here. Download the latest .deb file and install it:

sudo dpkg -i <iou-web_version>

If it needs some dependencies, type:

sudo apt-get install -f
sudo dpkg -i <iou-web_version>


If everything is OK, the iou-web files are installed in /opt/iou.

So now you have the web interface working. Lets install the IOU! (For the IOU files, please use google!)

3. Install 'libcrypto' library:

sudo apt-get install libssl1.0.0
sudo apt-get install libssl0.9.8


4. You will need libcrypto.so.4, but it is not installable, so you will hack it a little: create a symlink:

sudo ln -s /lib/libcrypto.so.1.0.1e /usr/lib/libcrypto.so.4

5. You will need to install the license, you will find some information in the downloads.

6. Navigate to the web interface in your browser and choose 'Manage' menu, then 'manage IOSes'. Here you van upload the .bin files. After uploading them, you can create your own lab in the 'Laboratories' menu with the 'Add new lab' button.

References:

http://www.routereflector.com/cisco/cisco-iou-web-interface/
http://ciscoiseasy.blogspot.hu/2014/07/iou-forbidden-fruit.html



Wednesday, November 26, 2014

Debug Cisco Tunnels: GRE


We will debug GRE tunnels which were set in the previous post. There are two routers, basic interface configuration on Serial1/0 ports and a Tunnel interface on each router.

R1#debug tunnel
When everything is good:

R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/21/36 ms
R1#
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.2 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP (PS) to decaps 200.0.0.2->200.0.0.1 (tbl=0,"default" len=124 ttl=254)
Tunnel0: GRE decapsulated IP packet (linktype=7, len=100)
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.2 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP
R1# (PS) to decaps 200.0.0.2->200.0.0.1 (tbl=0,"default" len=124 ttl=254)
Tunnel0: GRE decapsulated IP packet (linktype=7, len=100)
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.2 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP (PS) to decaps 200.0.0.2->200.0.0.1 (tbl=0,"default" len=124 ttl=254)
Tunnel0: GRE decapsulated IP packet (linktype=7, len=100)
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.2 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)

R1#Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP (PS) to decaps 200.0.0.2->200.0.0.1 (tbl=0,"default" len=124 ttl=254)
Tunnel0: GRE decapsulated IP packet (linktype=7, len=100)
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.2 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP to classify 200.0.0.2->200.0.0.1 (tbl=0,"Default" len=124 ttl=254 tos=0x0)
Tunnel0: GRE/IP (PS) to decaps 200.0.0.2->200.0.0.1 (tbl=0,"default" len=124 ttl=254)
Tunnel0: GRE decapsulated IP packet (linktype=7, len=100)

What we see here:

We sent 5 packets to R2, R1 encapsulated 5 packets, and decapsulated 5 packets. Obviously, the decapsulated packets are the reply packets from R2.


Wrong tunnel destination

With debug tunnel command, we will see after configuration change:

R1(config-if)#tunnel destination 200.0.0.3
FIBtunnel: Tu0: cli request terminated early: no
FIBtunnel: Tu0: cli request generated fib update: IPv4 punt change no, IPv6 punt change no, mode change no
FIBtunnel: Tu0: GRE/IP (0) punt ipv4: no (lc no), ipv6 no (lc no) [BEFORE]
FIBtunnel: Tu0: GRE/IP (0) punt ipv4: no (lc no), ipv6 no (lc no) [AFTER]
FIBtunnel: Tu0: stacking IP 0.0.0.0 to Default:200.0.0.3


R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.3 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes.
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.3 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes.
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.3 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes.
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.3 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes.
Tunnel0: GRE/IP encapsulated 200.0.0.1->200.0.0.3 (linktype=7, len=124)
Tunnel0 count tx, adding 0 encap bytes.
Success rate is 0 percent (0/5)

Packets are encapsulated and sent, but no response from the other side.



Wednesday, November 5, 2014

Point-to-Point Frame Relay with Cisco router as Frame Relay Switch




In this tutorial, I will show you, how to use a Cisco router as a frame relay switch. It can be usefull if you study for your CCNA or CCNP exam and you need a frame relay switch, although you can use GNS3's Frame Relay switch, it can be a little buggy.

The topology used:

FRSW is the Frame Relay switch, which is connected to London, Budapest and Baltimore.

PVCs:
P2P 102 London Baltimore
P2P 201 Baltimore London
P2P 103 London Budapest
P2P 301 Budapest London

Step1

In this step we will enable Frame Relay switching on router FRSW, then we create the appropriate DLCIs.

FRSW(config)#frame-relay switching

On the serial interface 1/0, 1/1, 1/3 configure frame-relay:

FRSW(config)#int serial 1/0
FRSW(config-if)#encapsulation frame-relay
FRSW(config-if)#frame-relay lmi-type cisco
FRSW(config-if)#clock rate 64000
FRSW(config-if)#frame-relay intf-type dce
FRSW(config-if)#no shutdown


FRSW(config)#int serial 1/1
FRSW(config-if)#encapsulation frame-relay
FRSW(config-if)#frame-relay lmi-type cisco
FRSW(config-if)#clock rate 64000
FRSW(config-if)#frame-relay intf-type dce
FRSW(config-if)#no shutdown


FRSW(config)#int serial 1/3
FRSW(config-if)#encapsulation frame-relay
FRSW(config-if)#frame-relay lmi-type cisco
FRSW(config-if)#clock rate 64000
FRSW(config-if)#frame-relay intf-type dce
FRSW(config-if)#no shutdown


Then create the routes on each interfaces, the command is:

frame-relay route INDLCI interface OUTINTERFACE OUTDLCI

so..

FRSW(config)#int serial 1/0
FRSW(config-if)#frame-relay route 103 interface s1/1 301
FRSW(config-if)#frame-relay route 102 interface s1/3 201


FRSW(config)#int serial 1/1
FRSW(config-if)#frame-relay route 301 interface serial 1/0 103

FRSW(config)#int ser1/3
FRSW(config-if)#frame-relay route 201 interface serial 1/0 102


Step2: Configure Nodes

London:

London(config)#int ser1/0
London(config-if)#encapsulation frame-relay
London(config-if)#no sh


London(config)#int ser1/0.103 point-to-point
London(config-subif)#ip addr 192.168.3.1 255.255.255.0

London(config-subif)#frame-relay interface-dlci 103
London(config-subif)#no sh


London(config)#int ser1/0.102 point-to-point
London(config-subif)#ip addr 192.168.1.1 255.255.255.0

London(config-subif)#frame-relay interface-dlci 102
London(config-subif)#no sh

Budapest:

Budapest(config)#int ser1/0
Budapest(config-if)#encapsulation frame-relay
Budapest(config-if)#no sh


Budapest(config)#int ser1/0.301 point-to-point
Budapest(config-subif)#ip addr 192.168.3.2 255.255.255.0

Budapest(config-subif)#frame-relay interface-dlci 301
Budapest(config-subif)#no sh



Baltimore

Baltimore(config)#int ser1/0
Baltimore(config-if)#encapsulation frame-relay
Baltimore(config-if)#no sh


Baltimore(config)#int ser1/0.201 point-to-point 
Baltimore(config-subif)#ip addr 192.168.1.2 255.255.255.0
Baltimore(config-subif)#frame-relay interface-dlci 201
Baltimore(config-subif)#no sh

Step3: Test

Ping London from Baltimore:

Baltimore#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms

Ping London from Budapest:

Budapest#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms


Step4: Set up routing

Budapest:

Budapest(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1

Baltimore:

Baltimore(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.1





Sunday, October 12, 2014

Debug Cisco Tunnels: Basic Configuration



Tunnels are part of both CCNA and CCNP exams, so it is important to know them, and to know, what to do when they don't want to work. Here I collect the basic configurations for the tunnels which we will debug. I will not explain the configuration, if you need further explanation, please visit www.cisco.com and read the official manuals.

Basic Configuration

R1

hostname R1

interface Serial1/0
 description LinkToR2
 ip address 200.0.0.1 255.255.255.252
 serial restart-delay 0
 no sh

line con 0
 logging synchronous



R2

hostname R2

interface Serial1/0
 description LinkToR1
 ip address 200.0.0.2 255.255.255.252
 serial restart-delay 0
 no sh

line con 0
 logging synchronous

GRE

R1

 interface Tunnel0
  description Tunnel
  ip address 192.168.1.1 255.255.255.0
  tunnel source Serial1/0
  tunnel destination 200.0.0.2

R2

 interface Tunnel0
  description Tunnel
  ip address 192.168.1.2 255.255.255.0
  tunnel source Serial1/0
  tunnel destination 200.0.0.1

Verification:

show logging
%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up

R1#show ip interface brief | include Tunnel0
Tunnel0                    192.168.1.1     YES manual up                    up

R2#show ip interface brief | include Tunnel0
Tunnel0                    192.168.1.2     YES manual up                    up

R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/19/20 ms

R2#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/18/20 ms

IPsec

R1

ip access-list extended IPSEC
 permit gre host 200.0.0.1 host 200.0.0.2

crypto isakmp policy 1
 encr 3des
 hash md5
 authentication pre-share
 group 5
crypto isakmp key secretpassw0rd address 200.0.0.2

crypto ipsec transform-set TRANSFORM esp-3des esp-md5-hmac

crypto map MAP 10 ipsec-isakmp
 set peer 200.0.0.2
 set transform-set TRANSFORM
 match address IPSEC

interface Serial 1/0
 crypto map MAP

interface Tun0
 crypto map MAP

R2

ip access-list extended IPSEC
 permit gre host 200.0.0.2 host 200.0.0.1

crypto isakmp policy 1
 encr 3des
 hash md5
 authentication pre-share
 group 5
crypto isakmp key secretpassw0rd address 200.0.0.1

crypto ipsec transform-set TRANSFORM esp-3des esp-md5-hmac

crypto map MAP 10 ipsec-isakmp
 set peer 200.0.0.1
 set transform-set TRANSFORM
 match address IPSEC

interface Serial 1/0
 crypto map MAP

interface Tun0
 crypto map MAP


Verification:
%CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON

R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/28 ms

R2#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/24/52 ms

( Before checking the counters, it could be a good idea to reset them: clear ip access-list counters )

R2#sh ip access-lists
Extended IP access list IPSEC
    10 permit gre host 200.0.0.2 host 200.0.0.1 (15 matches)

R1#sh ip access-lists
Extended IP access list IPSEC
    10 permit gre host 200.0.0.1 host 200.0.0.2 (15 matches)



So you just got a working IPsec over GRE tunnel, in the next posts, they will be unfunctional, so we have to repair them.


Wednesday, May 14, 2014

VOIP Kodekek sávszélesség-igénye

Sávszélesség-igény egyszerű kiszámítása:


(  (kódoló sebessége)+(1000/időhossz csomagolás)*(RTP(12bájt)+IP(20bájt)+UDP(8bájt) overhead)*8  )/1000


Példa:

GSM (13 kbit/sec), 20ms: 28.625 kbit/sec
GSM (13 kbit/sec), 60ms: 18.208 kbit/sec
PCM, (64kbit/sec), 20 ms: 79,625 kbit/sec
PCM, (64kbit/sec), 60 ms: 69,208 kbit/sec
G.721 (ADPCM) (32kbit/sec), 20 ms: 47.625 kbit/sec
G.721 (ADPCM) (32kbit/sec), 60 ms: 37.208 kbit/sec

Wednesday, August 7, 2013

NATDet Log Parser



I wrote a NATDet log parser to collect data from log files. It is written in PHP, so you need to install command-line php to run it. By default, it uses PGSQL, but with a small work you can rewrite it to use mysql.

You can download it from SourceForge, the Database is ready to get data from NMap, so I'll update the script later to use that.

Link to download

Install NATdet

I haven't found any tutorials about installing NATDet yet, so I just made one, it's very simple. Here is the official NATDet site: http://elceef.itsec.pl/natdet/ , there is a little documentation about it.

So, how to install: 


1. You need to install some packages:
  • pcap
  • bison

2. Install tcpdump
http://www.tcpdump.org/

3. Install ncurses

4. Download and install NATDet
Install:

./configure
make
make install 


How to use it:


First, you should set your network interface to promisc mode, if you want it to be automated, set it:
/etc/network/interfaces

auto eth1
iface eth1 inet manual
        up ifconfig eth1 promisc up
        down ifconfig eth1 promisc down

Then:

/etc/init.d/networking restart && ifup eth0 && ifup eth1

Now, your network interface reads every packages, so you can start using natdet:

As shown in the readme:

natdet -v -i eth0 'RULES'

-v : verbose
-vv : more verbose
-i : set interface
-l : set log file
-d : run in background

- RULES : You can set up rules like in tcpdump

And now, just wait, it needs some time to find users who use NAT.

Monday, July 15, 2013

Postfix behind Iptables masquerade (NAT)


I've been working on a mail server behind iptables masquerade for some days, and it just didn't work, but I found the solution, it may help you.

If you use SMTP server behind NAT, and you get the following errors:
  • mail postfix/smtp[7854]: warning: host gmail-smtp-in.l.google.com[173.194.70.26]:25 greeted me with my own hostname mail.example.com
  • mail for gmail.com loops back to myself
you should check your iptables configuration. A proper port-forward config:



iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d PUBLICIP --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -t nat -A PREROUTING -p tcp --dport 25 -i eth0 -j DNAT --to MAILSERVERPRIVATEIP:25

(Only forward packets from port 25 to your mail server's private IP port 25, if it comes from the outside.)

You can test it on your mail server by telnetting to a foreign smtp server for example:

telnet smtp.gmail.com 25

It should show:

Trying 173.194.70.108...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP r54sm45040303eev.8 - gsmtp

If you see


220- mail.yourdomain.com gsmtp

you config is not good yet.

Wednesday, April 10, 2013

Cisco router Telnet Debug

On most of Cisco routers, debug informations via telnet is not enabled, so you will not see any debug information when connected via telnet.

To enable it, you need to enable virtual terminal first:
Router# terminal monitor

Next, you have to enable debugging on virtual monitor:

In privileged mode:
Router# undebug all

In configuration mode:
Router(config)# logging monitor debugging
Router(config)# logging on


To disable it:

In privileged mode:
Router# undebug all
Router# terminal no monitor

In configuration mode:
Router(config)# no logging monitor

Thursday, January 31, 2013

Counter Strike: GO Classic Competitive ,MapGroup not found'

How to solve: ,,Mapgroup not found" error in CS:GO Classic Competitive:

1.
cd steam/csgo/csgo
nano gamemodes_server.txt

2.
You should find a commented line, starting with a 2:
2//some comment

3.
Delete 2 before the commetn:
//some comment

4.
Restart server

Now it should work, it's a bug, valve somehow left a ,,2" before the line, and because of that, the server thinks, that its the end-of-file, so the map groups are not loaded.



Friday, January 18, 2013

Windows Server 2008 R2 RDP Port Change

You need to do 3 steps to enable and change RDP Port in Windows Server 2008, 2008R2, 2012. You need to do this, if you have more servers at the same IP address, behind a router.

1st step: Enable RDP in System settings. You can go there by right clicking on Computer -> Propreties. Choose Advanced System Settings from the left side menu.


2nd Step: Change RDP Port: Open the registry editor (regedit: open cmd -> regedit.exe). Select HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber . Change to decimal mode, and change the port number, then click ok.

3rd Step: Enable the new Port in the Firewall settings. Open Server Manager, Select Firewall Settings in the left menu, right click on Inbound Rouls -> New. Choose TCP, set Port number, and name it.


Thats all. After this you should restart your server, then everything should work fine. Default port for RDP is 3389 (TCP). Enjoy.




Saturday, December 1, 2012

ISPConfig + NginX + PHP-FPM + multiple PHP versions

This article is about setting up multiple PHP versions with PHP-FPM with nginx. Basically, its a note for myself, but maybe you can also use it. When this article was written, the stable PHP version was 5.4.9, so I will use that here.

It's a testing configuration, there might be security bugs, so don't use it in production!

This article is based on Ondřej Šimek's article.

So first of all, we need the actual PHP stable version, download it, unzip it, and copy it to /usr/local/src. After PHP 5.4.0, you don't need to patch. (if you need previous version, use Ondřej Šimek's tutorial for patching)

wget http://www.php.net/get/php-5.4.9.tar.gz/from/a/mirror
tar xjf php-5.4.9.tar.gz

mkdir /usr/local/src/php
mkdir /usr/local/src/php/5.4.9
mv php-5.4.9 /usr/local/src/5.4.9

Next, we need to run ./configure, and compile it. I like to install php separately to /opt/php/5.4.9

mkdir /opt/php
mkdir /opt/php/5.4.9

So run ./configure with the choosen options. You need at least these:
--prefix=/opt/php/5.4.9
--enable-fpm
(--enable-fastcgi)
--without-pear

./configure --prefix=/opt/php/5.4.9 --enable-fpm --without-pear

You may or may not need to use --enable-fastcgi, it depends on the php-version, as I can remember, since 5.3.0 you don't need to use, because it's a must-have option.

After running configure, run:

make & make install

It will create some files in /opt/php/5.4.9. You may need to copy the recommended php.ini from the source folder:

cp /usr/local/src/php-ini-production /opt/php/5.4.9

Now, you need to change some configurations in the inis:

nano /opt/php/5.4.9/etc/php-fpm

ISPConfig uses listen port 9000, so you need to change it, to for example: 9001. You may want to set up logging, you can find several lines and settings about logging, its not hard to find.

Now, you can start php-fpm:

./opt/php/5.4.9/sbin/php-fpm

Next, go to your admin panel (ISPConfig), go to System, and additional PHP versions (only available in ISPConfig 3.0.5!). Create a new php version:

FastCGI settings:
Binary: /opt/php/5.4.9/bin
PHP.ini directory: /opt/php/5.4.9

PHP-FPM settings:
init-script: /opt/php/5.4.9/etc
PHP.ini directory: /opt/php/5.4.9/
POOL directory: /opt/php/5.4.9

Save it, then go to websites, and change PHP-version where you need. It will throw a ,,Bad Gateway" error,  because you didn't edit the nginx settings:

cd /etc/nginx/sites-available
nano yoursite.vhost

Then change the listen port to the port you defined earlier.

fastcgi_pass 127.0.0.1:9001

At the and: reload nginx and hurray.

/etc/init.d/nginx reload

HURRAY

Now, I have to figure out how to automatise the port change in the .vhost files.. 




Sunday, October 14, 2012

Több COD4 szerver egy szerver fájljaiból

Igen. A COD4-nek nem szükséges, hogy szerverenként felmásoljuk a szerverre a játék fájljait, így rengeteg helyet spórolhatunk meg. Egyszerüen elég, ha elhitetjük vele, hogy ott vannak a fájlok, ahol ő azt keresni fogja. Erre tökéleset megoldás a symlink -ek használata.

Tehát a következőképpen kell használni:

ln -s target_path link_path

Tehát, tegyük fel, hogy szeretnénk 4 szervert, ehhez a következő mappa struktúrát vegyük fel:

cod4:
-bin
-28960
-28961
-28962
-28963

A bin mappába másoljuk a gyári fájlokat, amik a dvd-n találhatóak ( main, mods stb.. ), majd töltsük le a legújabb (1.7) linux-os indítót ( lnxded ), ezt csomagoljuk ki, és másoljuk be mind a 4 mappába ( 28960 - 28963 ). 

Ezután hozzuk létre a symlinkeket:

ln -s /cod4/vin/main main
ln -s /cod4/bin/Mods Mods
.
.
.
Ezt szépen végig játszuk az összes mappával.

Ezután már csak létre kell hozni szerverenként a config fájlokat, illetve csinálhatunk egy indító fájlt. És már indíthatjuk is:

screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28960 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate

screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28961 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate

screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28962 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate

screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28963 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate

Saturday, October 13, 2012

Call of Duty 4 szerver Linuxon

A szerver elkészítéséhez szükségünk van a játék dvd-n található fájlokra, pontosabban a setup/main mappára. Első lépésként töltsük fel a szerverre (például winscp -vel), ez eltarthat egy ideig a hálózati kapcsolatunk sebességétől függően.

Telepítés:

A cod4 előnye, hogy ha több szervert szeretnénk futtatni, azt megtehetjük ,,osztott" erőforrásokkal, tehát csak egy main könyvtárra lesz szükségünk, ez nagy segítség, hiszen 1-1 szerver akár 4-5 GB helyet is foglalna.

( Ha több szervert szeretnél egyszerre érdemes EZT is elolvasnod! )

Feltöltés után hozzunk létre egy könyvtárat, például a usr mappában, de akár saját usert is hozzárendelhetünk a /home -ban. Biztonsági okokból ajánlott nem root-ként futtatni a szervereket.

mkdir /usr/local/games/cod4

Másoljuk át a fájlokat!

Töltsük le a legfrissebb (1.7) binárisokat pl. innen. (cod4 lnxded 1.7)

wget http://www.shrapnet.com/downloads/cod4-linux-server-06282008.tar.bz2

Ezután tömörítsük ki:

tar -jxvf cod4-linux-server-06282008.tar.bz2

Ha minden jól megy, a következő fájlokat találjuk kicsomagolás után:

cod4_lnxded
cod4_lnxded-bin
libgcc_s.so.1
libstdc + +. so.6
README.linux
pbsetup.run

Ezzel lényegében el is készültünk, most már csak konfigurálni kell.

Konfigurálás:

Ha szeretnénk, hogy a szerver fusson kijelentkezés után is, telepítsük a screen-t:

apt-get install screen

A screen egy ügyes kis program, röviden: képes több terminált emulálni:
ctrl+a+c = új terminál
ctrl+a+n = következő terminál
További lehetőségek: man screen

Igény esetén létrehozhatunk egy indító fájlt, így indításkor csak le kell futtatnunk:

echo > cod4_starter.sh
nano cod4_starter.sh

A következőket másoljuk bele:

screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28960 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate

röviden:

sv_pure 1 : a szerver ellenőrzi, hogy a játékosok fájljai nem ,,sérültek".
net_port : port, ahol elérheted
dedicated 2 :dedikált netes szerver
sv_punkbuster : engedélyezed a pb-t
exec: mindenféle fájlt megynittathatsz vele, pl configot is

A következő portokat érdemes felnyitni:

UDP 20800
UDP 20810
UDP 28960

A server.cfg fájlodat pedig ügyesen feltöltheted mindenféle csilivili beállítással, erre rengeteg generátor létezik, egyszerüen keress rá guglin: "cod4 server.cfg generator".






Friday, October 12, 2012

STEAMCMD Segmentation fault

If you use SteamCMD on Hardened Gentoo, you need some additional security configuration otherwise it will throw:

./steam.sh: line 67: 22525 Segmentation fault ${DEBUGGER}
"${STEAMROOT}"/${PLATFORM}/${STEAMEXE} "$@"

It throws because of PaX. PaX is a security layer of hardened gentoo, which helps to prevent some attacks. We will user paxctl, For more informations:

man paxctl

So first, go to steamcmd (usually it's in /ga/me/folder/steam/linux32)

cd /ga/me/folder/steam/linux32

You can check pax flags:

paxctl -v steamcmd

PaX control v0.7
Copyright 2004,2005,2006,2007,2009,2010,2011,2012 PaX Team <pageexec@freemail.hu>

Then you need to set up some flags:
-x: disable RANDEXEC
-e: disable EMUTRMA
paxctl -ex steamcmd
Then check flags:
paxctl -v steamcmd
PaX control v0.7
Copyright 2004,2005,2006,2007,2009,2010,2011,2012 PaX Team <pageexec@freemail.hu> 
- PaX flags: -------x-e-- [steamcmd]
RANDEXEC is disabled EMUTRAMP is disabled


Update:
Keep in mind: If you update steam, you have to do this again! (The updater will download a new steamcmd, so there will be no PaX headers!)

Sunday, September 30, 2012

Gentoo: Apache does not interpreting PHP

If you use Gentoo/CentOS with Apache2 and PHP, and PHP is not interpreted, you should do the followings:

Open Apache2's configurations:
nano /etc/conf.d/apache2

Change the line:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D USERDIR"

After changing the line, don't forget to restart Apache:
/etc/init.d/apache2 restart

Now it should work!

Sunday, August 26, 2012

Counter Strike: Global Offensive szerver készítés linuxon

A következő cikkben bemutatom, hogy hogyan lehet Counter Strike: GO szervert telepíteni Linuxra. Első lépésként, ha még nem tettük volna meg, telepítsük a SteamCMD-t.  A SteamCMD telepítéséről itt olvashatsz.

Telepítés:


Adjuk meg a telepítési útvonalat, például:
force_install_dir ./cs_go/

Némelyik Linux disztribúción hibásan működik, ha a telepítési útvonalban nagy betűket használunk, erre figyeljünk oda!

Adjuk meg, hogy melyik játékot szeretnénk telepíteni, ez CS:GO esetében 740-es kód:
app_update 740 validate

Ezután, ha a játék még nincs telepítve, akkor letölti a szükséges fájlokat, ha telepítve van, akkor megpróbálja frissíteni a játékot. Ha használjuk a validate kulcsszót, ellenőrzi a fájlok konzisztenciáját. (Később ezzel a paranccsal tudjuk frissíteni a szervert! Az útvonal megadása ez esetben is kötelező!)

Váltsunk a cs_go mappába:
cd cs_go

Beállítások:

A csgo mappán belül találjuk a beállításokat tartalmazó .txt kiterjesztésű fájlokat, itt főként a játékmenetet befolyásoló beállítások vannak.

A csgo/cfg mappán belül kell elhelyezni a server.cfg nevű fájlt, alap esetben nem hozza létre, ezt nekünk kell megtenni: ( Ha nem tesszük meg, semmi gond, az alap beállításokat fogja használni! ).

cd csgo/cfg
echo > server.cfg

Ide másoljuk be a következőket:

hostname "Counter-Strike: Global Offensive Dedicated Server" // a szervered neve
rcon_password "yourrconpassword" //rcon jelszó
sv_password "" //szerver jelszó
Ezeken felül további beállításokat is használhatsz:

mp_freezetime 5 //Vásárlási idő
mp_join_grace_time 15 //Mennyi ideig lehet még csatlakozni kezdés után
mp_match_end_restart 0 // Meccs végi pálya restart 
sv_cheats 0 //Csalás kikapcsolása
sv_lan 0 //LAN mód kikapcsolása

A következő bot beállítások a szerver alap beállításai:

bot_difficulty 1 
bot_chatter "off" 
bot_join_after_player 1
bot_quota 10 
bot_quota_mode "fill"

A következő beállításokkal bannolhatunk játékosokat a szerverről:

writeid 
writeip 
exec banned_user.cfg 
exec banned_ip.cfg


A csgo/config appán belül pedig a szerverrel kapcsolatos beállítások, például itt állíthatjuk be a szervert nevét, jelszavát.


Indítás


Az indításhoz lépjünk be a steam/cs_go mappába:
cd steam/cs_go

A játék 4 féle játékmódot támogat, ezek alapján a következőképpen lehet elindítani a szervert:


Classic Casual:
./srcds -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_bomb +map de_dust

Classic Competitive:
./srcds -game csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_bomb +map de_dust 

Arms Race:
./srcds -game csgo -console -usercon +game_type 1 +game_mode 0 +mapgroup mg_armsrace +map ar_shoots

Demolition:
./srcds -game csgo -console -usercon +game_type 1 +game_mode 1 +mapgroup mg_demolition +map de_lake



Egyéb

Igény esetén lehet saját MOTD-t beállítani:
csgo mappában

echo > motd.txt

ide írhatunk be pl. egy weblap címét, melyet böngésző-szerűen fog megjeleníteni

A játék admin oldali része, illetve beállításai szinte megegyeznek a Counter Strike: Source beállításaival.


A tutorial az eredeti Steam-es ajánlás alapján készült.