SSH安装之WordPress(集成主题及常用插件)

环境:CentOS 5.5+LNMP,集成主题:Elegant Box 4.1.1;插件:all-in-one-seo-pack,auto-highslide,baidu-sitemap-generator,fckeditor-for-wordpress-plugin,google-sitemap-generator,nktagcloud,no-self-ping,pjw-mime-config,simple-tags,wordpress-23-related-posts-plugin,wp-codebox,wp-pagenavi,wp-postviews,wptouch,wp-useragent,wumii-related-posts。

wget http://www.yishanhome.com/wp-content/uploads/2011/03/wordpress.sh;sh wordpress.sh

wordpress.sh代码如下

?Download wordpress.sh
#!/bin/bash
array=(http://cn.wordpress.org/wordpress-3.1-zh_CN.zip)
length=${#array[@]}
usage()
{
clear
printf "
#This is a Shell-Based tool
# Author: yishan
# Website: http://www.yishanhome.com
"
if [ $length -gt "1" ] ; then
for ((i=0; i<$length; i++))
do
let "m = $i + 1"
echo "$m. ${array[$i]}"
done
echo ""
option=0
read -p "Please input your option:" option
let "option = $option + 0"
  if [ "$option" -eq "0" ] || [ "$option" -gt "$length" ] ; then
    usage
  fi
  else
option=1
fi
}
 
 
check_source()
{
  echo "checking $1"
  httpvalue=`wget -nv --spider $1 2>&1|sed q|awk '{print $1}'`
  if [ -z $httpvalue ]; then
    echo "OK!"
  else
    echo "NOT accessible, please check"
    exit
  fi
}
 
input_domain()
{
  read -p "Please input domain:" domain
  if [ "$domain" = "" ]; then
  input_domain
  fi
}
www_dir=/home
usage
let "option = $option - 1"
down_url=${array[$option]}
down_file=$(echo $down_url | awk -F\/ '{print $NF}')
sitecode=$(echo $down_file | awk -F\. '{print $1}')
check_source $down_url
mkdir $HOME/$sitecode
mkdir $www_dir/$sitecode
mkdir /usr/local/nginx/conf/vhost
input_domain
wget $down_url
 
if echo $down_file|grep -q .zip;then
unzip $down_file -d $HOME/$sitecode
fi
 
if echo $down_file|grep -q .tar.gz;then
tar -zxvf $down_file -C $HOME/$sitecode
fi
 
mv $HOME/$sitecode/wordpress/* $www_dir/$sitectode/
chmod 777 $www_dir/$sitecode
chmod 777 $www_dir/$sitecode/wp-content -R
cat > /usr/local/nginx/conf/vhost/$domain.conf <<EOF
server
        {
                listen       80;
                server_name $domain;
                index index.html index.htm index.php default.html default.htm default.php;
                root  $www_dir/$sitecode;
                include wordpress.conf;
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }
 
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }
 
                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }
 
                access_log off;
        }
EOF
 
/usr/local/nginx/sbin/nginx -s reload
 
array=(all-in-one-seo-pack.zip auto-highslide.zip baidu-sitemap-generator.zip fckeditor-for-wordpress-plugin.zip google-sitemap-generator.zip nktagcloud.zip no-self-ping.zip pjw-mime-config.zip simple-tags.zip wordpress-23-related-posts-plugin.zip wp-codebox.zip wp-pagenavi.zip wp-postviews.zip wptouch.zip wp-useragent.zip wumii-related-posts.zip)
length=${#array[@]}
for ((i=0; i<$length; i++))
do
plugin_url=http://downloads.wordpress.org/plugin/${array[$i]}
wget $plugin_url
unzip ${array[$i]} -d $www_dir/$sitecode/wp-content/plugins
echo "${array[$i]} OK"
done
 
theme_url=http://lnmpsh.googlecode.com/files/elegant-box.zip
wget $theme_url
theme_file=$(echo $theme_url | awk -F\/ '{print $NF}')
unzip $theme_file -d $www_dir/$sitecode/wp-content/themes

执行完以上之后,进入http://你的域名,进行数据库安装,详细步骤跟着页面的提示下一步就可以了。
主题、插件默认是未启用的,请在后台控制面板【外观-主题】【插件】启用。如图

最后前台效果

  1. 2011年3月14日17:07

    插件不要经常更新,不然后台会进不去的

    Internet Explorer 8.0 Windows 7
  2. 2011年3月14日18:29

    尽量在同一个主机上搭建两个一样的Wordpress,可以预防这种情况,当然,测试的那个,不要让蜘蛛发现。

    Firefox 4.0 Windows Server 2003
  3. 2011年3月20日14:18

    这样装挺好的 我是空间 改天在虚拟机上试试

    Firefox 3.6.15 Windows XP

返回顶部