紅帽提供了一個很穩定的PAAS服務平台:openshift!此部落格即作為wordpress建在裡面。 這裡記錄怎樣更新與備份wordpress。
預備: 安裝 openshift command line tool rhc:
$gem install rhc
複制
$rhc setup
複制
$rhc apps 得到應用名稱=>$APPS
複制
更新wordpress:
$mkdir ~/website
複制
$rhc git-clone $APPS
複制
下載下傳wordpress安裝包,比如wordpress-3.9.zip。
$unzip wordpress-3.9.zip
複制
$cd ~/website/$APPS/
複制
$mv $APPS/ bk
複制
$cp wordpress $APPS/
複制
$cp bk/wp-config.php $APPS/
複制
$rm -rfv bk
複制
$git add .
複制
$git commit -m "update to new wordpress3.9."
複制
成功後顯示範樣例如以下資訊:
remote: Stopping MySQL 5.1 cartridge
remote: Stopping PHP 5.3 cartridge (Apache+mod_php)
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping PHPMyAdmin cartridge
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Building git ref ‘master’, commit 8f52203
remote: The deplist.txt file was deprecated in favor of .openshift/pear.txt.
remote: Please consider running `git mv deplist.txt .openshift/pear.txt’ command.
remote: Checking deplist.txt for PEAR dependency…
remote: Preparing build for deployment
remote: Deployment id is 3528d784
remote: Activating deployment
remote: Starting MySQL 5.1 cartridge
remote: Starting PHPMyAdmin cartridge 。。。。。。。
備份wordpress(包含資料庫和上傳檔案):
$rhc snapshot save -a $APPS
複制
恢複wordpress:
$rhc snapshot restore $APPS
複制
釋出者:全棧程式員棧長,轉載請注明出處:https://javaforall.cn/119088.html原文連結:https://javaforall.cn