First, installation environment
Operating system
Windows7 Enterprise 64-bit
The software that needs to be used
jdk:jdk-8u60-linux-x64.rpm
Glassfish:glassfish4.1.1.zip
Second, installation Preparation
Step1: Copy the JDK files on the host to the virtual machine.
Check that the virtual machine is open for FTP service first
Open the command line and enter the following command
Switch to root super user first
Su root (enter password)
Su-
Rpm–qa|grep vsftpd
If not installed, use the command to install
Yum–y Install VSFTPD
Installing the XFTP software under Windows
Create a new connection after running
Virtual machine IP Viewing mode: command: ifconfig
Use Xftp to put the downloaded JDK into the USR directory.
Another way: Drag files under Windows directly onto the desktop under CentOS. The files are then moved or copied to other folders via the MV command or the CP command.
Third, install the JDK
To enter the virtual machine, run the command line:
Switch to Super User first
Switch to usr folder
Cd/usr
LS (view file)
Run the Setup program
Mkdir/usr/java
chmod +x jdk-8u60-linux-x64.rpm (Tab key can be used)
RPM–IVH jdk-8u60-linux-x64.rpm
As shown
Configuring the Operating Environment
Vi/etc/profile
#java环境变量
java_home=/usr/java/jdk1.8.60 (Enter the path of your own installation)
Export JRE_HOME=/USR/JAVA/JDK1.8.60/JRE
Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
The two ways to add environment variables are
The final ticket is installed successfully
Command line Run Java–version
Displays the version information, indicating that the installation was successful.
Iv. installation of GlassFish
Step1: Use xftp to copy downloaded files to the USR directory under CentOS
Run the command line
Unzip-q Glassfish-4.1.1.zip
Mkdir/usr/glassfish
MV Glassfish4/usr/glassfish
Start
Cd/usr/glassfish/glassfish4/glassfish/bin
./startserv
8080 ports:
Console: 4848 ports
Remote access requires firewall configuration
To view the firewall configuration:
Service Iptables Status
[Email protected] ~]vi/etc/sysconfig/iptables
Add the following rule configuration
-A input-m state--state new-m tcp-p TCP--dport 4848-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 8181-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 3700-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 7676-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
Save and exit and restart the firewall.
[Email protected] ~]service iptables restart
Log in to another computer on the LAN
/HTTP Server ip:4848
#设置管理员账号和口令
Cd/usr/glassfish/glassfish4/glassfish/bin
SH asadmin change-admin-password #开启远程管理
SH asadmin enable-secure-admin
To turn on remote access:
SH asadmin enable-secure-admin
Restart Service
After this, enter the command:
./startserv
Remote Connection Console (4848 port), using username (Admin) and password (admin):
Remote connection 8080 Port:
Install JDK1.8.60 and glassfish4.1.1 original under CentOS