:::
20-2 CentOS 7
- 先取得私有IP,可以用pietty連線
sudo ifconfig -a - 修改 ssh 設定,讓 root 也可以遠端 ssh 登入(nano是編輯器,也可以用vi,但目前的vi很難用)
sudo nano /etc/ssh/sshd_config - 修改其中的 PermitRootLogin 為 yes(記得拿掉註解)
PermitRootLogin yes PasswordAuthentication yes - 重啟SSH服務
sudo service sshd restart - 自動化腳本官網:https://github.com/systex-admin/XOOPS
- 自動化下載安裝LAMP環境
cd /root yum install -y unzip wget wget --no-check-certificate https://github.com/systex-admin/XOOPS/archive/master.zip -O lamp-xoops.zip unzip -o lamp-xoops.zip rm -f lamp-xoops.zip cd XOOPS-master/ chmod +x *.sh - 接著執行自動化腳本,並依序回答問題,就可以安裝好 Apache+PHP+MariaDB
./lamp.sh - 若是要將原本學校舊站搬移到私有雲,那麼,請不要安裝 XOOPS
- 若是想在私有雲直接建立新站,才需要安裝XOOPS
./xoops.sh - 網頁目錄位置在
/var/www/html - 關閉MySQL嚴格模式
sudo nano /etc/my.cnf內容為:
# # This group is read both both by the client and the server # use it for options that affect everything # [client-server] # # include *.cnf from the config directory # !includedir /etc/my.cnf.d [mysqld] sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" -
最後重啟 MySQL資料庫,使設定生效
sudo service mysql restart - 忘記記住資料庫密碼,可看一下
/root/mysql_password.txtcat /root/mysql_password.txt - 編輯設定檔,以關閉 selinux
sudo vi /etc/sysconfig/selinux - 找到 SELINUX 然後修改為disabled
SELINUX=disabled - 要重新開機 reboot / restart 後才會套用
20-1 關於校網搬移