centos deployment

1. Install jdk
1. Check whether the JDK that comes with Linux has installed

java –version  
If openjdk appears, it is best to uninstall openjdk first, and install sun's jdk.
2. Check the jdk information

rpm -qa|grep java  
3. To uninstall OpenJDK, do the following:

rpm -e --nodeps tzdata-java-2012c-1.el6.noarch  
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6. x86_64  
4. Create a new java installation directory

mkdir /usr/java  
5. Unzip the previously downloaded jdk and install

tar -zxvf jdk-7u71-linux-i586.tar.gz  
6. Add the java environment variable

vi /etc to the profile file /profile  
  
export JAVA_HOME=/usr/java/jdk1.7.0_71  
export CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar  
export PATH=$PATH:$JAVA_HOME/bin  
7. Make the file take effect immediately

source /etc/profile //or reboot  
8. Check whether the installation is successful

java -version  
2. Install Tomcat
1. Upload the downloaded tomcat.tar.gz to /var/local (the path can be chosen by yourself), and then decompress

tar -zxvf apache-tomcat-7.0.57.tar.gz  
2 .Move the uploaded tomcat to a directory and change the name to

mv apache-tomcat-7.0.57 /  
mv apache-tomcat-7.0.57 tomcat7  
3. Start tomcat

./startup.sh   After
startup, directly access the default address of tomcat
4. Unable to When accessing, close the firewall

service iptables stop  
5. Set
the first method to start automatically at boot: add tomcat and java_home environment variables under

/etc/rs.local vi /etc/rs.local  
  
JAVA_HOME=/usr/java/jdk1.7.0 _71  
export JAVA_HOME  
/tomcat7/bin/startup.sh  
Here is a bit to explain, rc.local is executed before /etc/profile, so it will not get JAVA environment variables, so add the code JAVA_HOME before startup.sh
3. Install oracle
official Installation Guide: https://docs.oracle.com/cd/E11882_01/install.112/e24323/toc.htm#i1011296
Reference article: http://blog.csdn.net/attagain/article/details/38331433
1. Hardware requirements (this is not the point, see the official website)
2. Software requirements
2.1 Check the dependency package

rpm -q binutils compat-libcap1 compat-libstdc++ -33-3.2.3 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat    

Remove these packages mentioned on the official website, and the following packages will be missing during installation:
unixODBC-2.2. 11
unixODBC-devel-2.2.11
elfutils-libelf-devel-0.97
pdksh-5.2.14
2.2 Use yum to install the required packages

yum -y install binutils compat-libcap1 compat-libstdc++-33-3.2.3 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat    
2.3 Install the library libXp
, which must be installed, otherwise a Java Exception will occur when installing Oracle.

yum -y install libXp  
3. Environment configuration
3.1 Turn off the firewall, disable SELinux

chkconfig iptables off  

# vi /etc/selinux/config  
SELINUX=disabled  
and reboot.
3.2 Modify the machine name (usually the same by default)
. The hostname in /etc/sysconfig/network should be the same as that in /etc/hosts. If it is consistent, there is no need to modify it.
3.3 Establish users and groups
The user names and groups established here are installed in Oracle time will help you choose. Otherwise there are no users and groups when installed.
Create a group oinstall 

groupadd oinstall   Create   a
group dba

groupadd dba   Add  
a user oracle and add it to the oinstall and dba

groups   Oracle installation folder and data storage folder mkdir -p /opt/oracle/   mkdir -p /opt/oracle/oraInventory   chown -R oracle:oinstall /opt/oracle   chmod -R 775 /opt/oracle  












3.5 Configure system kernel parameters

vi /etc/sysctl.conf  
Add the following parameters:

fs.aio-max-nr = 1048576  
fs.file-max = 6815744  
kernel.shmmni = 4096  
kernel.sem = 250 32000 100 128  
net.ipv4.ip_local_port_range = 9000 65500  
net.core.rmem_default = 262144  
net.core.rmem_max =  
4194304 net.core.wmem_default = 262144  
net.core.wmem_max = 1048576  
Enable the changes just made

# sysctl -p   3.6 Modify
the number of processes and maximum sessionsEdit
/etc/security/limits.conf

vi /etc/security/limits.conf  
  
oracle soft nproc 2047  
oracle hard nproc 16384  
oracle soft nofile 1024  
oracle hard nofile 65536  
3.7 To set the association information, execute the following command to modify the association file /etc/pam.d/login

vi /etc/pam.d/login   and
add:

session required /lib/security/pam_limits.so  
session required pam_limits.so  
3.8 Modify system startup Environment parameters, execute the following command to modify the system startup environment parameter file

vi /etc/ profile  
and add it after pathmunge:

if [ $USER = "oracle" ]; then  
    if [ $SHELL = "/bin/ksh" ]; then  
        ulimit - p 16384  
        ulimit -n 65536  
    else  
        ulimit -u 16384 -n 65536  
    fi  
fi  
3.9 Switch users, configure the oracle user environment variable

vi .bash_profile  
ORACLE_BASE=/opt/oracle  
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1/bin/ ( Different versions of oracle installation directory may be different, here is 11.2.0)  
ORACLE_SID=SIMS (database instance, defined by yourself)  
LD_LIBRARY_PATH=$ORACLE_HOME/lib  
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin  
   
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH  
//The official website recommends not to set the installation folder, namely $ORACLE_HOME, but I suggest to build it here, because it is not established If it is good, the following commands such as dbca and netca cannot be found

to make the settings take effect .

Source /home/oracle/.bash_profile  
3.10 Installation
Put the downloaded oracle file under /opt/oracle

su - oracle  
$ cd /opt/oracle  
$ unzip linux.11gR2_database_1of2.zip  
$ unzip linux.11gR2_database_2of2.zip  
3.11 Solve Chinese garbled characters before installation
echo $LANG If it is not in English, temporarily set the following

export LANG=en_US  
3.12 Switch to GUI installation
If it is remote, you need to install remote software, Otherwise, you cannot enter the graphical installation interface;
if you operate directly on the server, you don't need it, so when installing centos, you need to select the desktop installation

cd /opt/oracle/databse  
$ ./runInstaller  
For the installation process of the graphical interface, please refer to: http://www.21ops.com/linux/7296.html/comment-page-1

Note: the
first step of the mailbox can not be written; the installation method I choose single database installation, only After the software body is installed, the database and monitoring are not established, so after installation, it is necessary to create a database and configure monitoring.
I need to pay attention here. I see a lot of information on the Internet that first create the database and then configure the monitoring. I don’t know how this is done, but when I actually operate, it
is impossible to create a database first. It must be Configure monitoring first!
4 After the installation is completed, the oracle user logs in.
4.1 Configure monitoring:

netca   
step by step
4.2 Create database:

dbca  
pay attention to the character set and remember to choose Chinese
(if ORACLE_HOME is not specified, these commands cannot be used, so you can look at it first Your current ORACLE_HOME, i.e. echo $ORACLE_HOME)
4.3 Test whether the installation is successful
Check the monitoring status:

lsnrctl status  
Database connection:

sqlplus / as sysdba  
conn system/123456@SIMS (Here I changed all user passwords to 123456)  

At this point, the Oracle 11 g database under CentOS6 has been successfully installed.
4. Start ORACLE on CentOS6
1. Manually start the database
and log in with the Oracle user

$lsnrctl start  
$sqlplus / as sysdba  
sql>startup  
Then you can operate the database
2. Automatically start the database
2.1 Root user login
to modify oratab

#vi /etc/oratab  
SIMS:/opt/oracle/product/11.2.0/dbhome_1:Y (N changed to Y)  
Esc:wq!  
Save 
2.2 Modify dbstart,dbshut

#vi /opt/oracle/11.2.0/bin/dbstart  
ORACLE_HOME_LISTNER=$ORACLE_HOME(originally $1)  
Esc:wq!  

#vi /opt/oracle/ 11.2.0/bin/dbshut  
ORACLE_HOME_LISTNER=$ORACLE_HOME (originally $1)  
Esc:wq!  
2.3 Add content to rc.local

#vi /etc/rc.d/rc.local  
Add the following content to the file

su oracle - lc "/opt/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"  
su oracle -lc "/opt/oracle/product/11.2.0/dbhome_1/bin/dbstart"  
  
Esc:wq!  

You're done!
5. Other
linux update sources
https://lug.ustc.edu.cn/wiki/mirrors/help/centos
1. Enter the yum source configuration directory as
root su root
cd /etc/yum.repos.d/
2. Backup The yum source that comes with the system
mv CentOS-Base.repo CentOS-Base.repo.bak
3. Download the corresponding version of the HKUST yum source, put it in /etc/yum.repos.d/
or wget http://centos .ustc.edu.cn/Centos-Base.repo (but this method is not easy to determine the source version)
4. After updating the source, generate a cache to make the operation take effect immediately
yum makecache
5. Start updating
yum update and
install Chinese input Method
1. Install
su root
yum install "@Chinese Support" as root
2. Add the newly installed input method to the input method list and
click system-->preferences-->Input Method. Then click "Enable input method feature", check "Enable input method feature", and select "Use IBus(recommended)", click "Preferred input method"
Click "Input Method Preferences", click the input method tab, select Chinese, select Pinyin in the list (of course, you can choose other input methods), click "add", add the selected input method to the input Method list
3.reboot
finished! Have fun!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326345929&siteId=291194637