決定是否開啟 FollowSymLinks

  1. 在目錄設定選項 FollowSymLinks,可以讓目錄下的連結檔作用。例如:http://dywang.csie.cyut.edu.tw/centos6 是提供 DYW Linux 安裝環境,為節省檔案存放空間,initrd.img 使用連結檔。
    [root@dywang html]# ll centos6/images/pxeboot/
    total 3712
    lrwxrwxrwx. 1 root root      25 Aug 28  2012 initrd.img -> ../../isolinux/initrd.img
    -rw-r--r--. 1 root root     265 May 13  2010 README
    -r--r--r--. 1 root root     441 Aug 18  2012 TRANS.TBL
    -rwxr-xr-x. 1 root root 3791040 Nov 22  2011 vmlinuz
    
  2. httpd.conf 沒有將 centos6 目錄加上 FollowSymLinks 選項。
    [root@dywang html]# grep -A4 /var/www/html/centos6 /etc/httpd/conf/httpd.conf 
    <Directory "/var/www/html/centos6">
        Options Indexes
        Order allow,deny
        Allow from all
    </Directory>
    
  3. 使用 http://dywang.csie.cyut.edu.tw/centos6 進行網路安裝時,出現以下錯誤訊息,原因為 initrd.img 無法讀取。
    Starting install...
    Retrieving file .treeinfo...                             |  728 B     00:00 ... 
    Retrieving file vmlinuz...                               | 7.2 MB     00:05 ... 
    ERROR    'NoneType' object is not iterable
    Domain installation does not appear to have been
     successful.  If it was, you can restart your domain
     by running 'virsh start kvmusb'; otherwise, please
     restart your installation.
    
  4. httpd.conf 將 centos6 目錄加上 FollowSymLinks 選項
    [root@dywang html]# grep -A4 /var/www/html/centos6 /etc/httpd/conf/httpd.conf 
    <Directory "/var/www/html/centos6">
        Options Indexes FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
  5. 重新載入 httpd.conf 設定後,網路安裝就正常了。
    [root@dywang html]# /etc/init.d/httpd reload
    Reloading httpd: