自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

親身體驗!Fedora 18主要服務(wù)和系統(tǒng)設(shè)置

原創(chuàng)
系統(tǒng) Linux
1月15日,多次跳票的Fedora 18終于發(fā)布,除了桌面版之外,還提供了KDE定制版、LXDE定制版等,有興趣的網(wǎng)友可以在其官網(wǎng)上下載試用。前幾天,51CTO系統(tǒng)頻道帶大家一起感受了一下Fedora 18桌面體驗,今天再和大家一起看看它在服務(wù)設(shè)置和系統(tǒng)管理方面內(nèi)容。

  【51CTO原創(chuàng)稿件】Fedora 18剛剛推出不久,前文筆者先寫一些桌面方面的內(nèi)容。下面看看在服務(wù)設(shè)置和系統(tǒng)管理內(nèi)容。

  一 系統(tǒng)初始化設(shè)置

  1 升級安裝簡介

  下面看看從Fedora 17升級到 Fedora 18的方法,首先備份系統(tǒng)。

  1. # yum update 
  2. # reboot 
  3. # yum install fedup 
  4. # fedup-cli --network 18 --debuglog fedupdebug.log 
  5. # reboot 

  GRUB 菜單選擇 "System Upgrade (fedup)" 即可。

  說明:FedUp (FEDora UPgrader)是一個新的系統(tǒng)升級工具。

  2 設(shè)置時區(qū)

  首先顯示所有時區(qū)列表

  1. # timedatectl list-timezones 
  2. Asia/Aden 
  3. Asia/Almaty 
  4. …… 

  設(shè)置一個自己的時區(qū):

  1. #timedatectl set-timezone Asia/Shanghai 

  驗證一下

  1. #timedatectl status 

  如圖1 :

  圖1:驗證一下時區(qū)設(shè)置

  3 設(shè)置鍵盤

  1. #vi /etc/vconsole.conf 
  2. # 修改為 to your keyboard rayouts 
  3. KEYMAP="uk" 

  重新加載一下:

  1. #source /etc/vconsole.conf 

  4 命令行下修改編碼

  首先顯示當(dāng)前編碼:

  1. # echo $LANG 
  2.  en_US 

  如果修改為中文的話就是:

  1. vi /etc/locale.conf 
  2. # 修改為 
  3. LANG=" zh_CN.UTF-8" 
  4. 重新加載一下 
  5. #source  /etc/locale.conf 

  5 輸入法快捷鍵設(shè)置

  Fedora 18 搭載的 GNOME 3.6 默認(rèn)使用 IBus 輸入法框架,但是沒有默認(rèn)綁定輸入法切換快捷鍵,可以這樣設(shè)定快捷鍵: 在?“系?統(tǒng)?設(shè)?”置?中?的“區(qū)域和語言中的?輸?入?源”?選?項?下?點?擊?“快?捷?鍵?設(shè)?置”?鏈?接?,或?者?點?擊?頂?端?的?鍵?盤?圖?標(biāo)?然?后?選?擇“快?捷?鍵?選?項”?,再?點?擊?左?側(cè)?面?板?的?輸?入?部?分?。?點?擊?切?換?至?下?一?輸?入?源?,然?后?按? CTRL + SPACE?。如圖2 。

  圖2:輸入法快捷鍵設(shè)置

  6 安裝資源監(jiān)控工具glances

  Glances是一款用于GNU/Linux、BSD和OS X 下的開源命令行系統(tǒng)監(jiān)視工具,它使用Python開發(fā)。能夠監(jiān)視CPU,負(fù)載,內(nèi)存, i/0,網(wǎng)絡(luò)流量,文件系統(tǒng),日志等 。

  1. # yum install python-pip python-devel gcc 
  2. # pip-python install glances 
  3. # glances(工作界面如圖3) 

  圖3 工作界面

