RHEL

RHCE考试总结

蓝咒 提交于 2019-12-04 06:43:44
序号 题目 需求 操作 1 配置SELinux system1 & system2 要求SELinux的工作模式为enforcing,且重启依然有效 vim /etc/selinux/config SELINUX= enforcing setenforce 1 getenforce 2 配置SSH访问 system1 & system2 允许 group8.example.com 域的客户对 system1 和 system2 进行 ssh 访问 禁止 my133t.org 域的客户对 system1 和 system2 进行 ssh 访问 备注: my133t.org 是在 172.13.8.0/24 网络 firewall-config firewall-cmd --list-all 3 自定义用户环境 system1 & system2 在系统system1和system2上创建自定义命令为qstat ,要求: 此自定义命令将执行以下命令:/bin/ps -Ao pid,tt,user,fname,rsz 此命令对系统中的所有用户有效 vim /etc/profile alias qstat='/bin/ps -Ao pid,tt,user,fname,rsz' source /etc/profile qstat 4 配置端口转发 system1 在 172.24.8.0

Did I install Ruby 1.9.3 correctly on RHEL?

匆匆过客 提交于 2019-12-04 06:42:00
Before you say yum -y install ruby193 ... I did that. Please note that I am not a Ruby developer, but need this program as part of another developer's work via web services. (He is not available.) Any help would be greatly appreciated. I attempted to install a library per instructions and got: [root@ctbroker console]# gem install json -v '1.8.0' Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /opt/rh/ruby193/root/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /opt/rh/ruby193/root/usr/share

ini配置文件编辑器crudini

拈花ヽ惹草 提交于 2019-12-04 05:04:10
作者:张瑞旗 / 腾科IT培训集团红帽讲师 最近,在学习OpenStack过程中,遇到两个非常相像的命令:crudini和openstack-config。几经查询,发现它们原来是Pádraig Brady用Python开发的、用来对配置文件(即ini文件)进行编辑的工具。它们是同一个命令,有两个名字而已。 Pádraig Brady是Linux和OpenStack项目的代码贡献者。根据搜索到的资料推测,他在OpenStack项目中开发了openstack-config,后来感觉这个工具很有用,便将其改名为crudini。2013年9月27日,OpenSuse邮件列表中显示,openstack-config这个命令正式更名为crudini。 我们都知道,crud是4个单词的首字母简写,即create、read、update和delete,中文译为“增删改查”。这个是数据的最常见的4类操作方法。有些软件的配置文件采用的是ini格式,如php.ini。这样的配置文件往往会成若干个段落。段落以[default]之类的格式标识。具体的配置条目则为“datadir=/var/lib/data”形式。一个名叫myconfig.ini的文件可能会显示如下: [default] cmdline=/usr/bin/mycmd datadir=/var/lib/mydata

Use PHP mail to send via smtp

北城余情 提交于 2019-12-04 04:10:25
问题 Does anybody know if you can configure php's mail() command so it will only use an SMTP server rather than the local sendmail? We are having trouble with emails being marked as spam. Our server is running RedHat 5 Enterprise. I am aware of various PHP libraries that act as an SMTP client but I'd rather configure PHP so mail() used an SMTP server directly. 回答1: According to this manual page, it is possible on Windows only. 回答2: Check these links: Link One Link Two Link Three Example: Update:

RedHat/CentOS7下修改Mongodb数据目录 SELinux要关闭

孤街浪徒 提交于 2019-12-04 02:06:48
RedHat/CentOS7下修改Mongodb数据目录 互联网 尧 2年前 (2017-02-28) 1313℃ 0评论 今天给自己一台服务器装了Mongodb数据库,遇到一些问题,在这里记录一下。 这次是通过yum源安装的mongodb3.4.2版本,安装完后直接运行没有问题。接着修改配置文件,把数据目录修改到挂载的其他盘上,因为默认的是/var/lib/mongo。 当停止服务修改完重启服务,发现服务一直起不来!然后查看日志,exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating,然后code=100; 这下蒙蔽了,之前安装过一次然后修改配置文件都妥妥的,开始排查问题,按提示的问题把数据目录权限设置成777依旧起不来,改用户组也一样。折腾了一上午,最后定位问题是,因为yum安装的是通过创建的mongod用户运行服务,当服务器SELinux开启的时候,修改mongodb数据库的数据目录需要修改安全上下文。 只需在终端敲下面这行代码即可完成更改: Shell 1 chcon -R -t mongod_var_lib_t /data/db 运行完命令后就能正常启动Mongodb服务了~ 注:RedHat

Can upstart expect/respawn be used on processes that fork more than twice?

倖福魔咒の 提交于 2019-12-03 16:36:54
问题 I am using upstart to start/stop/automatically restart daemons. One of the daemons forks 4 times. The upstart cookbook states that it only supports forking twice. Is there a workaround? How it fails If I try to use expect daemon or expect fork , upstart uses the pid of the second fork. When I try to stop the job, nobody responds to upstarts SIGKILL signal and it hangs until you exhaust the pid space and loop back around. It gets worse if you add respawn. Upstart thinks the job died and

GCC toolchain for LLVM

瘦欲@ 提交于 2019-12-03 12:28:16
I am running on an RHEL 6.x box, which of course has GCC 4.4 installed. I wish to have LLVM running on this machine. In order to do so, I must compile it from source. In order to do that , I need a more modern version of GCC. So, following the instructions , I have built GCC 4.8.2: [snip] % $PWD/../gcc-4.8.2/configure --prefix=$HOME/toolchains --enable-languages=c,c++ % make -j$(nproc) % make install I'm logged in as root, so $HOME/toolchains resolves to /root/toolchains . After satisfying prerequisites for LLVM, I'm ready to configure and build LLVM. root@dev06 /root/llvm-build # ~/llvm

Permanently enable RHEL scl

牧云@^-^@ 提交于 2019-12-03 11:15:03
问题 Is there a way to permanently enable custom Software Collections for RedHat? I have installed an scl to provide python27 in RHEL6 and don't want to have to enable the custom scl every time. 回答1: Well, you could add something to your startup script to source the enable script. Eg add to your .bash_profile (note space between initial dot and / ) . /opt/rh/python27/enable 回答2: This option sounds dangerous to me for root. I would think something like the following would be safer and more

The command '/bin/sh -c returned a non-zero code: 127

六眼飞鱼酱① 提交于 2019-12-03 09:26:48
I'm new to docker so I might be doing this wrong, but I'm trying to install Tomcat6 through a Dockerfile which like this: FROM rhel7:latest RUN cd /tmp RUN "wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz" RUN tar xzf apache-tomcat-6.0.44.tar.gz RUN mv apache-tomcat-6.0.44 /usr/local/tomcat6 RUN cd /usr/local/tomcat6 Run ./bin/start.sh Its failing on the 3rd line with the: RUN "wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz" When I run the docker build I get this: I'm using: Oracle Virtual Box V4.3.28

Can upstart expect/respawn be used on processes that fork more than twice?

*爱你&永不变心* 提交于 2019-12-03 05:08:10
I am using upstart to start/stop/automatically restart daemons. One of the daemons forks 4 times. The upstart cookbook states that it only supports forking twice. Is there a workaround? How it fails If I try to use expect daemon or expect fork , upstart uses the pid of the second fork. When I try to stop the job, nobody responds to upstarts SIGKILL signal and it hangs until you exhaust the pid space and loop back around. It gets worse if you add respawn. Upstart thinks the job died and immediately starts another one. Bug acknowledged by upstream A bug has been entered for upstart. The