Archive for the ‘CentOS5’ Category

XRDP on CentOS 5

$ yum install gcc pam-devel openssl-devel
$ tar -zxvf xrdp-0.4.1.tar.gz
$ cd xrdp-0.4.1
$ make
$ sudo make install
$ ln /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdesktop
$ gconftool-2 –type list –list-type=string –set /desktop/gnome/peripherals/keyboard/kbd/layouts [damnlayouts] # map keyboard layout
$ sudo nano /etc/xrdp/sesman.ini
change 127.0.0.1 to 0.0.0.0
$ /sbin/chkconfig –add xrdesktop
$ /sbin/service xrdesktop start

$ yum install gcc pam-devel openssl-devel

$ wget http://ncu.dl.sourceforge.net/sourceforge/xrdp/xrdp-0.4.1.tar.gz

$ tar -zxvf xrdp-0.4.1.tar.gz

$ cd xrdp-0.4.1

$ make

$ sudo make install

$ ln /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdesktop

$ gconftool-2 –type list –list-type=string –set /desktop/gnome/peripherals/keyboard/kbd/layouts [damnlayouts] # map keyboard layout

$ sudo nano /etc/xrdp/sesman.ini

change 127.0.0.1 to 0.0.0.0

$ /sbin/chkconfig –add xrdesktop

$ /sbin/service xrdesktop start

[optional]
$ cp startwm.sh startwm.sh.bak
$ nano /usr/local/xrdp/startwm.sh // change login env
export LANG=zh_TW.UTF-8

Install proftpd on CentOS5

$ nano /etc/yum.repos.d/dag.repo  // create dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
$ rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt // import non-official GPG
$ yum install proftpd
$ nano /etc/proftpd.conf
Change ServerName
change DefaultRoot ~
$ nano /etc/xinetd.d/xproftpd
Change “DURATION USERID” to “HOST PID”
Change “USERID” to “HOST”
Change “disable = yes” to  ”disable = no”
$ /sbin/chkconfig xproftpd on
$ /sbin/chkconfig –list xproftpd
$ /etc/rc.d/init.d/xinetd restart

Source:

$ nano /etc/yum.repos.d/dag.repo // create dag.repo

[dag]

name=Dag RPM Repository for Red Hat Enterprise Linux

baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

gpgcheck=1

enabled=1

$ rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt // import non-official GPG

$ yum install proftpd

$ nano /etc/proftpd.conf

Change ServerName

Change ServerType to inetd

change DefaultRoot ~

$ nano /etc/xinetd.d/xproftpd

Change “DURATION USERID” to “HOST PID”

Change “USERID” to “HOST”

Change “disable = yes” to  ”disable = no”

$ /sbin/chkconfig xproftpd on

$ /sbin/chkconfig –list xproftpd

$ /etc/rc.d/init.d/xinetd restart

Install oracle 11g x64 on CentOS5.3

