Category: Web

WordPress instration on SakuraVPS

 

さくらVPSでWordPressをインストールし、テーマやプラグインなどをWebからインストールしようとするとFTP情報を求められる。その回避法。
 
① wp-config.php に下記を追加
——————————————
define('FS_METHOD', 'direct');
——————————————
 
② wp-content/upgrade を作成
# mkdir wp-content/upgrade
 
③パーミッションを書き込み可に変更
# chmod 0707 wp-content/upgrade
 
③同様に wp-content/themes と wp-content/plugins にも書き込み許可を
# chmod 0707 wp-content/themes
# chmod 0707 wp-content/plugins
 
④メディアなどブラウザからアップロード可能に
# chmod 0707 wp-content/

BuddyPress Instration

SakuraVPSにWordPressをインストールしプラグインのBuddyPressをインストールしたときメモ

①ダウンロード
# wget http://ja.wordpress.org/wordpress-3.2.1-ja.zip
 
②解凍
# unzip wordpress-3.2.1-ja.zip
 
③移動
# mv wordpress /var/www/html
 
④DB接続ファイル内容編集
# cp -pr /www/var/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
# vi wp-config.php
 
⑤ブラウザからアクセスしインストール
 
⑥プラグイン新規登録からBuddyPressをインストール
※ここでVPSではFTP情報を聞かれる場合がある。下記を追加する。
#vi wp-config.php
———————————————
define('FS_METHOD', 'direct');
———————————————
 
⑦ディレクトリの作成と権限変更
# mkdir wp-content/upgrade
# chmod 0707 wp-content/upgrade
# chmod 0707 wp-content/themes
# chmod 0707 wp-content/plugins
 
⑧ブラウザからインストールしたが・・・

Basic認証

httpd.conf編

 ①httpd.confに下記を追加
# vi /etc/httpd/conf/httpd.conf
——————————————————–
<Directory "/var/www/html">
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthName "Please enter your name and password."
Require valid-user
</Directory>
——————————————————–
 
Apacheを再起動
# /sbin/service httpd restart
 

.htaccess編

①アクセス制限をかけたいディレクトリに.htaccessファイルを作成
——————————————————–
AuthType Basic
AuthName "Input your ID and Password."
AuthUserFile /var/www/html/.htpasswd
require valid-user
——————————————————–
 
②.htpasswdファイルを作成
# /usr/bin/htpasswd -c /var/www/html/.htpasswd {username}
New password:
Re-type new password:
 
③.htpasswdが作成されベーシック認証がかかる

※httpd.conf で  ”AllowOverride All” と許可されていないと動作しない