/usr/local
在官网下载最新版
http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.31/bin/apache-tomcat-9.0.31.tar.gz
[root@*** local]# pwd
/usr/local
[root@*** local]# wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.30/bin/apache-tomcat-9.0.30.tar.gz
--2020-02-20 17:24:44-- http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.30/bin/apache-tomcat-9.0.30.tar.gz
Resolving mirror.bit.edu.cn... 202.204.80.77, 219.143.204.117, 2001:da8:204:1205::22
Connecting to mirror.bit.edu.cn|202.204.80.77|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-02-20 17:24:46 ERROR 404: Not Found.
[root@*** local]# wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.31/bin/apache-tomcat-9.0.31.tar.gz
--2020-02-20 17:27:28-- http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.31/bin/apache-tomcat-9.0.31.tar.gz
Resolving mirror.bit.edu.cn... 202.204.80.77, 219.143.204.117, 2001:da8:204:1205::22
Connecting to mirror.bit.edu.cn|202.204.80.77|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11042076 (11M) [application/octet-stream]
Saving to: “apache-tomcat-9.0.31.tar.gz”
100%[==================================================>] 11,042,076 1.57M/s in 6.6s
2020-02-20 17:27:34 (1.60 MB/s) - “apache-tomcat-9.0.31.tar.gz” saved [11042076/11042076]
[root@*** local]# ls
aegis bin include libexec nginx redis src
apache-tomcat-9.0.31.tar.gz etc lib memcached openssl sbin tomcat
apr games lib64 mysql pureftpd share
[root@*** local]# tar -zxf apache-tomcat-9.0.31.tar.gz
[root@*** local]# ls
aegis apr games lib64 mysql pureftpd share
apache-tomcat-9.0.31 bin include libexec nginx redis src
apache-tomcat-9.0.31.tar.gz etc lib memcached openssl sbin tomcat
[root@*** local]#
[root@*** local]# cd apache-tomcat-9.0.31
发布到webapps
下面.(2020-2-20 17:31:41)
[root@*** apache-tomcat-9.0.31]# cd bin
[root@*** bin]# ls
bootstrap.jar commons-daemon-native.tar.gz makebase.sh tomcat-juli.jar
catalina.bat configtest.bat setclasspath.bat tomcat-native.tar.gz
catalina.sh configtest.sh setclasspath.sh tool-wrapper.bat
catalina-tasks.xml daemon.sh shutdown.bat tool-wrapper.sh
ciphers.bat digest.bat shutdown.sh version.bat
ciphers.sh digest.sh startup.bat version.sh
commons-daemon.jar makebase.bat startup.sh
[root@*** bin]# sh startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.31
Using CATALINA_HOME: /usr/local/apache-tomcat-9.0.31
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.31/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/apache-tomcat-9.0.31/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.31/bin/tomcat-juli.jar
Tomcat started.
[root@*** bin]#
启动.(2020-2-20 17:34:47)
8080端口.仍然无效.?需要使用.?9090端口.?改变端口号.?(2020-2-20 17:36:18)
(2020-2-20 17:37:07)
新的使用8080.
修改百度.
那么,如何修改tomcat的端口号呢?首先到安装目录(或者解压目录)下找到conf文件夹
,在里面找到server.xml
的文件
撤销
在一般模式中,按下一次字母U
键就可以撤销一次上次的输入。
/string
但是如何查找下一个.
n 就分别是向后找
N 向前找这个词
(2020-2-20 17:45:39)
唯一找到的8080改成9090.(2020-2-20 17:46:06)
/usr/local下面:
[root@*** local]# ls
aegis apr games lib64 mysql pureftpd share
apache-tomcat-9.0.31 bin include libexec nginx redis src
apache-tomcat-9.0.31.tar.gz etc lib memcached openssl sbin tomcat
[root@*** local]# cd tomcat/
[root@*** tomcat]# ls
bin conf lib logs README.md RUNNING.txt webapps
BUILDING.txt CONTRIBUTING.md LICENSE NOTICE RELEASE-NOTES temp work
[root@*** tomcat]# cd conf/
[root@*** conf]# vim server.xml
过程如上.(2020-2-20 17:48:20)
没有效果.重启.(2020-2-20 17:52:15)
[root@*** local]# service restart tomcat
restart: unrecognized service
[root@*** local]# service tomcat restart
Stoping Tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
waiting for processes to exit
Starting tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
Tomcat is running with pid: 6522
[root@*** local]#
history命令查看历史命令.(2020-2-20 17:55:32)
[root@*** bin]# sh shutdown.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.31
Using CATALINA_HOME: /usr/local/apache-tomcat-9.0.31
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.31/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/apache-tomcat-9.0.31/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.31/bin/tomcat-juli.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
[root@*** bin]# pwd
/usr/local/apache-tomcat-9.0.31/bin
[root@*** bin]#
处理有如上bug.(2020-2-20 17:56:55)
百度
这个问题确实是由较高版本的JDK编译的java class文件试图在较低版本的JVM上运行产生的错误。
切换Java版本.jdk(2020-2-20 17:58:48)
有过一次经验.知道多版本环境.
完成.(2020-2-20 18:02:35)
由此.看到教程.教程
add(2020-2-20 18:36:40)官网介绍重要教程.-各程序.目录.
源码安装目录:
Nginx:/usr/local/nginx
Tomcat:/usr/local/tomcat
JDK: /usr/java
PHP:/usr/local/php
MySQL:/usr/local/mysql
Pureftpd:/usr/local/pureftpd
Redis: /usr/local/redis
Memcached:/usr/local/memcached
phpMyAdmin:/data/wwwroot/default/phpMyAdmin
数据存储目录:
数据库(MySQL):/data/mysql
网站根目录:/data/wwwroot/www.example.com #添加虚拟主机会自动创建这个目录
Web访问日志:/data/wwwlogs
默认ip直接访问内容对应根目录:/data/wwwroot/default,该目录包含首页demo、Opcache缓存管理、phpinfo、phpmyadmin、探针等文件,目录里面文件可删除,目录不能删除。
首页demo:http://公网IP
PHPINFO地址:http://公网IP/phpinfo.php
Opcache地址:http://公网IP/ocp.php
phpmyadmin管理地址:http://公网IP/phpMyAdmin #建议用chrome浏览器,访问注意大小写,为了安全建议重命名或者删除
PHP运行环境探针地址:http://公网IP/tz.php
JDK版本切换
You have successfully changed to 1.8
再次运行.
# sh shutdown.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.31
Using CATALINA_HOME: /usr/local/apache-tomcat-9.0.31
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.31/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/apache-tomcat-9.0.31/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.31/bin/tomcat-juli.jar
Feb 20, 2020 6:06:24 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact [localhost:8005] (base port [8005] and offset [0]). Tomcat may not be running.
Feb 20, 2020 6:06:24 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Error stopping Catalina
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:389)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:479)
SEVERE: Could not contact [localhost:8005] (base port [8005] and offset [0]). Tomcat may not be running.
似乎说.tomcat未启动.那么启动.(2020-2-20 18:09:09)
/usr/local/apache-tomcat-9.0.31/bin启动.
# sh startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.31
Using CATALINA_HOME: /usr/local/apache-tomcat-9.0.31
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.31/temp
Using JRE_HOME: /usr/java/default
Using CLASSPATH: /usr/local/apache-tomcat-9.0.31/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.31/bin/tomcat-juli.jar
Tomcat started.
成功.开始.可以往里面放东西.?(2020-2-20 18:11:36).
出错.一直在修改文件.未想到.权限问题.
[root@*** default]# pwd
/data/wwwroot/default
[root@*** default]# ll
total 20
-rw-r--r-- 1 www www 15647 Feb 20 2019 index2.html
-rw-r--r-- 1 root root 304 Feb 20 18:33 index.html
权限问题.解决.
[root@*** wwwroot]# chown -R www.www ./*
[root@*** wwwroot]# ll
total 4
drwxr-xr-x 2 www www 4096 Feb 20 18:33 default
[root@*** wwwroot]# cd default/
[root@*** default]# ll
total 20
-rw-r--r-- 1 www www 15647 Feb 20 2019 index2.html
-rw-r--r-- 1 www www 304 Feb 20 18:33 index.html
(2020-2-20 18:46:25)ok
自己.写了个页面.?不行.?
(2020-2-20 18:52:53)
http://IP/gwd.html
自动切到了.?Apache Tomcat/9.0.31
over不管了.8080
上次.项目.
上传.
上传笔记.1
提示.教程.在
(2020-2-20 19:05:39)
未登录新账号.不好操作.(2020-2-20 19:07:38).
开放两个端口.
ftp以及9090.
over.尝试.
当下来.本地运行.没问题.(2020-2-20 19:26:43)
恰好.本地数据库.还在.(2020-2-20 19:27:16)
mysql> use message;
Database changed
mysql> show tables;
+-------------------+
| Tables_in_message |
+-------------------+
| messages |
+-------------------+
1 row in set (0.02 sec)
mysql> select * from messages;
+---------------------+---------------------+
| time | message |
+---------------------+---------------------+
| 2020-01-20 19:13:36 | firstByIdea |
| 2020-01-20 19:41:04 | good |
| 2020-01-20 19:47:42 | testByIdeaInService |
| 2020-01-20 19:53:38 | yes |
| 2020-01-20 19:53:44 | yes |
| 2020-01-20 20:13:06 | testByIdeaInService |
+---------------------+---------------------+
6 rows in set (0.00 sec)
后台.完成.?打包方式.war
直接将这个上传到.?服务器webapps下面.?即可.?
没有ftp?和插件账号无法使用.
使用git上传.?然后.?修改权限.?(2020-2-20 19:30:20).
gitee新建仓库.clone下来.
31 git add .
32 git commit -m "上传"
33 git push origin master
先绑定.账号.(2020-2-20 19:38:21)
教程.idea绑定.阿里云.
获取 AccessKey
可以.使用成功了.可以使用idea命令行.以及.传文件.?懂吗.?很方便.?
编码.?操作服务器.上传文件.?一体化.?懂吗.?(2020-2-20 19:52:47)
把.数据库.弄好.?就好了.?(2020-2-20 19:53:02).
数据.加上.成功.
ok(2020-2-20 20:02:04)
前端.?放在哪里.?为什么80变成了.?8080.?懂吗.?
搞定.原来的.wwwroot下的成了.9090.老tomcat.
wwwroot/default和8080保持了一致.?(2020-2-20 20:22:38)可能是root权限换成了.?www.
成功.改一改.即可.over