Fedora 20 安装试用体验全程讲解

  发布时间:2014-06-16 15:18:47   作者:曹江华   我要评论
Fedora 20在两次跳票后正式发布,主要特性包括:远程桌面方案X2Go;网络管理器支持扩大绑定和桥接功能;改进3D打印机支持等,本文中,作者对Fedora 20 进行安装试用,分享一下试用心得,希望对大家有一定的帮助

5、修改相关的配置文件

首先修改/etc/php.ini:

  1. 把下面一行的注释去掉 [...] 
  2. cgi.fix_pathinfo=1 [...] 
  3. 然后修改/etc/lighttpd/conf.d/fastcgi.conf配置文件为如下格式: [...] 
  4. server.modules += ( "mod_fastcgi" ) [...] 
  5. 注意fastcgi.server 字段内容如下: [...] 
  6. ## ## PHP Example 
  7. ## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini. ## 
  8. ## The number of php processes you will get can be easily calculated: ## 
  9. ## num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN ) ## 
  10. ## for the php-num-procs example it means you will get 17*5 = 85 php ## processes. you always should need this high number for your very 
  11. ## busy sites. And if you have a lot of RAM. :) ## 
  12. fastcgi.server += ( ".php" => (( 
  13. "host" => "127.0.0.1", "port" => "9000", 
  14. "broken-scriptfilename" => "enable" )) 
  15. ) #fastcgi.server = ( ".php" => 
  16. #                   ( "php-local" => #                     ( 
  17. #                       "socket" => socket_dir + "/php-fastcgi-1.socket", #                       "bin-path" => server_root + "/cgi-bin/php5", 
  18. #                       "max-procs" => 1, #                       "broken-scriptfilename" => "enable", 
  19. #                     ) #                   ), 
  20. #                   ( "php-tcp" => #                     ( 
  21. #                       "host" => "127.0.0.1", #                       "port" => 9999, 
  22. #                       "check-local" => "disable", #                       "broken-scriptfilename" => "enable", 
  23. #                     ) #                   ), 
  24. # #                   ( "php-num-procs" => 
  25. #                     ( #                       "socket" => socket_dir + "/php-fastcgi-2.socket", 
  26. #                       "bin-path" => server_root + "/cgi-bin/php5", #                       "bin-environment" => ( 
  27. #                         "PHP_FCGI_CHILDREN" => "16", #                         "PHP_FCGI_MAX_REQUESTS" => "10000", 
  28. #                       ), #                       "max-procs" => 5, 
  29. #                       "broken-scriptfilename" => "enable", #                     ) 
  30. #                   ), #                ) 
  31. ), [...] 

然后还要激活这个模块,修改配置文件/etc/lighttpd/conf.d/fastcgi.conf

  1. [...] ## FastCGI (mod_fastcgi) 
  2. ## include "conf.d/fastcgi.conf" 
  3. [...] 

就是去掉include "conf.d/fastcgi.conf"前面的注释符号。

下面测试一下php脚本:

  1. # vi /var/www/lighttpd/info.php <?php 
  2. phpinfo(); ?> 
  3. # systemctl restart lighttpd.service 

然后使用浏览器查看如图6 ,大家看红色圈框部分(Server API FPM/FastCGI )

图6 测试一下php脚本

图6显示则表明web服务器可以解析静态页面和php页面(但目前还无法连接mysql数据库)。

下面设置为PHP安装MySQL支持:

php5支持MySQL很简单,只要安装php-mysql软件包即可;但php程序要运行可能需要多个php模块的支持

  1. # yum install php-mysqlnd php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy php-opcache 

安装完成后重启:

  1. #systemctl reload php-fpm.service 

重新访问浏览器查看安装的php模块 如mysql:(如下图7)

图7 为PHP安装MySQL支持

Unix域Socket通信设置

Unix域Socket因为不走网络,的确可以提高web服务器和php-fpm通信的性能,但在高并发时会不稳定。设置如下:

  1. vi /etc/php-fpm.d/www.conf 修改为如下内容 
  2. [...] ;listen = 127.0.0.1:9000 
  3. listen = /tmp/php5-fpm.sock [...] 
  4. 然后重启服务: # systemctl reload php-fpm.service 
  5. 下面修改etc/lighttpd/conf.d/fastcgi.conf 文件,修改为如下内容 vi /etc/lighttpd/conf.d/fastcgi.conf 
  6. fastcgi.server += ( ".php" => (( 
  7. "socket" => "/tmp/php5-fpm.sock", "broken-scriptfilename" => "enable" 
  8. )) ) 
  9. 然后重启服务: # systemctl restart lighttpd.service 

五、简单介绍一下NFS 服务器和客户端设置

这里笔者的安装环境如下:

NFS 服务器端,ip 10.0.0.20 ,计算机名称 www.cjh.net NFS 客户端端,ip 10.0.0.21 ,计算机名称 www.cjh1.net

NFS 服务器端配置

安装软件包:

  1. 安装软件包 #yum -y install nfs-utils 
  2. 修改配置文件: #vi /etc/idmapd.conf 
  3. # line 5: 修改为相对应的名称 Domain = cjh.net 
  4. 修改文件 #vi /etc/exports 
  5. # write like below *note /home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash) 
  6. # *note /home ? shared directory 
  7. 10.0.0.0/24 ? range of networks NFS permits accesses rw ? writable 
  8. sync ? synchronize no_root_squash ? enable root privilege 
  9. no_all_squash ? enable users' authority 启动相关服务 
  10. # systemctl start rpcbind.service # systemctl start nfs-server.service 
  11. # systemctl start nfs-lock.service # systemctl start nfs-idmap.service 
  12. # systemctl enable rpcbind.service # systemctl enable nfs-server.service 
  13. # systemctl enable nfs-lock.service # systemctl enable nfs-idmap.service 
  14. NFS 客户端端设置: 安装软件包 
  15. # yum -y install nfs-utils 修改配置文件 
  16. # vi /etc/idmapd.conf # line 5: 修改为相对应的名称 
  17. Domain = cjh.net 启动服务 
  18. # systemctl start rpcbind.service # systemctl start nfs-lock.service 
  19. # systemctl start nfs-idmap.service # systemctl start nfs-mountd.service 
  20. # systemctl enable rpcbind.service # systemctl enable nfs-lock.service 
  21. # systemctl enable nfs-idmap.service # systemctl enable nfs-mountd.service 
  22. 挂载磁盘 # mount -t nfs dlp.server.world:/home /home 

fedora 20的不足之处

介绍一下 Gnome 开发的软件中心,这个软件中心还在完善当中,所以我打开软件中心,感觉有BUG,一是软件加载很慢,可能是服务器在国外的原因,二是无法添加直接其他软件源。使用界面分成三个部分:全部软件、已经安装、更新。不过目前没有软件课提供更新。

图8 软件中心

这个软件中心设计思路和Ubuntu软件中心相似,不过却没有任何设置选项,笔者使用它首先安装另外一个软件包工具:Gonme Package 后才能设置其他软件源等工作。

总结:

总体感觉Fedora 20的 使用感觉和上个版本Fedora  19变化不大,所以笔者就不多赘述了,大家还是关注2014 年 即将发布的Red Hat Enterprise Linux 7 吧 。

相关文章

最新评论