Documente Academic
Documente Profesional
Documente Cultură
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
0 Comments
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
http://internetdevels.com/blog/oracleinstall
1/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
accessed
http://internetdevels.com/blog/oracleinstall
at:
http://www.oracle.com/technetwork/products/express2/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
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
#Oracle11gR2XEinstallerchkconfighackforDebianbasedLinux(bydude)
#Onlyrunonce.
echo"Simulating/sbin/chkconfig..."
if[[!`tailn1/etc/init.d/oraclexe|grepINIT`]];then
cat>>/etc/init.d/oraclexe<<EOM
#
###BEGININITINFO
#RequiredStart:\$remote_fs\$syslog
#RequiredStop:\$remote_fs\$syslog
#DefaultStart:2345
#DefaultStop:016
#ShortDescription:Oracle11gExpressEdition
###ENDINITINFO
EOM
fi
updaterc.doraclexedefaults8001
We supply the launch admission:
# chmod 755 /sbin/chkconfig
http://internetdevels.com/blog/oracleinstall
3/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
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
4/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
(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.oraNetworkConfigurationFile:
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:
http://internetdevels.com/blog/oracleinstall
5/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
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
Then we perform installation of the variables for $PATH environment as meant for the users
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
it
is,
the
file
admission
status
should
be
set
up
correctly
to
the
/u01/app/oracle/product/11.2.0/xe/bin/oraclefile,orelseanerrormessagewillbethrownupat
themomentofsqlplusauthorizationORA12547: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 phpfpm: # /etc/init.d/phpfpm
restart )
#sqlplusSYSTEM
At this point, Oracle DB set up is complete. The next step involves installing php PDO_OCI
modulewhichiscrucialforDrupalandOracleDBinteraction.We,further,createatemporary
directory to download Oracle instance client into. It can be tracked by the following link:
http://www.oracle.com/technetwork/topics/linuxx8664soft092277.html, (here we need the foll.
6/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
#unzipinstantclientbasiclinux.x6412.1.0.1.0.zip
#unzipinstantclientsqlpluslinux.x6412.1.0.1.0.zip
Weshouldcreatesymboliclinksatthispoint,whichwillreferustotherequiredlibraries:
#cd/u01/app/oracle/instantclient
#lnslibclntsh.so.*libclntsh.so
#lnslibocci.so.*libocci.so
#echo/u01/app/oracle/instantclient>>/etc/ld.so.conf
#ldconfig
#mkdirpinclude/oracle/11.1/
#cdinclude/oracle/11.1/
#lns/u01/app/oracle/instantclient/sdk/include/client
#cd/u01/app/oracle/instantclient
#mkdirplib/oracle/11.1/client
#cdlib/oracle/11.1/client
#lns/u01/app/oracle/instantclientlib
#lns/usr/include/php5//usr/include/php
Weproceedtophp_ocimoduledownloading:
#mkdirp/tmp/pear/download/
#cd/tmp/pear/download/
#pecldownloadpdo_oci
Nowit'sbiengunpacked:
#tarxvzfPDO_OCI*.tgz
#cdPDO_OCI*
CONTACT NOW
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 ****
--- 7,14 ----
http://internetdevels.com/blog/oracleinstall
7/15
CO
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
http://internetdevels.com/blog/oracleinstall
8/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
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/php5fpmrestart
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>
Ifit'sdone,wecanproceedtoemployingDrupal.First,tablespaceshouldbecreatedandgotten
ready.Thattakescaution:sqlplusconsoletakesnoexcuses:
#sqlplusSYSTEM
SQL>createtablespacedrupal
2logging
3datafile'/u01/app/oracle/oradata/XE/drupal.dbf'
4size32m
5autoextendon
6next32mmaxsize3072m
7extentmanagementlocal
SQL>createuserdrupalidentifiedbypassword(wherepasswordisuserpassword)
2defaulttablespacedrupal
http://internetdevels.com/blog/oracleinstall
9/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
3temporarytablespacetemp
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:
#rmr./*
The recent Drupal version is to be downloaded, which can be accessed by reference on the
site https://drupal.org/project/drupal (the version may differ):
#wgethttp://ftp.drupal.org/files/projects/drupal7.23.tar.gz
Weunpackthearchiveandpastethefilesintotherootcataloge:
#tarxzvfdrupal7.23.tar.gz
#cprdrupal7.23/*./
ThenwedeletethearchiveandDrupalcatalogwhichwedon'tneedanymore:
http://internetdevels.com/blog/oracleinstall
10/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
#rmrdrupal7.23drupal7.23.tar.gz
WeinstallthemodulewhichallowsthecooperationwithOracleDB.
We
download
the
module
(it's
recent
version
can
be
linked
to
by
https://drupal.org/project/oracle):
#cdincludes/database/
#wgethttp://ftp.drupal.org/files/projects/oracle-7.x-1.12.tar.gz
Weunpackanddeletethearchivewearenolongerinneed:
#tarxzvforacle7.x1.12.tar.gz
#rmoracle7.x1.12.tar.gz
#cdoracle/module/
#mvoracle//usr/share/nginx/html/sites/all/modules/
(westilldefineourpathtotherootcatalogofDrupal)
Wesetupthecorrectfileadmissions:
#cd/usr/share/nginx/html/
#chownRwwwdata:wwwdata./
#chmodR750./
Finally, in the browser window. we activate the link leading to our future site http://hostip/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.
http://internetdevels.com/blog/oracleinstall
11/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
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
http://internetdevels.com/blog/oracleinstall
12/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
READ ALSO
1
Creating drush-commands
Development
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...
6963 views
2848 views
There are certain instances when you are being encouraged to implement access control
practices...
8070 views
Module rules allows ustoimplement the events (actions) after performing certain actions
(events).It has a...
4009 views
http://internetdevels.com/blog/oracleinstall
13/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
0Comments
Recommend
internetdevels.com
Share
Login
SortbyNewest
Startthediscussion
Bethefirsttocomment.
Subscribe
AddDisqustoyoursite
HEAD OFFICE
Bozhenka st. 34g, Lutsk,
43017, Ukraine
+38 066 170 74 18
office@internetdevels.com
v.levandovsky
http://internetdevels.com/blog/oracleinstall
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!
SUBSCRIBE
14/15
7/30/2015
OracleDatabase11g+Drupal7InstallationRoutineInternetdevelsofficialblog
http://internetdevels.com/blog/oracleinstall
15/15