您的位置:首页 > 运维架构 > Linux

红帽企业版 Linux 6.4 试用体验

2013-04-07 05:43 141 查看
  红帽企业版Linux 6.4正式版已于2013年2月发布,下面介绍一下十天左右的使用感受,供广大网友参考。 对于多媒体以及办公方面笔者感觉Linux 在最近两三年已经做得相当不错了,可惜由于惯性原因还是不能占据桌面市场。还是看看笔者关心的企业级应用部分。

一、红帽企业版RHEL6.4的新功能

1、和微软的合作

  微软于2012 年初开始向Upstream的 linux 核心提供驱动程序。主要包括Hyper-V 的应用代码,所以在2012 Linux kernel development 报告中披露,微软对于Linux程序代码的贡献排名上升比例是大约1.1% ,如图1 。



图1 微软对于Linux程序代码的贡献排名上升比例是大约1.1%
  在 Hyper-V 中对红帽企业版 Linux 6.4 集成的红帽企业版 Linux 虚拟机安装以及 Hyper-V 半虚拟设备支持可让用户在微软 Hyper-V hypervisor 顶层将红帽企业版 Linux 6.4 作为虚拟机运行。这将提高RHEL的整体性能对微软Hyper-V和微软的Azure用户持久虚拟机运行RHEL 6.4。另外在桌面操作方面Evolution邮件加入对于Microsoft Exchange和日历进化的支持。

2、文件系统和存储方面

  文件系统方面比较重要的改进是并行NFS(pNFS)客户端的加入,pNFS支持直接I / O更快的数据访问。这种驱动器I / O密集的用例,包括数据库工作负载特定的性能优势。Linux 内核在2.6.30 开始支持pNFS,目前是少数支持pNFS的操作系统。网络文件系统(Network File System,NFS)是大多数局域网(LAN)的重要组成部分。但 NFS 不适用于高性能计算中苛刻的输入输出密集型应用程序,至少以前是这样。NFS 标准的最新修改纳入了 Parallel NFS(pNFS),它是文件共享的并行实现,将传输速率提高了几个数量级。图2 是支持pNFS的NFS4.1 版本的示意图。



图2 支持pNFS的NFS4.1 版本
  在红帽企业版 Linux 6.4 中完全支持 pNFS.pNFS 支持 3 个不同的存储协议或者布局:文件、对象和块。红帽企业版 Linux 6.4 NFS 客户端支持文件布局协议。有关 pNFS 的详情请参考 http://www.pnfs.com/。另外LVM 现在可以创建、删除和重新定义 RAID10 逻辑卷大小。

  3、安全管理方面

  身份管理方面主要是SSSD的功能改进, 提高系统安全服务守护程序(SSSD)增强于Microsoft Active Directory中的互操作性的经验,在异构环境中提供集中身份的访问控制,适用于Linux / Unix客户端。在红帽企业版 Linux 6.4 中,已将 SSSD 改进为可让您为使用 SSSD 登录的用户选择 DIR: 缓存。这个功能是作为技术预览引进。需要说的是SSSD无需特殊设置使用system-config-authentication工具配置后会自动运行 。

  另外在防火墙方面还有一个小工具叫:退回防火墙配置。如果无法使用默认配置,iptables 和 ip6tables 服务现在提供分配退回防火墙配置的功能。如果采用 /etc/sysconfig/iptables 中的防火墙规则失败,则会采用现在的退回文件。退回文件名为 /etc/sysconfig/iptables.fallback,采用 iptables-save 文件格式(与/etc/sysconfig/iptables 相同)。如果采用退回文件仍失败,则没有进一步的退回设置。要生成退回文件,请使用标准防火墙配置工具,并将该文件重命名或者复制到退回文件中。在 ip6tables 服务中可采用同样的步骤,只需要使用 “ip6tables” 替换所有“iptables”。



二、红帽企业版RHEL6.4 安装完成后的基本操作

  红帽企业版6.4安装过程比较简单,这里笔者就不赘述了。下面看看安装完成后的基本操作。说明这里笔者使用的是Centos 6.4 X86 版本。

1、首先设置软件源

rpm --import https://fedoraproject.org/static/0608B895.txt rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm yum install yum-priorities

  修改/etc/yum.repos.d/epel.repo文件如下(说明这里需要把增加优先级设置 priority=10 ,其他不变):

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
priority=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[...]

  修改/etc/yum.repos.d/remi.repo文件如下:

  将 enabled 设置为1 ,其他不变。

[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
priority=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
enabled=0

2、搭建一个LNMP环境

  LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构.nginx性能稳定、功能丰富、运维简单、处理静态文件速度快且消耗系统资源极少。作为 Web 服务器:相比 Apache,Nginx 使用更少的资源,支持更多的并发连接,体现更高的效率。作为负载均衡服务器:Nginx 既可以在内部直接支持 Rails 和 PHP,也可以支持作为 HTTP代理服务器对外进行服务.nginx 用C编写,不论是系统资源开销还是CPU使用效率都比Perlbal要好的多。作为邮件代理服务器:Nginx同时也是一个非常优秀的邮件代理服务器(最早开发这个产品的目的之一也是作为邮件代理服务器),Last/fm 描述了成功并且美妙的使用经验.nginx 安装非常的简单,配置文件非常简洁(还能够支持perl语法).nginx支持平滑加载新的配置,还能够在不间断服务的情况下进行软件版本的升级。

(1)首先安装Mysql5

yum install mysql mysql-server
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

  下面运行mysql_secure_installation命令,它会执行几个设置:

  a)为root用户设置密码
  b)删除匿名账号
  c)取消root用户远程登录
  d)删除test库和对test库的访问权限
  e)刷新授权表使修改生效

  通过这几项的设置能够提高mysql库的安全。具体操作过程这里笔者不赘述了如图3。




点击查看原始大图

  (2)安装Nginx

yum install nginx
Then we create the system startup links for nginx and start it:
chkconfig --levels 235 nginx on
/etc/init.d/nginx start

  测试一下如图4:




点击查看原始大图

图4 测试一下

  (3)安装配置php 模块

yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy php-pecl-apc

  修改配置文件/etc/php.ini 设置cgi.fix_pathinfo=0

[...]
cgi.fix_pathinfo=0
[...]

  (4)修改 nginx配置文件

vi /etc/nginx/nginx.conf

  修改为:

[...]
worker_processes 4;
[...]
keepalive_timeout 2;
[...]



vi /etc/nginx/conf.d/default.conf

  修改为:

[...]
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#location ~ \.php$ {
# proxy_pass http://127.0.0.1; #}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}}

  重新加载:

/etc/init.d/nginx reload

  编写一个php文件测试

vi /usr/share/nginx/html/info.php