1. Check packages
$ rpm -q grep binutils-2.*    \
elfutils-libelf-0.*        \
glibc-2.*                  \
glibc-common-2.*           \
libaio-0.*                 \
libgcc-4.*                 \
libstdc++-4.*              \
make-3.*                   \
compat-libstdc++-33        \
elfutils-libelf-devel-0.*  \
glibc-devel-2.*            \
gcc-4.*                    \
gcc-c++-4.*                \
libaio-devel-0.*           \
libstdc++-devel-4.*        \
unixODBC-2.*               \
unixODBC-devel-2.*         \
sysstat-7.*
2. Create Oracle account
$ /usr/sbin/groupadd oinstall
$ /usr/sbin/groupadd dba
$ /usr/sbin/useradd -m -g oinstall -G dba oracle
$ id oracle
(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))
$ passwd oracle
3. Modified the sysctl.conf
$ cat >> /etc/sysctl.conf << EOF
kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
EOF
3.a Check parameters
$ /sbin/sysctl -p
4. Modified the limits.conf (Shell limits for oracle user)
$ cat >> /etc/security/limits.conf << EOF
*     soft      nproc          2047
*     hard      nproc         16384
*     soft      nofile         1024
*     hard      nofile        65536
EOF
5. Modified the login
# cat >> /etc/pam.d/login << EOF
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
EOF
6. Modified the config
$ nano /etc/selinux/config
(Leave the following two lines only)
SELINUX=disabled
SELINUXTYPE=disabled
7. Create Directories
mkdir -p /u01
mkdir -p /opt/oracle
mkdir –p /opt/oracle/product
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /u01
chmod -R 775 /opt/oracle
chmod -R 775 /opt/oracle/product
8. For network configuration requirements (important!)
modified /etc/hosts to actual ip address
9. Change ownership to oracle
$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip
10. Log in as oracle (GUI)
$ cd /opt/oracle
$ unzip linux.x64_11gR1_database_1013.zip
$ cd database
$ ./runInstaller
=====In the first screen========
a. /opt/oracle/ (ORACLE BASE LOCATIONS)
b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)
c. Change the UNIX DBA group from dba to oinstall
d. Create Starter Database
====In the second screen====
a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)
b. leave the group name oinstall
===In the complete screen===
Do not forget to execute two scripts
Note: connect from osx
./sqlplus sys/password@oracle as SYSDBA
Maintenance
To shut down everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> exit
$ lsnrctl
LSNRCTL> stop
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
./emctl stop dbconsole
To start up everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> startup
SQL> exit
$ lsnrctl
LSNRCTL> start
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
1. Check packages
$ rpm -q grep binutils-2.*    \
elfutils-libelf-0.*        \
glibc-2.*                  \
glibc-common-2.*           \
libaio-0.*                 \
libgcc-4.*                 \
libstdc++-4.*              \
make-3.*                   \
compat-libstdc++-33        \
elfutils-libelf-devel-0.*  \
glibc-devel-2.*            \
gcc-4.*                    \
gcc-c++-4.*                \
libaio-devel-0.*           \
libstdc++-devel-4.*        \
unixODBC-2.*               \
unixODBC-devel-2.*         \
sysstat-7.*
2. Create Oracle account
$ /usr/sbin/groupadd oinstall
$ /usr/sbin/groupadd dba
$ /usr/sbin/useradd -m -g oinstall -G dba oracle
$ id oracle
(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))
$ passwd oracle
3. Modified the sysctl.conf
$ cat >> /etc/sysctl.conf << EOF
kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
EOF
3.a Check parameters
$ /sbin/sysctl -p
4. Modified the limits.conf (Shell limits for oracle user)
$ cat >> /etc/security/limits.conf << EOF
*     soft      nproc          2047
*     hard      nproc         16384
*     soft      nofile         1024
*     hard      nofile        65536
EOF
5. Modified the login
# cat >> /etc/pam.d/login << EOF
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
EOF
6. Modified the config
$ nano /etc/selinux/config
(Leave the following two lines only)
SELINUX=disabled
SELINUXTYPE=disabled
7. Create Directories
mkdir -p /u01
mkdir -p /opt/oracle
mkdir –p /opt/oracle/product
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /u01
chmod -R 775 /opt/oracle
chmod -R 775 /opt/oracle/product
8. For network configuration requirements (important!)
modified /etc/hosts to actual ip address
9. Change ownership to oracle
$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip
10. Log in as oracle (GUI)
$ cd /opt/oracle
$ unzip linux.x64_11gR1_database_1013.zip
$ cd database
$ ./runInstaller
=====In the first screen========
a. /opt/oracle/ (ORACLE BASE LOCATIONS)
b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)
c. Change the UNIX DBA group from dba to oinstall
d. Create Starter Database
====In the second screen====
a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)
b. leave the group name oinstall
===In the complete screen===
Do not forget to execute two scripts
Note: connect from osx
./sqlplus sys/password@oracle as SYSDBA
Maintenance
To shut down everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> exit
$ lsnrctl
LSNRCTL> stop
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
./emctl stop dbconsole
To start up everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> startup
SQL> exit
$ lsnrctl
LSNRCTL> start
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
1. Check packages
$ rpm -q grep binutils-2.*    \
elfutils-libelf-0.*        \
glibc-2.*                  \
glibc-common-2.*           \
libaio-0.*                 \
libgcc-4.*                 \
libstdc++-4.*              \
make-3.*                   \
compat-libstdc++-33        \
elfutils-libelf-devel-0.*  \
glibc-devel-2.*            \
gcc-4.*                    \
gcc-c++-4.*                \
libaio-devel-0.*           \
libstdc++-devel-4.*        \
unixODBC-2.*               \
unixODBC-devel-2.*         \
sysstat-7.*
2. Create Oracle account
$ /usr/sbin/groupadd oinstall
$ /usr/sbin/groupadd dba
$ /usr/sbin/useradd -m -g oinstall -G dba oracle
$ id oracle
(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))
$ passwd oracle
3. Modified the sysctl.conf
$ cat >> /etc/sysctl.conf << EOF
kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
EOF
3.a Check parameters
$ /sbin/sysctl -p
4. Modified the limits.conf (Shell limits for oracle user)
$ cat >> /etc/security/limits.conf << EOF
*     soft      nproc          2047
*     hard      nproc         16384
*     soft      nofile         1024
*     hard      nofile        65536
EOF
5. Modified the login
# cat >> /etc/pam.d/login << EOF
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
EOF
6. Modified the config
$ nano /etc/selinux/config
(Leave the following two lines only)
SELINUX=disabled
SELINUXTYPE=disabled
7. Create Directories
mkdir -p /u01
mkdir -p /opt/oracle
mkdir –p /opt/oracle/product
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /u01
chmod -R 775 /opt/oracle
chmod -R 775 /opt/oracle/product
8. For network configuration requirements (important!)
modified /etc/hosts to actual ip address
9. Change ownership to oracle
$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip
10. Log in as oracle (GUI)
$ cd /opt/oracle
$ unzip linux.x64_11gR1_database_1013.zip
$ cd database
$ ./runInstaller
=====In the first screen========
a. /opt/oracle/ (ORACLE BASE LOCATIONS)
b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)
c. Change the UNIX DBA group from dba to oinstall
d. Create Starter Database
====In the second screen====
a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)
b. leave the group name oinstall
===In the complete screen===
Do not forget to execute two scripts
Note: connect from osx
./sqlplus sys/password@oracle as SYSDBA
Maintenance
To shut down everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> exit
$ lsnrctl
LSNRCTL> stop
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
./emctl stop dbconsole
To start up everything Oracle:
$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> startup
SQL> exit
$ lsnrctl
LSNRCTL> start
LSNRCTL> exit
$ cd $ORACLE_HOME/bin
./emctl start dbconsole

