Skip to content

Instantly share code, notes, and snippets.

@mortenbra
mortenbra / robots.txt
Created July 10, 2015 08:40
robots.txt to prevent (well-behaved) bots from accessing dynamic content
User-agent: *
Disallow: /pls/
Disallow: /apex/
Disallow: /ords/
Disallow: /web/
Sitemap: http://www.mysite.example/sitemap.xml
@mortenbra
mortenbra / apex_ords_rest_config.sh
Last active August 31, 2015 13:50
Configure ORDS RESTful Services for Apex
# configure ORDS RESTful Services for Apex
# see https://docs.oracle.com/cd/E59726_01/install.50/e39144/listener.htm#HTMIG29335
su - oracle
cd /u01/download/apex501
sqlplus /nolog
connect sys as sysdba
@apex_rest_config.sql
@mortenbra
mortenbra / apex_post_install.sql
Last active November 9, 2015 08:06
Apex post install cleanup
-- run as SYS
-- set up service profile to avoid expiring passwords
create profile web_service_profile
limit password_life_time unlimited;
alter user apex_public_user profile web_service_profile;
alter user apex_listener profile web_service_profile;
alter user apex_rest_public_user profile web_service_profile;
@mortenbra
mortenbra / apex_install.sh
Last active August 31, 2015 13:43
Install Apex into Oracle XE on CentOS
# install (or upgrade) Apex on Oracle XE on CentOS
# change to the "oracle" user (created as part of XE installation)
su - oracle
# assumes you have already copied Apex installation file to server
cd /u01/download
unzip apex_5.0.1_en.zip
cd apex
@mortenbra
mortenbra / apache_copy_apex_images.sh
Last active August 31, 2015 13:49
Copy Apex static files to Apache web folder
# copy the Apex image files to corresponding Apache web folder
# assumes you have unzipped the Apex files already
mkdir -p /var/www/apex/images
cp -rf /u01/download/apex501/images/ /var/www/apex
# note: make sure you have set up an Apache alias "/i/" to the /images folder above
@mortenbra
mortenbra / centos_apache_install.sh
Last active August 29, 2015 14:23
Install Apache on CentOS
# install Apache on CentOS
# see https://www.linode.com/docs/websites/apache/apache-2-web-server-on-centos-6
# install
yum install httpd -y
# start the server
service httpd start
# set to start automatically on boot
@mortenbra
mortenbra / ords_install_on_tomcat.sh
Last active August 29, 2015 14:23
Install ORDS on Tomcat on CentOS
# install Oracle Rest Data Services (ORDS)
# assumes you have already downloaded ORDS from the Oracle website
# and copied the ORDS zip file to the server
# unzip the files, and move them into a dedicated directory
cd /u01/download
mkdir ords210
unzip ords.2.0.10.289.08.09.zip -d ords210
mv /u01/download/ords210 /u01/ords
@mortenbra
mortenbra / tomcat_service_script_setup.sh
Last active August 29, 2015 14:22
Setup Tomcat service script to start at boot time
# assumes you have created a service script at /etc/init.d/tomcat
cd /etc/init.d/
# make the script executable
chmod 755 tomcat
# set to start at boot time
chkconfig --add tomcat
chkconfig --level 234 tomcat on
@mortenbra
mortenbra / tomcat_post_install_cleanup.sh
Last active August 29, 2015 14:22
Clean up Tomcat after installation
# Remove Tomcat default apps/pages
cd /usr/share/tomcat7/latest/webapps
rm -rf docs/*
rmdir docs
rm -rf examples/*
rmdir examples
rm -rf host-manager/*
rmdir host-manager
rm -rf manager/*
rmdir manager
@mortenbra
mortenbra / tomcat_install.sh
Last active August 31, 2015 13:44
Install Tomcat on CentOS
# download and install Tomcat
cd /u01/download
# see https://tomcat.apache.org/download-70.cgi for latest version
wget "http://www.eu.apache.org/dist/tomcat/tomcat-7/v7.0.64/bin/apache-tomcat-7.0.64.zip"
# copy file and unzip it
cp apache-tomcat-7.0.64.zip /usr/share/apache-tomcat-7.0.64.zip
cd /usr/share