Skip to content

Instantly share code, notes, and snippets.

@mortenbra
mortenbra / apache_ssl_conf
Last active August 29, 2015 14:22
Apache SSL configuration (protocols, ciphers)
# use the domain name or IP address
ServerName example.com:443
# point to the files created when generating the certificate
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key
# disable broken/weak protocols and ciphers
# see https://cipherli.st/ for an updated list
@mortenbra
mortenbra / apache_custom_conf
Last active April 27, 2023 10:47
Apache custom configuration for Apex, ORDS and Tomcat
# customized Apache configuration
# add this to the end of /etc/httpd/conf/httpd.conf
# or put it in a separate file such as /etc/httpd/conf.d/apex.conf
# disable sensitive version info
ServerSignature Off
ServerTokens Prod
# standard alias for Apex image files
Alias /i/ "/var/www/apex/images/"
@mortenbra
mortenbra / java_install_jdk.sh
Last active August 29, 2015 14:22
Install Oracle Java JDK on CentOS
# install Oracle Java JDK
# see http://stackoverflow.com/questions/20901442/how-to-install-jdk-in-centos
# remove OpenJDK
yum remove java*
# assume .rpm file is already copied to /u01/download
cd /u01/download
rpm -ivh jdk-7u79-linux-x64.rpm
@mortenbra
mortenbra / java_env.sh
Created June 10, 2015 05:09
Add Java environment variables to bash profile in CentOS
# setup Java environment in bash profile to be able to access java from anywhere
# http://stackoverflow.com/questions/16823591/how-to-add-lines-to-end-of-file-linux
# http://www.davidghedini.com/pg/entry/install_tomcat_7_on_centos
echo "JAVA_HOME=/usr/java/latest" >> /root/.bash_profile
echo "export JAVA_HOME" >> /root/.bash_profile
echo "PATH=$JAVA_HOME/bin:$PATH" >> /root/.bash_profile
echo "export PATH" >> /root/.bash_profile
@mortenbra
mortenbra / xe_post_install_optimize.sql
Last active August 29, 2015 14:22
Adjust session, process and memory parameters for Oracle XE after install
-- run as SYS
sqlplus /nolog
connect sys as sysdba
-- show current values
show parameters sessions;
show parameters processes;
show parameters memory;
-- adjust values
@mortenbra
mortenbra / tomcat_connector.xml
Last active August 29, 2015 14:22
Regular HTTP Connector for Tomcat server.xml file
<Connector port="8090" protocol="HTTP/1.1"
connectionTimeout="20000"
maxThreads="400"
compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript"
redirectPort="8443"
server="whateverFakeName"
URIEncoding="UTF-8" />
@mortenbra
mortenbra / tomcat_service_script
Last active June 27, 2019 07:36
Tomcat script to start, stop and restart service on CentOS (save this as "tomcat" under /etc/init.d/)
#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/latest
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/tomcat7/latest
@mortenbra
mortenbra / centos_hosts_file
Last active February 22, 2025 16:38
Sample /etc/hosts file for CentOS
# sample /etc/hosts file
# see http://unix.stackexchange.com/questions/13046/format-of-etc-hosts-on-linux-different-from-windows
# IPv4
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# IPv6
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# put your IP address and your hostname and aliases below
1.2.3.4 myserver.mydomain.example myserver
@mortenbra
mortenbra / oracle_sqlplus_env.sh
Created June 6, 2015 13:06
Add Oracle environment variables to bash profile in CentOS
# setup Oracle environment in bash profile to be able to access sqlplus from anywhere
# http://stackoverflow.com/questions/16823591/how-to-add-lines-to-end-of-file-linux
# this adds the Oracle environment variables to the "oracle" user, but you may also want to add it to root or any other users
echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >> /home/oracle/.bash_profile
@mortenbra
mortenbra / xe_install.sh
Last active August 29, 2015 14:22
Install Oracle XE on CentOS
# install Oracle XE 11g on CentOS
# assumes the installation file has already been copied to /u01/download
# create Oracle user and groups
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba,oinstall oracle
chown -R oracle:oinstall /u01