Rootop 服务器运维与web架构

rhel7的几个变化

首先看一下ip信息:
[root@localhost ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.140 netmask 255.255.255.0 broadcast 192.168.0.255

网卡命名改变了,估计是udev(设备管理器)改变了。

通过yum安装了apache,启动服务。
[root@localhost ~]# service httpd start
Redirecting to /bin/systemctl start httpd.service
[root@localhost ~]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 3087 root 4u IPv6 25962 0t0 TCP *:http (LISTEN)

提示改变为:/bin/systemctl start httpd.service
管理服务的命令由 service 变化为 systemctl ,然后紧跟参数 /start/stop/status/enable/disable 加服务 httpd.service 多了个 .service

设置为开机启动:
[root@localhost ~]# systemctl enable httpd.service
ln -s ‘/usr/lib/systemd/system/httpd.service’ ‘/etc/systemd/system/multi-user.target.wants/httpd.service’
建立软连接
[root@localhost ~]# systemctl disable httpd.service
rm ‘/etc/systemd/system/multi-user.target.wants/httpd.service’
删除软连接

用chkconfig设置看下:
[root@localhost ~]# chkconfig httpd on
注意:正在将请求转发到“systemctl enable httpd.service”。
ln -s ‘/usr/lib/systemd/system/httpd.service’ ‘/etc/systemd/system/multi-user.target.wants/httpd.service’
将指令还是重定向给systemctl

[root@localhost ~]# systemctl status httpd.service
httpd.service – The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: active (running) since 二 2014-08-05 11:12:02 CST; 1min 31s ago
Main PID: 3087 (httpd)
Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”
CGroup: /system.slice/httpd.service
├─3087 /usr/sbin/httpd -DFOREGROUND
├─3088 /usr/sbin/httpd -DFOREGROUND
├─3089 /usr/sbin/httpd -DFOREGROUND
├─3090 /usr/sbin/httpd -DFOREGROUND
├─3091 /usr/sbin/httpd -DFOREGROUND
└─3092 /usr/sbin/httpd -DFOREGROUND

8月 05 11:12:02 localhost.localdomain httpd[3087]: AH00558: httpd: Could not reliably determine …age
8月 05 11:12:02 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

不过用service httpd status有同样的效果。没有完全抛弃。

防火墙 iptables 变为 firewall (systemctl stop  firewalld)不过可以继续用 iptables 。

再看下运行级别,默认是图形界面。
当直接编辑/etc/inittab时,没有了企业版6中的配置参数,有修改提示:
# systemd uses ‘targets’ instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To set a default target, run:
#
# ln -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target

systemd使用targets代替了运行级别,有两个主要的目标,multi-user.target代表运行级别3,graphical.target代表图形界面
ln -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target 是修改方法

修改为级别3:
[root@localhost ~]# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

查看/etc/fstab:
UUID=6b163dbd-8251-4de5-b98f-6d9fd408b3a0 / xfs defaults 1 1
xfs被用于默认文件系统,发行资料说支持500T硬盘。

[root@localhost ~]# vi /boot/grub2/grub.cfg 使用了grub2。支持更多功能。

关于数据库mariadb已经代替mysql了。apache用了最新的2.4,php用了5.4 ,可以尝试运行到线上环境。

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/2785.html

作者:Venus

服务器运维与性能优化

评论已关闭。