#p#

  二 主要服務(wù)設(shè)置

  1 web服務(wù)器apache設(shè)置

  安裝apache:

  1. #yum -y install httpd 

  修改配置文件:

  1. #vi /etc/httpd/conf/httpd.conf 
  2. # line 261: 修改為Admin's address 
  3. ServerAdmin root@cjh.net 
  4. # line 275: 修改為ServerName www.cjh.net:80 
  5. # line 330: 修改為 
  6. Options FollowSymLinks ExecCGI 
  7. # line 337: 修改為All,此時,所有具有".htaccess"作用域的指令都允許出現(xiàn)在.htaccess文件中。 
  8. AllowOverride All 
  9. # line 401: add file name that it can access only with directory's name 
  10. DirectoryIndex index.html index.cgi index.php 
  11. # line 758:注釋掉 
  12. #AddDefaultCharset UTF-8 
  13. # line 795: uncomment and add file-type that apache looks them CGI 
  14. AddHandler cgi-script .cgi .pl .rb 

  啟動服務(wù):

  1. #systemctl start httpd.service 
  2. #systemctl enable httpd.service 

  測試一下html網(wǎng)頁:

  1. #vi /var/www/html/index.html 
  2. <html> 
  3. <body> 
  4. <p style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> 
  5. Test Page 
  6. </p> 
  7. </body> 
  8. </html> 

  使用瀏覽器查看一下,如圖4:

  圖4:測試一下html網(wǎng)頁

  測試一下cgi:

  1. #vi /var/www/html/index.cgi 
  2. #!/usr/local/bin/perl 
  3. print "Content-type: text/html\n\n"; 
  4. print "<html>\n<body>\n"; 
  5. print "<p style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n"; 
  6. print "CGI Test Page"; 
  7. print "\n</p>\n"; 
  8. print "</body>\n</html>\n"; 

  設(shè)置權(quán)限

  1. #chmod 705 /var/www/html/index.cgi 

  使用瀏覽器查看一下,如圖5:

  圖5:測試一下cgi

  安裝php相關(guān)軟件:

  1. #yum install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml 

  啟動服務(wù):

  1. #systemctl restart httpd.service 

  編寫一個文件測試一下:

  1. #vi /var/www/html/index.php 
  2. <html> 
  3. <body> 
  4. <p style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> 
  5. <?php 
  6. print Date("Y/m/d"); 
  7. ?> 
  8. </p> 
  9. </body> 
  10. </html> 

  使用瀏覽器查看一下,如圖6:

  圖6:測試一下php

  安裝ruby語言:

  Ruby,一種為簡單快捷的面向?qū)ο缶幊蹋嫦驅(qū)ο蟪绦蛟O(shè)計)而創(chuàng)的腳本語言 。

  1. #yum -y install ruby 
  2. #systemctl restart httpd.service 
  3. #vi /var/www/html/index.rb 
  4. #!/usr/bin/ruby 
  5. print "Content-type: text/html\n\n" 
  6. print "<html>\n<body>\n" 
  7. print "<p style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n" 
  8. print Time.now.strftime('%Y/%m/%d') 
  9. print "\n</p>\n" 
  10. print "</body>\n</html>\n" 

  設(shè)置權(quán)限:

  1. #chmod 705 /var/www/html/index.rb 

  使用瀏覽器查看一下,如圖7 :

  圖7:測試一下ruby

  2 MYsql 安裝配置

  1. #yum install mysql mysql-server 
  2. #systemctl start mysqld.service 
  3. #systemctl enable mysqld.service 
  4. # mysql -u root 

  下面設(shè)置密碼過程,如圖8:

  1. mysql>set password for root@localhost=password('password'); 
  2. Query OK, 0 rows affected (0.00 sec) 
  3. mysql> exit 
  4. #Bye 

 

 圖8:設(shè)置密碼過程

  下面安裝mysql管理工具phpmyadmin:

  1. #yum -y install phpMyAdmin php-mysql php-mcrypt 

  修改配置文件:

  1. #vi /etc/httpd/conf.d/phpMyAdmin.conf 
  2. # line 14: 添加IP 地址范圍 
  3. Allow from 127.0.0.1 10.0.2.0/24 
  4. # systemctl restart httpd.service 

  測試一下,如圖9:

  圖9:mysql管理工具phpmyadmin

  總結(jié)到此為止一個完成amp 服務(wù)配置完成 。

  3 安裝日志管理工具Visitors

  有很多開源和商業(yè)版的工具軟件可以對產(chǎn)生的Apache日志文件做分析和處理,通常的步驟是:

  • 選取一個日志文件。
  • 分析日志文件內(nèi)容。
  • 生成包含不同類別內(nèi)容的統(tǒng)計信息網(wǎng)頁輸出。

  Webalizer(http://www.mrunix.net/webalizer/)和AWStats  (http://awstats.sf.net)是較為流行的日志文件分析工具;還有一些工具可以記錄來訪者具體訪問路線,比如Vistors和Pathalizer工具,可以分別從http://www.hping.org/visitors/和http://pathalizer.bzzt.net/下載。

  下面看看Visitors的使用方法:

  1. #yum -y install graphviz 
  2. #wget http://www.hping.org/visitors/visitors-0.7.tar.gz 
  3. #tar zxvf visitors-0.7.tar.gz 
  4. #cd visitors_0.7 
  5. #make 
  6. #cp visitors /usr/local/bin/ 
  7. #cd 
  8. #mkdir /var/www/html/visitors 
  9. #vi /etc/httpd/conf.d/visitors.conf 
  10. # create new 
  11. <Location /visitors> 
  12. Order Deny,Allow 
  13. Deny from all 
  14. Allow from 10.0.0.0/24 
  15. # IP address you allow 
  16. </Location> 
  17. #systemctl restart httpd.service 
  18. #visitors -A /var/log/httpd/access_log -o html > /var/www/html/visitors/index.html 

  生產(chǎn)報告界面如圖10:

  圖10:日志管理工具Visitors

  4 dhcp服務(wù)設(shè)置簡介

  安裝軟件包:

  1. #yum -y install dhcp 

  修改配置文件:

  1. #vi /etc/dhcp/dhcpd.conf 

  添加如下配置:

  1. # specify domain name 
  2. option domain-name "cjh.net"; 
  3. # specify DNS's hostname or IP address 
  4. option domain-name-servers dlp.cjh.net; 
  5. # default lease time 
  6. default-lease-time 600; 
  7. # max lease time 
  8. max-lease-time 7200; 
  9. # this DHCP server to be declared valid 
  10. authoritative; 
  11. # specify network address and subnet mask 
  12. subnet 10.0.0.0 netmask 255.255.255.0 { 
  13. # specify the range of lease IP address 
  14. range dynamic-bootp 10.0.0.200 10.0.0.254; 
  15. # specify broadcast address 
  16. option broadcast-address 10.0.0.255; 
  17. # specify default gateway 
  18. option routers 10.0.0.1; 

  啟動服務(wù):

  1. #systemctl start dhcpd.service 
  2. #systemctl enable dhcpd.service 

  5 NFS服務(wù)設(shè)置簡介

 ?。?)服務(wù)器端設(shè)置

  安裝軟件包:

  1. #yum -y install nfs-utils 

  修改配置文件:

  1. #vi /etc/idmapd.conf 
  2. # line 5: uncomment and change to your domain name 
  3. Domain =cjh.net 

  修改文件:

  1. #vi /etc/exports 
  2. /home   # shared directory 
  3. 10.0.0.0/24   # range of networks NFS permits accesses 
  4. rw   # writable 
  5. sync   # synchronize 
  6. no_root_squash   # enable root privilege 
  7. no_all_squash    # enable users' authority 

  啟動服務(wù):

  1. #systemctl start rpcbind.service 
  2. #systemctl start nfs-server.service 
  3. #systemctl start nfs-lock.service 
  4. #systemctl start nfs-idmap.service 
  5. #systemctl enable rpcbind.service 
  6. #systemctl enable nfs-server.service 
  7. #systemctl enable nfs-lock.service 
  8. #systemctl enable nfs-idmap.service 

 ?。?)客戶端設(shè)置

  安裝軟件包:

  1. #yum -y install nfs-utils 

  修改配置文件:

  1. #vi /etc/idmapd.conf 
  2. # line 5: uncomment and change to your domain name 
  3. Domain =cjh.net 

  啟動服務(wù):

  1. #systemctl start rpcbind.service 
  2. #systemctl start nfs-server.service 
  3. #systemctl start nfs-lock.service 
  4. #systemctl start nfs-idmap.service 
  5. #systemctl enable rpcbind.service 
  6. #systemctl enable nfs-server.service 
  7. #systemctl enable nfs-lock.service 
  8. #systemctl enable nfs-mountd.service 

  掛載nfs目錄:

  1. #mount -t nfs dlp.cjh.net:/home /home 

  設(shè)置開機(jī)自動掛載:

  1. #vi /etc/fstab 
  2. /dev/mapper/VolGroup-lv_root /                       ext4    defaults  1 1 
  3. UUID=65ec32e2-f459-4d63-b8b0-e18124b50f3a /boot      ext4    defaults  1 2 
  4. /dev/mapper/VolGroup-lv_swap swap                    swap    defaults  0 0 
  5. #添加一行change home directory this server mounts to the one on NFS 
  6. dlp.cjh.net:/home /home                         nfs     defaults  0 0 

  總結(jié):Fedora 18剛剛推出一周 ,筆者先寫了一些桌面方面的內(nèi)容。本文介紹在服務(wù)設(shè)置和系統(tǒng)管理內(nèi)容,另外讀者可以看看簡單體驗Fedora 18 Beta 一文,其中有網(wǎng)絡(luò)安全和系統(tǒng)管理方面的內(nèi)容 。

【聲明】本文為51CTO原創(chuàng)稿件,轉(zhuǎn)載請注明作者和出處。

責(zé)任編輯:黃丹 來源: 51CTO
相關(guān)推薦

2010-09-16 14:36:20

2012-04-16 13:22:56

CORBAJavaC++

2011-12-29 10:13:48

FirefoxAndroid版

2012-12-12 17:18:27

Fedora 18

2013-01-17 14:38:37

Fedora 18

2010-09-17 13:47:35

2015-06-29 10:05:10

C#異步編程解析

2011-05-06 17:57:34

思維R800掃描儀

2013-01-22 11:29:01

3D打印

2012-12-04 10:08:31

Fedora 18

2012-05-18 14:07:00

Fedora 17系統(tǒng)

2011-01-14 12:25:10

LinuxFedora

2012-11-28 09:43:09

Fedora 18

2009-11-26 14:10:08

2018-07-06 14:33:16

華為

2012-09-19 09:12:06

FedoraAlpha

2011-10-27 18:06:24

思科網(wǎng)真

2010-01-12 14:45:00

Fedora jbos

2013-01-07 16:42:39

Fedora 18

2012-08-30 11:22:54

Fedora 18
點贊
收藏

51CTO技術(shù)棧公眾號