How to install Apache2 (CentOS 5.4)

May 5, 2010 admin No comments
# yum install httpd httpd-devel
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
# service iptables restart

Check disable SElinux !!!
How to disable SElinux

Categories: CentOS Tags:

Subversion & Server sent unexpected return value (403 Forbidden) in response to OPTIONS (Subversion & Mod_Security 2.5.11)

April 7, 2010 admin No comments

vhost.conf

...
<IfModule mod_security2.c>
       SecRuleInheritance Off
       SecRuleEngine Off
       SecAuditEngine Off
       SecRequestBodyAccess Off
       SecResponseBodyAccess Off
</IfModule>
...
Categories: Troubleshooting Tags:

ORA-00018 or ORA-12516 or ORA-12571 (Symfony & PDO & PHP)

March 1, 2010 admin No comments
PropelException: Unable to open PDO connection [wrapped: SQLSTATE[01002]: OCISessionBegin: ORA-00604: error occurred at recursive SQL level 1
ORA-00018: maximum number of sessions exceeded
 (ext\pdo_oci\oci_driver.c:632)]
PropelException: Unable to open PDO connection [wrapped: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12516: TNS:listener could not find available handler with matching protocol stack (ext\pdo_oci\oci_driver.c:581)]
PropelException: Unable to open PDO connection [wrapped: SQLSTATE[HY000]: OCISessionBegin: ORA-12571: TNS:packet writer failure (ext\pdo_oci\oci_driver.c:632)]
cd $ORACLE_HOME
su oracle -c "./bin/sqlplus \"/as sysdba\""
show parameter session
show parameter processes
alter system set processes=200 scope=spfile;
shutdown immediate
startup
show parameter session
show parameter processes
Categories: Oracle, PHP, Symfony, Troubleshooting Tags:

How to install MySQL (CentOS 5.4)

February 17, 2010 admin No comments
# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

 

# mysql -u root -p
CREATE DATABASE ris CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'ris'@'localhost' IDENTIFIED BY 'myPassword';
GRANT ALL ON ris.* TO 'ris'@'localhost';
Categories: CentOS, MySQL Tags:

PHP & PEAR SAOP

February 17, 2010 admin No comments
# pear install -f --alldeps SOAP

soapservice.php

<?php
require_once 'PEAR.php';
require_once 'SOAP/Server.php';
require_once 'SOAP/Disco.php';
require_once 'SOAP/Value.php';
require_once 'SOAP/Fault.php'; 

$skiptrace =& PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
$skiptrace = true; 

class Service {
	var $__dispatch_map = array(); 

	function Service()
	{
		$this->__dispatch_map['now'] = array(
			'in' => array('format' => 'string'),
			'out' => array('time' => 'dateTime'));
	}
	function now($format)
	{
		if($format == '')
		{
			return new SOAP_Fault("Falscher Paramerter!","0815","Client");
		}

		return new SOAP_Value('time','dateTime',date($format));
	}
} 

$server = new SOAP_Server();
$service = new Service();
$server->addObjectMap($service, 'urn:soapservice'); 

if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD']=='POST')
{
	$server->service($HTTP_RAW_POST_DATA);
}
else
{
	// Create the DISCO server
	$disco = new SOAP_DISCO_Server($server,'soapservice');
	header('Content-type: text/xml');
	if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'wsdl') == 0)
	{
		echo $disco->getWSDL();
	}
	else
	{
		echo $disco->getDISCO();
	}
}
?>

http://localhost/soapservice.php?wsdl

<?xml version="1.0" ?>
<definitions name="soapservice"
	targetNamespace="urn:soapservice"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="urn:soapservice"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
	xmlns="http://schemas.xmlsoap.org/wsdl/">

	<types xmlns="http://schemas.xmlsoap.org/wsdl/" />
	<message name="nowRequest">
<part name="format" type="xsd:string" />
	</message>
	<message name="nowResponse">
<part name="time" type="xsd:dateTime" />
	</message>
<portType name="soapservicePort">
		<operation name="now">
			<input message="tns:nowRequest" />
			<output message="tns:nowResponse" />
		</operation>
	</portType>
	<binding name="soapserviceBinding" type="tns:soapservicePort">
		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
		<operation name="now">
			<soap:operation soapAction="urn:soapservice#Service#now" />
			<input>
				<soap:body use="encoded" namespace="urn:soapservice" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded" namespace="urn:soapservice" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
	</binding>
	<service name="soapserviceService">
		<documentation />
<port name="soapservicePort" binding="tns:soapserviceBinding">
			<soap:address location="http://localhost:8182/soapservice.php" />
		</port>
	</service>
</definitions>

VB SOAP Samples
Download VB Source

Option Explicit

