wordpress的helloworld (一)

xz9995XZZ
需要用wordpress3.5
3.8的样式不好使,
cp wp-config-sample.php wp-config.php
修改数据库连接
创建数据库

create database haowordpress;
grant all on *.* to root@'%' identified by "mima" WITH GRANT OPTION;
flush privileges;


建了个站http://haoning.net/
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc mysql mysql-server mysql-devel

http://cn.wordpress.org/
使用wordpress
wget http://cn.wordpress.org/wordpress-3.3.1-zh_CN.zip
配置nginx php,fastcgi,指向解压目录
nginx配置为

root@li408-34:/home/ubuntu/www# cat /usr/local/openresty/nginx/nginx/conf/nginx.conf
user www-data;
#user nobody;
worker_processes 4;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_types text/css text/xml text/plain application/x-javascript application/xml application/pdf application/rtf application/x-perl application/x-tcl application/msword application/vnd.ms-excel application/vnd.ms-powerpoint application/vnd.wap.xhtml+xml image/x-ms-bmp;
# gzip_disable "MSIE [1-6] \.";
gzip_vary on;
output_buffers 4 32k;
client_max_body_size 20m;
server {
listen 80;
server_name localhost;
charset utf-8,gb2312;
access_log /home/ubuntu/log/access.log;
location / {
root /home/ubuntu/www/wordpress;
index index.html index.htm index.php;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "/";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1;
set $path_info $2;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
root /home/ubuntu/www/wordpress;
access_log off;
expires 30d;
}
location ~ .*\.(js|css|ico)?$ {
root /home/ubuntu/www/wordpress;
access_log off;
expires 1h;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/ubuntu/www/wordpress;
}
fastcgi_param SCRIPT_FILENAME /home/ubuntu/www/wordpress/$real_script_name;
fastcgi_param script_name $real_script_name;
fastcgi_param path_info $path_info;
include /usr/local/openresty/nginx/nginx/conf/fastcgi_params;
}
}
root@li408-34:/home/ubuntu/www#

ubuntu 下mysql设置外部访问:
 mysql -uroot -p
grant all on *.* to root@'%' identified by "mima" WITH GRANT OPTION;
flush privileges;
vim /etc/mysql/my.cnf
bind-address = 127.0.0.1
改成ip地址
重启mysql:/etc/init.d/mysql restart

参考http://hi.baidu.com/parad1se/blog/item/fad2dbfb3e70e16d024f56e0.html

然后看wordpress/readme.html
配置就行了

wordpress的数据表自动建好了
[img]http://dl.iteye.com/upload/attachment/0065/3974/8af73738-442d-3d4e-8b89-6a332d256344.png[/img]

好使的nginx.conf

user haoning;
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen 80;
server_name 203.195.183.79;
access_log /home/haoning/log/access.log;
location / {
root /home/haoning/www;
index index.html index.htm index.php;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "/";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/haoning/www;
}
fastcgi_param SCRIPT_FILENAME /home/haoning/www/$real_script_name;
fastcgi_param script_name $real_script_name;
fastcgi_param path_info $path_info;
include /usr/local/nginx_wordpress/conf/fastcgi_params;
}
}

2014.4.8
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值