Sunteți pe pagina 1din 15

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

> Blog

Home > Blog > Development Oracle Database 11g + Drupal 7 Installation Routine

Oracle Database 11g + Drupal 7 Installation Routine

05.09.2013 0 Comments

11g + Drupal 7 Installation Routine 05.09.2013 0 Comments Author: kef The article describes CMS Drupal

Author: kef

The article describes CMS Drupal deployment, as being performed with the use of Oracle DB and with Debian server employed. Thus, at our disposal we have Debian X64 operation system, nginx webserver and php-fpm back end server which is geared toward handling the php scripts. A good many of articles have described Nginx + php-fpm server deployment routine, hence there's no need to fix on it for long, and we shall directly proceed to preparing the Oracle DB installment. First a Drupal developer will need to install

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

the whole number of php modules that we may require:

# apt-get install php5-mysql php5-curl php5-dev php-pear php-db php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

# /etc/init.d/php5-fpm restart

As long as we have used Debian Based ОС, RPM packages, the standard installation routine, thus and so, will not work out. Hence, we will make use of Alien utility in this case:

# apt-get install alien

We next proceed to the libraries we require:

# apt-get install libaio1 unixodbc

As to core parameters, we work them out as follows: we create /etc/sysctl.d/60-oracle.conf file which contains:

fs.file‐max=6815744

net.ipv4.ip_local_port_range=9000 65000 kernel.sem=250 32000 100 128

kernel.shmmax=536870912

And then we get the following command running:

# service procps start

On top of this, for we are dealing with Debian operation system, it seems that we are in need of a catalog to keep the database and the client:

# mkdir /home/oracle-xe

# ln -s /home/oracle-xe /u01

Next, we take up the Oracle DB installation, proper. We have to primarily download zip

archive Oracle Database Express Edition 11g Release 2 for Linux x64 right away which can

be

at:

edition/downloads/index.html. Then we do the unpacking which is to be followed by cleaning out the wastes (mind that the version of your package may differ!) :

# unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

# mv Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm ./

# rm -r Disk1

We are creating the package with the help of Alien utility:

# alien --to-deb --scripts oracle-xe-11.2.0-1.0.x86_64.rpm

At this point we are in lack of /sbin/chkconfig file in the Debian system, which is required to support the installer, this type of file, thus, should be created and should contain the following:

#!/bin/bash

# Oracle 11gR2 XE installer chkconfig hack for Debian based Linux (by dude)

Only run once. echo "Simulating /sbin/chkconfig if [[ ! `tail ‐n1 /etc/init.d/oracle‐xe | grep INIT` ]]; then cat >> /etc/init.d/oracle‐xe <<‐EOM

#

"

#

### BEGIN INIT INFO

# Required‐Start:

# Required‐Stop:

# Default‐Start:

# Default‐Stop:

# Short‐Description:

### END INIT INFO EOM fi update‐rc.d oracle‐xe defaults 80 01

\$remote_fs \$syslog

\$remote_fs \$syslog

2 3

0 1

4 5

6

Oracle 11g Express Edition

We supply the launch admission:

# chmod 755 /sbin/chkconfig

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

Incidentally, we shoud configure out the compatibility with Debian system:

# ln -s /usr/bin/awk /bin/awk

# mkdir /var/lock/subsys

Next, we proceed to installing Oracle DB (in the event of conflict of the following file configuration /etc/init.d/oracle-xe we should opt for “install the package version” [Y]) :

# dpkg --install ./oracle-xe_11.2.0-2_amd64.deb

Setting up Oracle:

# service oracle-xe configure

We enter the web interface port number, database port number and the password which the user of SYSTEM database will require.

We set the password for Oracle system user:

# passwd oracle

We set the HOME directory for Oracle user:

#

cp /etc/skel/.bash_logout /u01/app/oracle

 

#

cp /etc/skel/.bashrc /u01/app/oracle

#

echo

'.

/u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh'

>

/u01/app/oracle/.profile

 

#

chown -R oracle:dba /u01/app/oracle

 

To

set

up

the

correct

SID,

we

make

the

file

/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora look like follows (you set the “PORT” value to one of your own):

# tnsnames.ora Network Configuration File:

XE = (DESCRIPTION =

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(SERVICE=XEXDB)(HOST = 127.0.0.1)(PORT = 1521))

)

(CONNECT_DATA = (SERVICE_NAME = XE)

)

)

While /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora should look like (you should replace “PORT” and “HOST” values for your own, and mind that “HOST” should stand for the hostname, not the IP address):

# listener.ora Network Configuration File:

SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = XE) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) (PROGRAM = extproc)

)

)

LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE)) (ADDRESS = (PROTOCOL = TCP)(HOST = debian)(PORT = 1521))

)

)

DEFAULT_SERVICE_LISTENER = (XE)

Besides, the environment variables need to be adjusted, as they are not set up at the moment of package installation. For this, we add the following strings into /etc/environment file:

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe

TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin

ORACLE_SID=XE

LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib

NLS_LANG=AMERICAN_AMERICA.AL32UTF8

Thenweperforminstallationofthevariablesfor$PATHenvironmentasmeantfortheusers

whohavebeengrantedtheaccesstosqlplus:

#echo'PATH=$PATH:/u01/app/oracle/product/11.2.0/xe/bin'>>~root/.bash_profile

#echo'PATH=$PATH:/u01/app/oracle/product/11.2.0/xe/bin'>>~oracle/.bash_profile

As

the

/u01/app/oracle/product/11.2.0/xe/bin/oracle file,orelseanerrormessagewillbethrownupat

status should

it

is,

the

file admission

be

set

up

correctly to

themomentofsqlplusauthorization“ORA­12547:TNS:lostcontact”:

#chmod6751/u01/app/oracle/product/11.2.0/xe/bin/oracle

Afterwards,weperformtheserverrebootandtrylogginginthesqlplusconsole:

#reboot

(Important! The download having been done, 502 Bad Gateway error may pop up the moment the page is accessed. That requires rebooting php­fpm: # /etc/init.d/php­fpm restart )

#sqlplusSYSTEM

Atthispoint,OracleDBsetupiscomplete.ThenextstepinvolvesinstallingphpPDO_OCI modulewhichiscrucialforDrupalandOracleDBinteraction.We,further,createatemporary directory to download Oracle instance client into. It can be tracked by the following link:

archives:instantclient­basic,instantclient­sdk,instantclient­sqlplus)andthenweunpackthem

(mindthatyourarchives'versionscandiffer):

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

#unzipinstantclient­basic­linux.x64­12.1.0.1.0.zip

#unzipinstantclient­sqlplus­linux.x64­12.1.0.1.0.zip

Weshouldcreatesymboliclinksatthispoint,whichwillreferustotherequiredlibraries:

#cd/u01/app/oracle/instantclient

#ln­slibclntsh.so.*libclntsh.so #ln­slibocci.so.*libocci.so

#echo/u01/app/oracle/instantclient>>/etc/ld.so.conf

#ldconfig

#mkdir­pinclude/oracle/11.1/

#cdinclude/oracle/11.1/

#ln­s/u01/app/oracle/instantclient/sdk/include/client

#cd/u01/app/oracle/instantclient

#mkdir­plib/oracle/11.1/client

#cdlib/oracle/11.1/client

#ln­s/u01/app/oracle/instantclientlib

#ln­s/usr/include/php5//usr/include/php

Weproceedtophp_ocimoduledownloading:

#mkdir­p/tmp/pear/download/

#cd/tmp/pear/download/

#pecldownloadpdo_oci

Nowit'sbiengunpacked:

#tar­xvzfPDO_OCI*.tgz

#cdPDO_OCI*

Nowwehavetopatchthemodule.Wewriteinconfig.m4.patchfilewhichcontainsthefollowing:

*** config.m4 2005-09-24 17:23:24.000000000 -0600

--- config.m4 2009-07-07 17:32:14.000000000 -0600

***************

*** 7,12 ****

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then

if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3

+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then

+ PDO_OCI_VERSION=11.1

elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then

PDO_OCI_VERSION=10.1

elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then *************** *** 119,124 **** --- 121,129 ----

then *************** *** 119,124 **** --- 121,129 ---- 10.2) PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) ;; +

10.2)

PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) ;;

+ 11.1)

+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)

+ *) AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION) ;;

;;

Wesavethefileandpatchit:

#exportORACLE_HOME=/u01/app/oracle/instantclient

# patch --dry-run -i config.m4.patch

# patch -i config.m4.patch

Thenwehavethemodulecompiledandinstalled:

#phpize

# ./configure --with-pdo-oci=instantclient,/u01/app/oracle/instantclient,11.1

#make

# make test

# make install

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

Phpconfigurationfilehavingbeenadded,wegetthemodulerunning:

#touch/etc/php5/fpm/conf.d/pdo_oci.ini

#echo"extension=pdo_oci.so">/etc/php5/fpm/conf.d/pdo_oci.ini

#/etc/init.d/php5­fpmrestart

Youcancheckupwhetherphpmoduleworkswithuseofinfo.phpfile.Toachivethiswecreate

info.phpfile(Fornginxit's/usr/share/nginx/html/)thatcontainsthefollowing:

<strong><span><?php<br><span>phpinfo</span><span>();</span><br><span>?></span> </span></strong>

Once finished, we start it running in the browser window http://host-ip/info.php (where host­ip will be changed for ІР addres or domain which points out to the server), and the activatedmodulesshouldenlistpdo_oci.

to the server), and the activatedmodulesshouldenlistpdo_oci.

Ifit'sdone,wecanproceedtoemployingDrupal.First,tablespaceshouldbecreatedandgotten

ready.Thattakescaution:sqlplusconsoletakesnoexcuses:

#sqlplusSYSTEM

SQL>createtablespacedrupal

2 logging

3 datafile'/u01/app/oracle/oradata/XE/drupal.dbf'

4 size32m

5 autoextendon

6 next32mmaxsize3072m

7 extentmanagementlocal;

SQL>createuserdrupalidentifiedbypassword(wherepasswordisuserpassword)

2 defaulttablespacedrupal

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

3 temporarytablespacetemp;

SQL>grantunlimitedtablespacetodrupal;

SQL>connsys/passwordassysdba(passwordreplacewithpasswordofuserSYSTEM)

SQL>grantexecuteondbms_cryptotodrupal;

SQL>grantselectonv_$sql_plantodrupal;

SQL>grantselectonv_$sqlareatodrupal;

SQL>grantconnecttodrupal;

SQL>grantresourcetodrupal;

Tablespaseisupandrunning,thuswecanleavethesqlplusconsole(Cntrl+D).Wemoveinto therootofoursite,sayinthewhereaboutsof /usr/share/nginx/html/(asthedefaultone,Nginx serverdirectoryisbeingused)

#cd/usr/share/nginx/html/

Intheeventofanyfiletherein,theyaretobedeleted:

#rm­r./*

The recent Drupal version is to be downloaded, which can be accessed by reference on the

#wgethttp://ftp.drupal.org/files/projects/drupal­7.23.tar.gz

Weunpackthearchiveandpastethefilesintotherootcataloge:

#tar­xzvfdrupal­7.23.tar.gz

#cp­rdrupal­7.23/*./

ThenwedeletethearchiveandDrupalcatalogwhichwedon'tneedanymore:

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

#rm­rdrupal­7.23drupal­7.23.tar.gz

WeinstallthemodulewhichallowsthecooperationwithOracleDB.

We download

the

module

(it's

recent

version

can

be

linked

to

by

#cdincludes/database/

Weunpackanddeletethearchivewearenolongerinneed:

#tar­xzvforacle­7.x­1.12.tar.gz

#rmoracle­7.x­1.12.tar.gz

#cdoracle/module/

#mvoracle//usr/share/nginx/html/sites/all/modules/

(westilldefineourpathtotherootcatalogofDrupal)

Wesetupthecorrectfileadmissions:

#cd/usr/share/nginx/html/ #chown­Rwww­data:www­data./

#chmod­R750./

Finally, in the browser window. we activate the link leading to our future site http://host- ip/install.php (wherein we replace host-ip меняем with the ІР address, which points out to the server). One should keep in mind that the next step implies writing in “XE” into the “Database name” field, by no means tablespace, which has been created by us, whareas “Database username” the user proper (the one created by us) and not the “SYSTEM”.

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

The remaining part of the installation process does not

The remaining part of the installation process does not differ from the usual routine much:

we enter data about the site and take up the next step. Now the installation is complete. we are in a possession of a ready-to-use Drupal package, which runs on Oracle.

Rating

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

READ ALSO

1
1

7281

views

Experienced Drupal coders can hardly do without Drush (Drupal shell) utility, as it speeds up a good deal of routine function along the

2
2

6963

views

You may face a situation, at times, when both HTTP and

3
3

2848

views

There are certain instances when you are being encouraged to implement access control practices

4
4

8070

views

Module rules allows us to implement the events (actions) after performing certain actions (events).It has a

5
5

4009 views

Let us give a brief outline of the library to be going with. pChart

Join to peoples who already subscribe

Email

SUBSCRIBE

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

0Comments

internetdevels.com

1

Login

Recommend

Share

SortbyNewest

 1 Login  Recommend ⤤ Share SortbyNewest Startthediscussion… Bethefirsttocomment. ✉ Subscribe d

Startthediscussion…

Bethefirsttocomment.

Subscribe

d

AddDisqustoyoursite

HEAD OFFICE

Bozhenka st. 34g, Lutsk, 43017, Ukraine

+38 066 170 74 18

v.levandovsky

Privacy

NEWSLETTER

Subscribe to receive our exclusive newsletter. Don't worry we'll never use your email address for evil purposes.

Enter your email here!
Enter your email here!

SUBSCRIBE

7/30/2015

OracleDatabase11g+Drupal7InstallationRoutine—Internetdevelsofficialblog

©2007 - 2015 INTERNETDEVELS. Web development army for hire