Private Sub cmdGo_Click()
        Dim SOAPSerializer As MSSOAPLib30.SoapSerializer30
        Dim SOAPConnector As MSSOAPLib30.SoapConnector30
        Dim SOAPReader As MSSOAPLib30.SoapReader30

        Set SOAPConnector = New MSSOAPLib30.HttpConnector30

        On Error Resume Next
        Err.Clear

        SOAPConnector.Property("EndPointURL") = txtUrl.Text '"http://localhost/soapservice.php"
        SOAPConnector.Connect

        ' Set Method Call
        SOAPConnector.Property("SoapAction") = "urn:soapservice"
        SOAPConnector.BeginMessage

        Set SOAPSerializer = New MSSOAPLib30.SoapSerializer30
        SOAPSerializer.Init SOAPConnector.InputStream

        SOAPSerializer.StartEnvelope
        SOAPSerializer.StartBody

        SOAPSerializer.StartElement "now", "urn:soapservice"
        SOAPSerializer.StartElement "Format"
        SOAPSerializer.WriteString txtFormat.Text ' "Y-m-d"
        SOAPSerializer.EndElement
        SOAPSerializer.EndElement

        SOAPSerializer.EndBody
        SOAPSerializer.EndEnvelope

        ' Tell the serializer that we are finished providing all message
        SOAPSerializer.Finished
        SOAPConnector.EndMessage

        If Err.Number = 0 Then
                Set SOAPReader = New MSSOAPLib30.SoapReader30
                SOAPReader.Load SOAPConnector.OutputStream
                If Not SOAPReader.Fault Is Nothing Then
                        txtResult.Text = SOAPReader.FaultString.Text
                        txtResult.BackColor = &HC0C0FF
                Else
                        txtResult.Text = SOAPReader.RpcResult.Text
                        txtResult.BackColor = &HC0FFC0
                End If
        Else
                txtResult.Text = Err.Number
                txtResult.BackColor = &HFF&
        End If
End Sub

MS Download Page SOAP Toolkit 3.0
VB SOAP Samples

Categories: PHP, SOAP Tags:

How to update PHP 5.1 To 5.2 (CentOS 5.4 & Plesk 9.3 bei hosteurope.de)

February 17, 2010 admin No comments
# yum update
# php -v
PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

 

# vi /etc/yum.repos.d/CentOS-Testing.repo

Copy/paste the following into this file:

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*
# yum update

 

# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

 

# yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc libxml2 libxml2-devel php-session php-mbstring php-mcrypt php-mhash curl curl-devel perl-libwww-perl
#  rpm -qa | grep php
php-odbc-5.2.10-1.el5.centos
php-common-5.2.10-1.el5.centos
php-gd-5.2.10-1.el5.centos
php-ldap-5.2.10-1.el5.centos
php-imap-5.2.10-1.el5.centos
php-xmlrpc-5.2.10-1.el5.centos
php-5.2.10-1.el5.centos
php-mcrypt-5.2.9-2.el5.centos.3
php-xml-5.2.10-1.el5.centos
php-devel-5.2.10-1.el5.centos
php-cli-5.2.10-1.el5.centos
php-mhash-5.2.9-2.el5.centos.3
php-mbstring-5.2.10-1.el5.centos
php-pdo-5.2.10-1.el5.centos
php-mysql-5.2.10-1.el5.centos
php-pear-1.8.1-2.el5.centos

If ImageMagick is already installed

# pecl uninstall imagick
# pecl install imagick
Categories: CentOS Tags:

OpenExpo – Videos about IT security

February 15, 2010 admin 1 comment

Sorry, this entry is only available in Deutsch.

Categories: IT-Sequrity Tags:

ModSecurity AuditLog: HTTP/1.1 500 SOAP Fault (PEAR::SOAP & Mod_Security 2.5.11)

February 4, 2010 admin No comments
...
$server = new SOAP_Server();
$service = new Service();
$server->_options['http_status_fault'] = '200 SOAP Fault'; // old status '500 SOAP Fault';
...

Links:

Categories: PHP, SOAP, Troubleshooting Tags:

Apache log: Unable to create ~/.gnome2 directory (CentOS 5.4 & Plesk 9.3 bei hosteurope.de)

February 4, 2010 admin No comments

In Apache log (/var/log/httpd/error_log )
*** libgnomevfs-WARNING **: Unable to create ~/.gnome2 directory: Permission denied

# mkdir /var/www/.gnome2
Categories: Troubleshooting Tags:

How to install ImageMagick (CentOS 5.4 & Plesk 9.3 bei hosteurope.de)

February 3, 2010 admin No comments
# yum install gcc
# yum install ImageMagick
# yum install ImageMagick-devel
# yum install php-pear
# yum install php-devel
# pecl install imagick
# echo "extension=imagick.so" > /etc/php.d/imagick.ini
# /etc/init.d/httpd restart
# yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-2.2.2.tgz
# tar zxvf ./imagick-2.2.2.tgz
# cd imagick-2.2.2
# phpize
# ./configure
# make
# make test
# make install

Verify it using the following command

# php -i | grep imagick
# rpm -qa | grep ImageMagick
# identify -version
Categories: CentOS, PHP Tags: