配置jdk18很简单,下载jdk,只需要.tar.gz结尾的文件就行,https://download.oracle.com/java/18/latest/jdk-18_linux-x64_bin.tar.gz
然后只要在/etc/profile文件里加入下列代码就行
#这个java_home就是解压后,java文件夹地址 export JAVA_HOME=/usr/local/java/jdk1.8.0_121 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin
然后现在都在用dnf来下载软件了。
先安装mysql
dnf install -y community-mysql-server
再启动
#启动 systemctl start mysqld #设为开机启动 systemctl enable mysqld #查看状态 systemctl status mysqld
在就开始设置mysql数据库。
#这句话是命令 [root@MiWiFi-R4CM-srv home]# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? #这是文你是否执行密码审查,就是所谓有几个字母几个数字之类的 Press y|Y for Yes, any other key for No: n Please set the password for root here. #这是设置密码 New password: Re-enter new password: By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. #是否删除匿名用户 Remove anonymous users? (Press y|Y for Yes, any other key for No) : n ... skipping. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. #是否禁止root远程登陆 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n ... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. #是否删除test数据库 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : n ... skipping. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. #是否刷新所有规则 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
插几句,这时mysql还是不能从其它机器访问,还要多加三句。
[root@MiWiFi-R4CM-srv home]# mysql -u root -p
mysql> use mysql
mysql> select user,host from user;
mysql> update user set host='%' where user='root';
mysql> alter user 'root'@'%' identified with mysql_native_password by '123';
#这个123是我设的密码
mysql> flush privileges;
再就可以从其它机器访问数据库了。
再就是tomcat的安装了,我的系统是fedora35,所以很方便的可以用dnf命令
dnf install tomcat tomcat-webapps tomcat-admin-webapps
这三个,一个是服务,一个是网页布置,一个是管理,三个一起装,很快的。
然后就是配置tomcat了。抄了别人的文章,话说为什么不想在csdn里发文章了,就是因为连复制,他喵的都要登陆,真贱。
修改/usr/share/tomcat/webapps/manager/META-INF/conetxt.xml配置(这个是dnf为tomcat配置的默认目录),
manager应用默认为只能本机访问,修改为所有ip都可访问
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />#直接把allow后面改成这样就行了。
</Context>
————————————————
版权声明:本文为CSDN博主「jasnet_u」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jasnet_u/article/details/90441091
2、在/usr/share/tomcat/conf/tomcat-users.xml 添加manager角色
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="123" roles="manager-gui,manager-script"/>
————————————————
版权声明:本文为CSDN博主「jasnet_u」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jasnet_u/article/details/90441091
然后,就可以从远程登陆tomcat服务器了。
浙公网安备 33010602011771号