linux虚拟机问题备忘
2015-12-27 00:03
537 查看
今天装linux遇到一些问题总结一下
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
[注意:profile是指文件不是指文件夹]
b. 找到export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC,在该语句的上面添加以下语句:
export JAVA_HOME=”/usr/java/jdk1.5.0_17”
[注意:“=”两侧不能有空格]
export CLASSPATH=”.:/usr/java/jdk1.5.0_17/lib:/usr/java/jdk1.5.0_17/jre/lib”
[注意:“=”两侧不能有空格;“:”是冒号,同样不要有空格出现]
pathmunge /usr/java/jdk1.5.0_17/bin:/usr/java/jdk1.5.0_17/jre/bin
[注意:无引号]
设置完毕后,保存文件。重启Redhat后登录控制终端,键入:java -version;
如果出现java version “1.5.0.17”等字样,说明您的JDK已经安装成功了!祝贺你! 用source /etc/profile让配置和生效可以不重起linux
编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
......
编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。
如果你碰到其他类似提示:
cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。
-------------------------------------------------------------------------------------
郁闷的是.我把SELinux关闭后还是不行.于是到google上search.发现这个很有用.
在你保证SElinux 被disable后.还执行下
chcon -t texrel_shlib_t
如: chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件.)
以上两步.已经解决了很多server的问题了.
1.linux如何关闭防火墙
1) 重启后生效开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
2.redHat设置java环境变量
a. 进入/etc文件夹(命令为:#vi /etc/profile),找到文件profile并打开。[注意:profile是指文件不是指文件夹]
b. 找到export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC,在该语句的上面添加以下语句:
export JAVA_HOME=”/usr/java/jdk1.5.0_17”
[注意:“=”两侧不能有空格]
export CLASSPATH=”.:/usr/java/jdk1.5.0_17/lib:/usr/java/jdk1.5.0_17/jre/lib”
[注意:“=”两侧不能有空格;“:”是冒号,同样不要有空格出现]
pathmunge /usr/java/jdk1.5.0_17/bin:/usr/java/jdk1.5.0_17/jre/bin
[注意:无引号]
设置完毕后,保存文件。重启Redhat后登录控制终端,键入:java -version;
如果出现java version “1.5.0.17”等字样,说明您的JDK已经安装成功了!祝贺你! 用source /etc/profile让配置和生效可以不重起linux
3.cannot restore segment prot after reloc: Permission denied错误排查
在linux上安装有些东西时会出现 Permission denied 的情况:以下就是解决它的办法之一编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
......
编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。
如果你碰到其他类似提示:
cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。
-------------------------------------------------------------------------------------
郁闷的是.我把SELinux关闭后还是不行.于是到google上search.发现这个很有用.
在你保证SElinux 被disable后.还执行下
chcon -t texrel_shlib_t
如: chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件.)
以上两步.已经解决了很多server的问题了.
相关文章推荐
- Linux C中struct tm结构与time_t相互转换
- 13.Linux之软件安装
- Linux下MySQL C API简单示例
- 用kalinux 下面的mitmproxy 工具查看请求的时候会发现请求一个symcd.com
- Linux中程序包管理
- 基于linux-2.6.38.8内核的SDIO/wifi驱动分析
- Linux + C + Epoll实现高并发服务器(线程池 + 数据库连接池)
- Linux监控工具介绍系列——smem
- Linux netstat命令详解
- linux service命令
- linux 查看elf相关命令
- Linux Netlink通信机制详解
- Linux环境下安装部署AWStats日志分析系统实例
- 宿主机为linux、windows分别实现VMware三种方式上网
- linux根目录下的proc目录详解
- Linux常用文件管理命令
- Hadoop单机模式和伪分布式搭建教程CentOS
- Ubuntu / Linux Mint本地安装MySQL
- Linux学习笔记2:如何快速的学习使用一个命令
- linux下load averger参数详解