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 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 accessed at www.oracle.com . 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: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Oracle 11g Express Edition
### END INIT INFO
EOM
fi
update-rc.d oracle-xe defaults 80 01
We supply the launch admission:
# chmod 755 /sbin/chkconfig
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 =
(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:
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