2020年10月8日 星期四

CentOS8建置PXE server(網路開機安裝)

   因為公司主管需要我研究這個東西所以就寫了一份很詳細的教學文件,但我是覺得,如果非必要用實機的話還是用虛擬機去做大量部署會來的好,虛擬機做一台10秒,實機裝一台30分鐘,光這樣比就不用比了,不過是拿來測試倒是也可以用用看。


  

  • 安裝套件dnsmasqCentOS8預設已有安裝

    yum install dnsmasq

  • 備 份原dnsmasq設定檔,建立新的設定檔

    mv -v /etc/dnsmasq.conf /etc/dnsmasq.conf.bak

    v i /etc/dnsmasq.cof

  • 輸入以下設定

    interface=ens192 #PXE server網卡代號

    bind-interfaces

    domain=linuxhint.local #主機名

    dhcp-range=ens192,192.168.199.100,192.168.199.240,255.255.255.0,8h #DHCP ip範圍

    dhcp-option=option:router,192.168.199.254 #gateway ip

    dhcp-option=option:dns-server,168.95.1.1 #dns server

    dhcp-option=option:dns-server,8.8.8.8 #dns server

    enable-tftp #啟用tftp server

    tftp-root=/netboot/tftp #指定tftp路徑

    dhcp-boot=pxelinux.0,192.168.199.26 #指定client端要連的PXE server

    pxe-prompt="Press F8 for PXE Network boot.",5

    pxe-service=x86PC,"Install OS via PXE",pxelinux



  • 建立PXE server必要目錄

    mkdir -pv netboottftp/pxelinux.cfg



  • 啟動dnsmasq服務

    service dnsmasq start



  • 確 認服務狀態

    service dnsmasq status



  • 安裝PXE相關套件

    yum install syslinux





  • 複製pxe開機必要檔案到tftp路徑資料夾

    cp -v /usr/share/syslinux/{pxelinux.0,menu.c32,ldlinux.c32,libutil.c32} /netboot/tftp/



  • 安裝Apache server

    yum install httpd



  • 建立apache目錄捷徑到/netboot資料夾

    ln -s /var/www/html /netboot/www



  • 啟動Apache服務

    service httpd start



  • 掛載欲安裝的iso檔,掛載為Centos8.2;利用firezilla上傳Centos8.2 ISO檔,上傳後掛載

    mount -o loop CentOS8.2.2004-x86_64-dvd1.iso /mnt





  • 建立存放Centos的安裝檔目錄

    mkdir -v /netboot/{tftp,www}/centos8



  • 複製掛載的安裝檔到剛建立的資料夾

    rsync -avz /mnt/ /netboot/www/centos8



  • 複製initrd.imgvmlinuz2個檔案到/netboot/tftp/centos8資料夾

    cp -v /netboot/www/centos8/images/pxeboot/{initrd.img,vmlinuz}

    /netboot/tftp/centos8/



  • 可以把之前掛載的資料夾卸載及刪除檔案

  • 建立pxe server設定檔

    vi /netboot/tftp/pxelinux.cfg/default

    輸入以下內容

default menu.c32

label install_centos8

menu label ^Install CentOS 8

menu default

kernel centos8/vmlinuz

append initrd=centos8/initrd.img ip=dhcp inst.repo=http://192.168.15.1/centos8/


  • 關閉防火牆

    service firewalld stop


  • 驗證pxe server








參考網址:https://linuxhint.com/pxe_network_boot_centos8/



by Johnny

2020年3月12日 星期四

安裝office365後如何安裝visio



  通常在安裝office365後是沒有附visio,通常都是另外安裝單機版visio,除非企業或家裡有另訂閱visio方案,要另外安裝單機visio時會不讓你安裝

  具體做法是下載微軟官方出的部署工具
http://www.microsoft.com/en-us/download/details.aspx?id=36778

  下載完後執行程式完會產生四個檔案configuration-Office365-x64、configuration-Office365-x86、configuration-Office2019Enterprise、setup
  但其實前三個檔案是設定檔,也只需要一個只是預設會幫你寫好部署的設定,如你要從office365裝visio就用365的設定檔
   要安裝visio2016的方式如下:
修改configuration-Office2019Enterprise的設定檔

<Configuration>

  <Add OfficeClientEdition="64" Channel="PerpetualVL2016">
    <Product ID="VisioProRetail">
      <Language ID="zh-tw" />
    </Product>
  </Add>

開啟命令提示字元執行
setup /configure configuration-Office2019Enterprise.xml
當然你的路徑要在可以執行setup的地方
如你這4個檔案放在c槽底下,當你開啟命令提示字元時你的路徑會在C:\Users\底下
所以你要切換路徑cd c:/然後執行上面的指令
之後會自動幫你安裝2016之後你只要把序號輸入就可以了
如果要裝2019visio要用一樣的方式先裝2016後再輸入2019序號會要你升級



                                                                                                                                           by Johnny