查看是否有tomcat包
yum list | grep tomcat
1.关闭防火墙
systemctl stop firewalld
2.设置开机自启
systemctl enable firewalld
3.设置手动启动
systemctl disable firewalld
4.查看防火墙状态
systemctl status firewalld
5.复制链接地址并下载
wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.91/bin/apache-tomcat-9.0.91.tar.gz.asc
6. 15 cd /opt
16 tar -zxvf apache-tomcat-9.0.91.tar.gz
17 ls
18 mv apache-tomcat-9.0.91/ /usr/local/tomcat9/
19 ls
20 ls /usr/local/
21 ls /usr/local/tomcat9
22 ls /usr/local/tomcat9/bin/
启动服务
可执行脚本 /usr/local/tomcat9/bin/startup.sh
7.关闭防火墙
systemctl stop firewalld
8.创建web目录
[root@localhost opt]# ls /usr/local/tomcat9/webapps/
docs examples host-manager manager ROOT
在webapps目录下创建一个目录abc
[root@localhost opt]# mkdir /usr/local/tomcat9/webapps/abc/
使用vim创建并修改test.txt文件
[root@localhost opt]# vim /usr/local/tomcat9/webapps/abc/test.txt
目前在abc目录中有一个test.txt
ls /usr/local/tomcat9/webapps/abc/
为什么会出现中文乱码
tomcat默认字符集是iso-8859-1
要显示中文,gbk, utf-8
tree /usr/local/tomcat9/webapps/abc/
停用tomcat服务
/usr/local/tomcat9/bin/shutdown.sh
安装配置jdk
1.下载jdk
2.解压
tar -zxvf openjdk-17.0.1_linux-x64_bin.tar.gz
3.解压后的文件夹移动到/usr/local 并改名
mv jdk-17.0.1/ /usr/local/jdk17/
4.找到可执行文件
cd /usr/local/jdk17/
5.在profile中配置jdk环境变量
vim /etc/profile
6.将Java的可执行文件添加到$PATH环境变量中
配置JAVA_HOME=/usr/local/jdk17/
export JAVA_HOME=/usr/local/jdk17/
7.运行
source /etc/profile
java
python环境
1.pythonweb
2.人工智能环境
3.数据分析
python2
with open("a.txt","wb")as f:
f.write("writer")
import os
os.listdir("./")