1. Check packages

$ rpm -q grep binutils-2.*    \
elfutils-libelf-0.*        \
glibc-2.*                  \
glibc-common-2.*           \
libaio-0.*                 \
libgcc-4.*                 \
libstdc++-4.*              \
make-3.*                   \
compat-libstdc++-33        \
elfutils-libelf-devel-0.*  \
glibc-devel-2.*            \
gcc-4.*                    \
gcc-c++-4.*                \
libaio-devel-0.*           \
libstdc++-devel-4.*        \
unixODBC-2.*               \
unixODBC-devel-2.*         \
sysstat-7.*

2. Create Oracle account

$ /usr/sbin/groupadd oinstall
$ /usr/sbin/groupadd dba
$ /usr/sbin/useradd -m -g oinstall -G dba oracle
$ id oracle
(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))
$ passwd oracle

3. Modified the sysctl.conf

$ cat >> /etc/sysctl.conf << EOF
kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
EOF

3.a Check parameters

$ /sbin/sysctl -p

4. Modified the limits.conf (Shell limits for oracle user)

$ cat >> /etc/security/limits.conf << EOF
*     soft      nproc          2047
*     hard      nproc         16384
*     soft      nofile         1024
*     hard      nofile        65536
EOF

5. Modified the login

# cat >> /etc/pam.d/login << EOF
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
EOF
6. Modified the config
$ nano /etc/selinux/config
(Leave the following two lines only)
SELINUX=disabled
SELINUXTYPE=disabled

7. Create Directories

$ mkdir -p /u01
$ mkdir -p /opt/oracle
$ mkdir –p /opt/oracle/product
$ chown -R oracle:oinstall /u01
$ chown -R oracle:oinstall /opt/oracle
$ chmod -R 775 /u01
$ chmod -R 775 /opt/oracle
$ chmod -R 775 /opt/oracle/product

8. For network configuration requirements (important!)

modified /etc/hosts to actual ip address

9. Change ownership to oracle

$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip

10. Log in as oracle (GUI)

$ cd /opt/oracle
$ unzip linux.x64_11gR1_database_1013.zip
$ cd database
$ ./runInstaller
=====In the first screen========
a. /opt/oracle/ (ORACLE BASE LOCATIONS)
b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)
c. Change the UNIX DBA group from dba to oinstall
d. Create Starter Database
====In the second screen====
a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)
b. leave the group name oinstall
===In the complete screen===
Do not forget to execute two scripts

Note: connect from osx (download client software)

./sqlplus sys/password@oracle as SYSDBA

Maintenance

To shut down everything Oracle:

$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> exit
$ lsnrctl
LSNRCTL> stop
LSNRCTL> exit
$ cd $ORACLE_HOME/bin (optional)
./emctl stop dbconsole

To start up everything Oracle:

$ . oraenv
<enter your SID>
$ sqlplus “/ as sysdba”
SQL> startup
SQL> exit
$ lsnrctl
LSNRCTL> start
LSNRCTL> exit
$ cd $ORACLE_HOME/bin (optional)
./emctl start dbconsole