搜索

一、安装JDK

查看默认JDK

java -version

rpm -qa|grep java

使用yum remove 卸载默认JDK

yum remove 包名

yum remove java-1.8.0-openjdk-headless-1.8.0.262.b10-0.el7_8.x86_64

创建目录

mkdir usr/java

Oracle官网下载JDK并上传至服务器/usr/java目录下

解压

tar -xzvf jdk-8u261-linux-x64.tar.gz

配置环境变量

vim /etc/profile

在末尾添加

#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_261
#PATH
export PATH=$PATH:$JAVA_HOME/bin
`</pre>

使配置生效

`source /etc/profile`

验证是否成功

`java -version`

`javac -version`

出现对应的版本号则成功

#### 二、安装Tomcat

创建目录

`mkdir /usr/tomcat`

下载并解压tomcat

`cd usr/tomcat`

`wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz`

`tar -xzvf apache-tomcat-9.0.37.tar.gz`

进入tomcat目录

`cd apache-tomcat-9.0.37/bin`

给予所有脚本权限

`chmod 777 *.sh`

启动tomcat

`./startup.sh`

最后一行出现”Tomcat started.“则成功,服务器开放8080端口后在浏览器地址栏输入IP:8080即可看到tomcat页面

使tomcat开机自启,编辑如下文件

`vim /etc/rc.d/rc.local`

添加内容为

<pre>`touch /var/lock/subsys/local
export JAVA_HOME=/usr/java/jdk1.8.0_261
export PATH=$PATH:$JAVA_HOME/bin
export CATALINA_HOME=/usr/tomcat/apache-tomcat-9.0.37
/usr/tomcat/apache-tomcat-9.0.37/bin/startup.sh
`</pre>

赋予执行权限

`chmod +x /etc/rc.d/rc.local`

重启服务器后等待一段时间,在浏览器输入服务器公网IP:8080查看tomcat是否启动

#### 三、安装MySQL

下载并应用mysql的yum资源包

<pre>`cd ~
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
yum install mysql-server

改变文件属主和属组

chown mysql:mysql -R /var/lib/mysql

初始化并启动mysql

mysqld --initialize

service mysqld start

修改mysql管理员密码并登陆mysql

mysqladmin -u root password "your-password"

mysql -u root -p

输入密码登陆,出现“mysql>”则登陆成功

参考文章:

搭建 Java Web 开发环境

Linux搭建JAVAWEB环境

linux/centos开机自启(linux tomcat开机自启/nginx开机自启)

阿里云 服务器 ECS 笔记 实践训练营 MySQL java javaweb tomcat

版权属于:Aersbox
作品采用:本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
1
查看目录

目录

来自 《ECS 7天实践训练营(五)-搭建Java Web环境》
评论

  1. 评论头像
    2021-06-25 回复

    FB friends spy is a facebook windows application that offers to its user’s information about their friends they cannot find in there profiles:

    Online presence information (offline/online) even if you are in offline chat mode.People most interested by them.People most interacting with them(on comments not messages , spying on messages is illegal and forbidden by facebook, so it is impossible to do, thank you for your understanding).latest Facebook statusesPlaces visited.Events attending or already participated in
    FB friend's spy will ask you for permissions to offer you the information you want, this information will and still be used only by you, it will not be used by anyone else.

    FB friend’s spy uses Facebook SDK to connect to Facebook, so users don’t have to worry about their private or secret information.

世界上只有一种真正的英雄主义,那就是在认清生活真相之后依然热爱生活。