目录
1、linux配置安装java jdk
2、在linux系统中运行ssm工程的jar包后,在浏览器访问超时,关闭防过墙和SELinux。
3、使用yum命令时出现"The requested URL returned error: 404 Not Found" Trying other mirror.Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
1、linux配置安装java jdk
1、首先安装好XShell和Xftp软件,方便对linux系统进行图形化界面操作和从本机Windows系统向linux系统上传文件。
点击后在搜索框搜索下载XShell和Xftp。相关软件使用教程有很多,下载好后也好匹配好linux系统ip地址,建立连接,然后将下载好的jdk压缩包上传到linux系统/usr/local下。
2、配置环境变量
在/usr/local解压压缩包,然后vi编译器编译环境变量文件,命令如图。
然后输入大写G,跳到最后一行, 输入a进入编译模式,输入如图配置。
最后输入命令
init 0 关机 或者
init 6 重启 后输入java -version查看是否配置成功。
有关linux基础操作可参考链接: linux基础命令行操作【1】_z输关的博客-CSDN博客
2、在linux系统中运行ssm工程的jar包后,在浏览器访问超时,关闭防过墙和SELinux。
关闭SELinux和iptabe即可,具体操作如下:
iptables是linux中用于配置防火墙规则的工具,而一般iptables都默认打开。
安全增强型 Linux(Security-Enhanced Linux)简称 SELinux,它是一个 Linux 内核模块,也是 Linux 的一个安全子系统。一般都会关闭,因为它会禁用一些端口和ip通信。
==============================================================
1、iptables
#service iptables status 查看状态
#service iptables stop 关闭
#service iptables start 开启
永久关闭:
chkconfig iptables off 关闭
chkconfig iptables off 开启
2、永久关闭SELinux
#vi /etc/selinux/config
将文件中的SELINUX="" 为 disabled ,然后重启,可以永久关闭SELinux。
3、暂时关闭SELinux,重启后失效
如果不想重启系统,使用命令setenforce 0
注:setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux
#---------------------------------------------------------------
查看selinux状态:
命令:setstatus -v
getenforce/setenforce查看和设置SELinux的当前工作模式
显示如下:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 21
1,Enforcing (记录警告且阻止可疑行为)
2,Permissive (代表仅记录安全警告但不阻止可疑行为)
3,Disabled (禁用状态
3、使用yum命令时出现"The requested URL returned error: 404 Not Found" Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
报错信息会提示是哪个镜像出错了。
具体操作和网上大多数说的一样,不过不是改写原有配置,而是加配置。
vi编译器编译: vi /etc/yum.repos.d/CentOS-Base.repo
之后保存退出,重启服务 service network restart,即可。



