CentOS System Installation
Installation under the virtual machine, it is necessary to note that it is best to set the network environment of the system to be bridged, to allow communication between the host and the virtual machine, if you need to install the desktop during the installation of the CentOS process, select the Gnome image desktop installation during the installation process.
Basic CentOS System Configuration
CentOS version may need to add user to sudoers, otherwise the sudo command cannot be applied
1. Su root//First cut to root
2. chmod U+w/etc/sudoers//u represents the owner, W means write permission + means add
3. Vi/etc/sudoers
Find this line in the file:
# allow ROOT to run any commands anywhere
Root all= (All) all
Username all= (All) all//Add this line, username for the user to join Sudoers
4. Finally remember to revoke the file's Write permission: chmod u-w/etc/sudoers
Finally, to take effect, remember to restart! Remember to restart! Remember to restart! Important thing to say three times
JDK Installation (Linux)
- Installing the system environment
CentOS 64bit
jdk1.8 64bit
1. Clean the system by default with JDK
If you install CentOS by default, such as OPENJDK, please do Rpm-qa | grep JDK View the JDK that has been brought in, then uninstall, uninstall the command: sudo yum remove xxx (XXX for the results of the previous command)
2. Grant permission: sudo chmod 777 jdk-xxx-linux-x64.rpm
Note: First modify the permissions, because do not know you download the account and use of the account, so first with 777 users, user groups and other people these three groups are given read and write permission to execute
3. Installation
sudo rpm-ivh jdk-xxx-linux-x64.rpm
4. Default installation path/usr/java
Example:/usr/java/jdk1.7.0_80
5.JDK Configuring environment variables
(1) sudo vim/etc/profile
(2) at the bottom of the add
Export java_home=/usr/java/jdk1.7.0_80
Export classpath=.: $JAVA _home/jre/lib.rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
(3) Adding a path in export path
Export path= $JAVA _home/bin: $PATH
(4) Vim command ": Wq" Save exit
(5) Make the environment variable configuration effective Source/etc/profile
6.JDK Verification
Java-version if the JDK version information appears, the installation succeeds
Tomcat installation Configuration
- Installing the system environment
CentOS 64bit
Tomcat 8 (try to match the JDK version)
Note: The JDK needs to be installed before installing Tomcat.
- Download official website Download apache-tomcat-8.xxx.tar.gz
- Decompression: TAR-ZXVF apache-tomcat-8.xxx.tar.gz
- To configure environment variables:
(1) sudo vim/etc/profile
(2) Add at the bottom
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Vim command mode ": Wq" Save exit
- Configuring the UTF-8 Character Set
(1) Enter the Conf folder under the Tomcat installation directory and edit the Server.xml such as: {Catalina_home}/conf/server.xml
(2) Add at the bottom
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Vim command mode ": Wq" Save exit
- Tomcat authentication
(1) Enter the Tomcat directory after the system decompression
(2) Enter bin directory
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Execute./startup.sh (Linux), execute startup.bat under Windows
See the proof open for success
6. Open the CentOS port for external access
You need to open port 8080 via iptables (firewall) so that the outside world can access the virtual machine's Tomcat
Modify Firewall Profile: Vi/etc/sysconfig/iptables
Note: Add above or below Port 22, do not put in the last, otherwise it does not work.
sudo service iptables stop shutdown Services
sudo service iptables Start services
sudo service iptables restart Restart services
---restore content ends---
CentOS System Installation
Installation under the virtual machine, it is necessary to note that it is best to set the network environment of the system to be bridged, to allow communication between the host and the virtual machine, if you need to install the desktop during the installation of the CentOS process, select the Gnome image desktop installation during the installation process.
Basic CentOS System Configuration
CentOS version may need to add user to sudoers, otherwise the sudo command cannot be applied
1. Su root//First cut to root
2. chmod U+w/etc/sudoers//u represents the owner, W means write permission + means add
3. Vi/etc/sudoers
Find this line in the file:
# allow ROOT to run any commands anywhere
Root all= (All) all
Username all= (All) all//Add this line, username for the user to join Sudoers
4. Finally remember to revoke the file's Write permission: chmod u-w/etc/sudoers
Finally, to take effect, remember to restart! Remember to restart! Remember to restart! Important thing to say three times
JDK Installation (Linux)
- Installing the system environment
CentOS 64bit
jdk1.8 64bit
1. Clean the system by default with JDK
If you install CentOS by default, such as OPENJDK, please do Rpm-qa | grep JDK View the JDK that has been brought in, then uninstall, uninstall the command: sudo yum remove xxx (XXX for the results of the previous command)
2. Grant permission: sudo chmod 777 jdk-xxx-linux-x64.rpm
Note: First modify the permissions, because do not know you download the account and use of the account, so first with 777 users, user groups and other people these three groups are given read and write permission to execute
3. Installation
sudo rpm-ivh jdk-xxx-linux-x64.rpm
4. Default installation path/usr/java
Example:/usr/java/jdk1.7.0_80
5.JDK Configuring environment variables
(1) sudo vim/etc/profile
(2) at the bottom of the add
Export java_home=/usr/java/jdk1.7.0_80
Export classpath=.: $JAVA _home/jre/lib.rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
(3) Adding a path in export path
Export path= $JAVA _home/bin: $PATH
(4) Vim command ": Wq" Save exit
(5) Make the environment variable configuration effective Source/etc/profile
6.JDK Verification
Java-version if the JDK version information appears, the installation succeeds
Tomcat installation Configuration
- Installing the system environment
CentOS 64bit
Tomcat 8 (try to match the JDK version)
Note: The JDK needs to be installed before installing Tomcat.
- Download official website Download apache-tomcat-8.xxx.tar.gz
- Decompression: TAR-ZXVF apache-tomcat-8.xxx.tar.gz
- To configure environment variables:
(1) sudo vim/etc/profile
(2) Add at the bottom
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Vim command mode ": Wq" Save exit
- Configuring the UTF-8 Character Set
(1) Enter the Conf folder under the Tomcat installation directory and edit the Server.xml such as: {Catalina_home}/conf/server.xml
(2) Add at the bottom
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Vim command mode ": Wq" Save exit
- Tomcat authentication
(1) Enter the Tomcat directory after the system decompression
(2) Enter bin directory
Export Catalina_home=/developer/apache-tomcat-8.xxx
Note: Catalina_home is the directory after the Tomcat is extracted
(3) Execute./startup.sh (Linux), execute startup.bat under Windows
See the proof open for success
6. Open the CentOS port for external access
You need to open port 8080 via iptables (firewall) so that the outside world can access the virtual machine's Tomcat
Modify Firewall Profile: Vi/etc/sysconfig/iptables
Note: Add above or below Port 22, do not put in the last, otherwise it does not work.
sudo service iptables stop shutdown Services
sudo service iptables Start services
sudo service iptables restart Restart services
Java WEB-related environment installation