Linux common Software Installation 1. Course Objective 1.1. Proficiency in using Linux common commands 1.2. Proficient in modifying the basic Linux Configuration 1.3. Install JDK, Tomcat, and MySQL software 2 on Linux. Modifying the basic configuration of Linux
1. Modify Host Name
Vi/etc/sysconfig/network
Networking=yes hostname=server1.itcast.cn |
2. Modify the IP address
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 Type=ethernet Onboot=yes Bootproto=static Ipaddr=192.168.0.101 netmask=255.255.255.0 |
Service Network restart
3. Modify the mapping of IP addresses and host names
Vi/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 :: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.101 server1.itcast.cn |
4. Turn off the iptables and set its boot/no start
Service Iptables Stop
Chkconfig iptables on
Chkconfig iptables off
3. Installing the JDK
1. Upload jdk-7u45-linux-x64.tar.gz to Linux
2. Unzip the JDK to the/usr/local directory
TAR-ZXVF jdk-7u45-linux-x64.tar.gz-c/usr/local/
3. Set environment variables, append relevant content at the end of the/etc/profile file
Vi/etc/profile
Export java_home=/usr/local/jdk1.7.0_45 Export path= $PATH: $JAVA _home/bin |
4. Refresh Environment variables
Source/etc/profile
5. Test whether Java commands are available
Java-version
4. Install Tomcat
1. Upload apache-tomcat-7.0.68.tar.gz to Linux
2. Unzip Tomcat
TAR-ZXVF apache-tomcat-7.0.68.tar.gz-c/usr/local/
3. Start Tomcat
/usr/local/apache-tomcat-7.0.68/bin/startup.sh
4. See if the Tomcat process is started
JPs
5. View the Tomcat process port
NETSTAT-ANPT | grep 2465
6. Access Tomcat through a browser
http://192.168.0.101:8080/
5. Install MySQL
1. Upload mysql-server-5.5.48-1.linux2.6.x86_64.rpm, mysql-client-5.5.48-1.linux2.6.x86_64.rpm to Linux
2. Installing mysql-server-5.5.48-1.linux2.6.x86_64.rpm with the rpm command, missing Perl dependencies
RPM-IVH mysql-server-5.5.48-1.linux2.6.x86_64.rpm
The following error occurred:
Yum-y Remove Mysql-libs-5.1*
3. Install Perl dependencies and upload 6 perl-related RPM packages
RPM-IVH perl-*
4. Install the MYSQL-SERVER,RPM package conflict again
RPM-IVH mysql-server-5.5.48-1.linux2.6.x86_64.rpm
5. Uninstalling the conflicting RPM package
RPM-E mysql-libs-5.1.73-5.el6_6.x86_64--nodeps
6. Re-install mysql-client and Mysql-server
RPM-IVH mysql-client-5.5.48-1.linux2.6.x86_64.rpm
RPM-IVH mysql-server-5.5.48-1.linux2.6.x86_64.rpm
7. Start the MySQL service and initialize the MySQL
Service MySQL Start
/usr/bin/mysql_secure_installation
8. Test MySQL
Mysql-u root–p
View Port: NETSTAT–NLTP
Start Services: Service MySQL Strat
Login:
Linux Common Software Installation