4.27.2012

WordPress (1)

27th Apr 2012

UbuntuにWordPressをインストールした時のメモ。

cd dev
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
rm latest.tar.gz
ls wordpress/
sudo ln -s /home/sotaro/dev/wordpress /var/www/wp
sudo chmod 777 wordpress

mysql> create database wordpress;
mysql> CREATE USER 'wp'@'localhost' IDENTIFIED BY 'wordpress'
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wp'@'localhost';

http://localhost/wp からログイン、DBに関する情報を入力して終了。

と思いきや、、、
テーマの追加を試み、FTPが必要であることが判明。
で、FTP。

sudo apt-get install proftpd
(xinetd or standaloneで xinetd を選ぶ)


ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.
vi /etc/init.d/proftpd

といことで、/etc/init.d/proftpdを見ると

 49   if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \
 50      egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \
 51      egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null 

そういえば、sshdもあげてないし、xinetdが無いのか!ってことで

sudo apt-get install xinetd
sudo vi /etc/xinetd.d/ftp
cat /etc/xinetd.d/ftp
service ftp
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/proftpd
}
sudo /etc/init.d/xinetd restart

アカウントは

sudo useradd -g www-data -M wordpress
sudo passwd wordpress

で用意し、再度テーマの追加に挑む。が、permissionで色々怒られ

sudo chown -R wordpress:www-data *
sudo find . -type d -exec chmod 775 {} \;
sudo find . -type f -exec chmod 666 {} \;

でようやく完了。

※追記
apacheの設定に下記を追加


  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all

0 件のコメント:

コメントを投稿