How can I pass the following Oracle 10g variables to my apache?
ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH
I start my apache through service httpd start... [root@king script]# ps -ef | grep apache apache 28494 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28495 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28496 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28497 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28499 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28500 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28502 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28503 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start root 31178 16299 0 08:36 pts/2 00:00:00 grep apache
Thanks
Mad Unix wrote:
How can I pass the following Oracle 10g variables to my apache?
ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH
I start my apache through service httpd start... [root@king script]# ps -ef | grep apache apache 28494 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28495 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28496 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28497 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28499 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28500 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28502 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28503 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start root 31178 16299 0 08:36 pts/2 00:00:00 grep apache
you would put those variable assignments in the front of /etc/init.d/httpd ...
but why would/should Apache care about your Oracle server?
Am running Oracle10g on the server, I do OCI connection from php/apache to my DB 10g so how would you insert the values to apache...
On Tue, Aug 26, 2008 at 9:18 AM, John R Pierce pierce@hogranch.com wrote:
Mad Unix wrote:
How can I pass the following Oracle 10g variables to my apache?
ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH
I start my apache through service httpd start... [root@king script]# ps -ef | grep apache apache 28494 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28495 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28496 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28497 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28499 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28500 15315 0 04:02 ? 00:00:01 /usr/sbin/httpd -k start apache 28502 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start apache 28503 15315 0 04:02 ? 00:00:00 /usr/sbin/httpd -k start root 31178 16299 0 08:36 pts/2 00:00:00 grep apache
you would put those variable assignments in the front of /etc/init.d/httpd ...
but why would/should Apache care about your Oracle server?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Mad Unix wrote:
Am running Oracle10g on the server, I do OCI connection from php/apache to my DB 10g so how would you insert the values to apache...
To quote John (reading helps!):
| you would put those variable assignments in the front of /etc/init.d/httpd
Though I still don't understand why that would be needed.
Ralph
On Tue, 2008-08-26 at 10:42 +0200, Ralph Angenendt wrote:
Mad Unix wrote:
Am running Oracle10g on the server, I do OCI connection from php/apache to my DB 10g so how would you insert the values to apache...
To quote John (reading helps!):
| you would put those variable assignments in the front of /etc/init.d/httpd
Though I still don't understand why that would be needed.
I've run into this... the OCI component needs some information about where Oracle is... my advise would be to *NOT* modify the /etc/init.d/httpd script. Better to put the declarations into /etc/sysconfig/httpd. That's what the file is there for, and if you upgrade the Apache RPM, you don't have to worry about your startup script mods...
-I
i did the following, created a startup script [pons@king script]$ cat start_apache.sh #!/bin/bash ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH /usr/sbin/apachectl start
and call it from the rc.local...
On Tue, Aug 26, 2008 at 11:16 AM, Ian Forde ian@duckland.org wrote:
On Tue, 2008-08-26 at 10:42 +0200, Ralph Angenendt wrote:
Mad Unix wrote:
Am running Oracle10g on the server, I do OCI connection from php/apache
to
my DB 10g so how would you insert the values to apache...
To quote John (reading helps!):
| you would put those variable assignments in the front of
/etc/init.d/httpd
Though I still don't understand why that would be needed.
I've run into this... the OCI component needs some information about where Oracle is... my advise would be to *NOT* modify the /etc/init.d/httpd script. Better to put the declarations into /etc/sysconfig/httpd. That's what the file is there for, and if you upgrade the Apache RPM, you don't have to worry about your startup script mods...
-I
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Tue, Aug 26, 2008 at 6:01 AM, Mad Unix madunix@gmail.com wrote:
i did the following, created a startup script [pons@king script]$ cat start_apache.sh #!/bin/bash ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH /usr/sbin/apachectl start
and call it from the rc.local...
Which completely circumvents the usual process for starting up apache, and will be wiped away with a simple 'service httpd restart' or even better (the weekly logrotate), and require you to reboot the machine or call your script again. That might not be the *best* solution.
Ian's previous post about setting variables in /etc/sysconfig/httpd is correct. Define the vars in /etc/sysconfig/httpd, and make sure you export them there.
This is the intended use and the 'redhat' method.
Jim Perrin wrote:
On Tue, Aug 26, 2008 at 6:01 AM, Mad Unix madunix@gmail.com wrote:
i did the following, created a startup script [pons@king script]$ cat start_apache.sh #!/bin/bash ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH /usr/sbin/apachectl start
and call it from the rc.local...
Which completely circumvents the usual process for starting up apache, and will be wiped away with a simple 'service httpd restart' or even better (the weekly logrotate), and require you to reboot the machine or call your script again. That might not be the *best* solution.
Ian's previous post about setting variables in /etc/sysconfig/httpd is correct. Define the vars in /etc/sysconfig/httpd, and make sure you export them there.
This is the intended use and the 'redhat' method.
Also, depending on whether or not you're invoking CGI scripts, etc., you may need the following directive in your httpd.conf:
PassEnv LD_LIBRARY_PATH
with one or more of the environment variables you set in the /etc/sysconfig/httpd file mentioned above.
-Greg
Can I do the following
vi /etc/sysconfig/httpd
# Configuration file for the httpd service.
# # The default processing model (MPM) is the process-based # 'prefork' model. A thread-based model, 'worker', is also # available, but does not work with some modules (such as PHP). # The service must be stopped before changing this variable. # #HTTPD=/usr/sbin/httpd.worker
# # To pass additional options (for instance, -D definitions) to the # httpd binary at startup, set OPTIONS here. # #OPTIONS=
# # By default, the httpd process is started in the C locale; to # change the locale in which the server runs, the HTTPD_LANG # variable can be set. # #HTTPD_LANG=C ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH ~
On Tue, Aug 26, 2008 at 2:25 PM, Jim Perrin jperrin@gmail.com wrote:
On Tue, Aug 26, 2008 at 6:01 AM, Mad Unix madunix@gmail.com wrote:
i did the following, created a startup script [pons@king script]$ cat start_apache.sh #!/bin/bash ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
LD_LIBRARY_PATH_32
PATH /usr/sbin/apachectl start
and call it from the rc.local...
Which completely circumvents the usual process for starting up apache, and will be wiped away with a simple 'service httpd restart' or even better (the weekly logrotate), and require you to reboot the machine or call your script again. That might not be the *best* solution.
Ian's previous post about setting variables in /etc/sysconfig/httpd is correct. Define the vars in /etc/sysconfig/httpd, and make sure you export them there.
This is the intended use and the 'redhat' method.
-- During times of universal deceit, telling the truth becomes a revolutionary act. George Orwell _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
on 8-26-2008 8:11 AM Mad Unix spake the following:
Can I do the following
<Snip? What is wrong with the advice given already?
Ian's previous post about setting variables in /etc/sysconfig/httpd is correct. Define the vars in /etc/sysconfig/httpd, and make sure you export them there. This is the intended use and the 'redhat' method.
Did you try this instead of every other idea you have proposed?
"Computers are useless. They can only give you answers" - Pablo Picasso
Answers are useless if you don't listen to them.
"Never trust a computer you can't throw out a window." - Steve Wozniak
AMEN!
On Tue, Aug 26, 2008 at 10:11 AM, Mad Unix madunix@gmail.com wrote:
Can I do the following
vi /etc/sysconfig/httpd
# Configuration file for the httpd service.
# # The default processing model (MPM) is the process-based # 'prefork' model. A thread-based model, 'worker', is also # available, but does not work with some modules (such as PHP). # The service must be stopped before changing this variable. # #HTTPD=/usr/sbin/httpd.worker
# # To pass additional options (for instance, -D definitions) to the # httpd binary at startup, set OPTIONS here. # #OPTIONS=
# # By default, the httpd process is started in the C locale; to # change the locale in which the server runs, the HTTPD_LANG # variable can be set. # #HTTPD_LANG=C ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH ~
<snip>
Yes, that is the right way. But one point that was not clearly made is that you probably ALSO need to add to your apache configuration:
PassEnv ORACLE_BASE ORACLE_HOME [etc.]
This make the values available to PHP.
Jeff wrote:
On Tue, Aug 26, 2008 at 10:11 AM, Mad Unix madunix@gmail.com wrote:
Can I do the following
vi /etc/sysconfig/httpd
# Configuration file for the httpd service.
# # The default processing model (MPM) is the process-based # 'prefork' model. A thread-based model, 'worker', is also # available, but does not work with some modules (such as PHP). # The service must be stopped before changing this variable. # #HTTPD=/usr/sbin/httpd.worker
# # To pass additional options (for instance, -D definitions) to the # httpd binary at startup, set OPTIONS here. # #OPTIONS=
# # By default, the httpd process is started in the C locale; to # change the locale in which the server runs, the HTTPD_LANG # variable can be set. # #HTTPD_LANG=C ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
LD_LIBRARY_PATH_32
PATH ~
<snip>
Yes, that is the right way. But one point that was not clearly made is that you probably ALSO need to add to your apache configuration:
PassEnv ORACLE_BASE ORACLE_HOME [etc.]
This make the values available to PHP.
Or you could add those environment variables in /etc/profile.d, create a file called oracle.sh and put those environment variables there, then in /etc/httpd/conf.d create a file called oracle, and add the PassEnv directives there.
At least this way the environment variables are available to all local processes and users.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
I done this.... and it works vi /etc/sysconfig/httpd
# Configuration file for the httpd service.
# # The default processing model (MPM) is the process-based # 'prefork' model. A thread-based model, 'worker', is also # available, but does not work with some modules (such as PHP). # The service must be stopped before changing this variable. # #HTTPD=/usr/sbin/httpd.worker
# # To pass additional options (for instance, -D definitions) to the # httpd binary at startup, set OPTIONS here. # #OPTIONS=
# # By default, the httpd process is started in the C locale; to # change the locale in which the server runs, the HTTPD_LANG # variable can be set. # #HTTPD_LANG=C
ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH
On Tue, Aug 26, 2008 at 6:43 PM, Ross S. W. Walker RWalker@medallion.comwrote:
Jeff wrote:
On Tue, Aug 26, 2008 at 10:11 AM, Mad Unix madunix@gmail.com wrote:
Can I do the following
vi /etc/sysconfig/httpd
# Configuration file for the httpd service.
# # The default processing model (MPM) is the process-based # 'prefork' model. A thread-based model, 'worker', is also # available, but does not work with some modules (such as PHP). # The service must be stopped before changing this variable. # #HTTPD=/usr/sbin/httpd.worker
# # To pass additional options (for instance, -D definitions) to the # httpd binary at startup, set OPTIONS here. # #OPTIONS=
# # By default, the httpd process is started in the C locale; to # change the locale in which the server runs, the HTTPD_LANG # variable can be set. # #HTTPD_LANG=C ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/10g ORACLE_SID=king LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256; export NLS_LANG NLS_DATE_FORMAT=dd-mm-yyyy ; export NLS_DATE_FORMAT export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
LD_LIBRARY_PATH_32
PATH ~
<snip>
Yes, that is the right way. But one point that was not clearly made is that you probably ALSO need to add to your apache configuration:
PassEnv ORACLE_BASE ORACLE_HOME [etc.]
This make the values available to PHP.
Or you could add those environment variables in /etc/profile.d, create a file called oracle.sh and put those environment variables there, then in /etc/httpd/conf.d create a file called oracle, and add the PassEnv directives there.
At least this way the environment variables are available to all local processes and users.
-Ross
This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos