Jack Posted May 27 Share Posted May 27 -------------- 調整swap -------------- 安裝LNMP前,先調整swap為4GB 瀏覽記憶體 free -m Swap這一行的total為0,代表伺服器swap沒設置 Swap: 0 建立一個資料夾用於存放swap mkdir /var/swapfile 調整swap為4GB (視情況而定) dd if=/dev/zero of=/var/swapfile/file.swap bs=1024k count=4096 建立一個swap檔案 mkswap /var/swapfile/file.swap 修改swap資料夾權限 chmod 0600 /var/swapfile chmod 0600 /var/swapfile/file.swap 到fstab檔案中新增開機自動掛載設定 vi /etc/fstab 就能開機啟用這個swap 在底部加入這一行 /var/swapfile/file.swap swap swap defauls 0 0 ESC儲存並離開 :wq 啟用 swapon /var/swapfile/file.swap 重開機 reboot 確認swap是否已調整為4GB free -m Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now