关键字Meta Keywords 的重要性已经不像以前那么重要了,但是设置正确的 Keywords 还是对你的排名有利,本文通过在blogger/Blogspot 添加labels/Tags
作为Meta Keywords
,我已经成功在这个博客部署好了,现在访问首页和帖子页面,你都可以看到类似<meta name="keywords" content="" />
,下面是详细步骤:
(2013-7-28)给blogger博客自定义关键字-Meta Keywords
(2013-3-4)使用nginx反向代理blogger博客配置
概述
本文详细描述了如何在Centos下安装nginx反向代理blogger博客,这样就可以从国内访问blogger平台的博客
ningx安装
环境配置
yum install -y \
gcc gcc-c++ glibc glibc-devel glib2 glib2-devel unzip make automake autoconf \
ncurses ncurses-devel libjpeg libjpeg-devel libpng libpng-devel \
freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel bzip2 \
bzip2-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel \
libidn libidn-devel openssl openssl-devel openldap openldap-devel \
nss_ldap openldap-clients openldap-servers xinetd sudo \
pcre pcre-devel subversion
(2010-7-29)使用nginx搭建一个URL转发系统
目的: 看到很多朋友使用类似http://blog.lihaixin.name/go/jd 进行网址跳转,wordpress有相应的插件,而我使用blogger作为我的博客系统,使用nginx反向代理从国内访问,那么我可以使用nginx 反向代理goo.gl短网址。
goo.gl设置:
在URL输入你的需要短网址的全网址,系统会自动为你生成一个短地址
nginx重定向:
location /go/ {
proxy_pass http://goo.gl/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_intercept_errors on;
}
如果goo.gl过滤你的网址(很少一部分这个转发系统以为你的网址是病毒欺诈的内容)可以通过下面的具体指向
location = /go/jd {
rewrite ^ http://click.union.jd.com/JdClick/?unionId=1298&t=1&to=http://www.jd.com/ permanent;
}
这样配置后,就可以使用你自己的域名
http://blog.lihaixin.name/go/MD52z访问我的博客 http://blog.lihaixin.name/go/jd 访问我的京东联盟网站
(2009-10-15)使用yum命令安装nginx
通过YUM安装
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum -y install nginx
chkconfig --level 235 nginx on
/etc/init.d/nginx start
升级 参考此文章:http://user.qzone.qq.com/46163020/blog/1258342422
(2008-12-12)在Nginx的配置WordPress的重定向设置
WordPress是一个非常流行的Blog系统,它可以利用Apache的mod_rewrite来实现URL的静态化。安装好的WordPress在配置了持久链接之后,会在网站的根目录下(如果可写)生成一个.htaccess文件,这个文件可以指示Apache如何进行URL重写(如果服务器配置为允许使用htaccess的指令的话),它的内容如下:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
这个文件的意思就是,如果当请求的文件不存在,那么把请求内部重定向到/index.php。WordPress会自己分析请求的URL,来判断显示哪个页面。
在上次配置了Nginx+PHP之后,由于Nginx不支持Apache的.htaccess文件,要实现持久连接静态化,我们必须手工配置Nginx的文件。首先找到Nginx的配置文件,默认编译后的配置文件在/usr/local/webserver/nginx/conf/nginx.conf
;centos通过包安装的配置文件位于/etc/nginx/nginx.conf
,
以下是基本的配置
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
location ~ .*\.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
此配置考虑了目录下的索引文件index.html和index.php。-f指令表示测试文件是否存在(不考虑文件和目录的区别),!-f则表示不存在。注意在重写url到index.html后面有个break,而重写到index.php后没有break。因为html文件不需要任何额外工作可以直接发送到客户端,所以重写规则在这里终止,下面就直接让nginx发送文件。而.php文件需要进一步发送到fastcgi进程来运行,Nginx会继续判断该文件符合第二个部分location ~ .*.php$的规则,并进行FastCGI的转发。
(2008-11-7)nginx出现 500 Internal Server Error
刚才测试了一下nginx并发链接数,在同时在线人数为 2000的时候,不能访问网页,出现500 Internal Server Error,查看了一下日志/var/log/nginx/error.log
[root@lxadmin nginx]# tail -n 30 error.log
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
2008/11/06 21:19:46 [alert] 1110#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80
看来是模拟的并发数太多了,需要调整一下nginx.conf的并发设置数,(我的配置主机的内存 128M,CPU为1G,)
vi /etc/nginx/nginx.conf
events {
worker_connections 1024;
}
调整为
events {
worker_connections 10240;
}
还是会出现上面问题,使用
[root@lxadmin nginx]# cat /proc/sys/fs/file-max
8192
文件系统最大可打开文件数
[root@lxadmin nginx]# ulimit -n
1024
程序限制只能打开1024个文件
使用[root@lxadmin nginx]# ulimit -n 8192调整一下
或者永久调整打开文件数 可在启动文件/etc/rc.d/rc.local末尾添加(在/etc/sysctl.conf末尾添加fs.file-max=xxx无效)
ulimit -n 8192
(2008-11-6)在centos5下安装nginx+fastcgi php+mysql
概述:
Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。
Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客、新浪播客、网易新闻等门户网站频道,六间房、56.com等视频分享网站,Discuz!官方论坛、水木社区等知名论坛,豆瓣、YUPOO相册、海内SNS、迅雷在线等新兴Web 2.0网站。
安装:
1、下载nginx rpm包 且安装
wget ftp://194.199.20.114/linux/EPEL/5/i386/nginx-0.6.32-1.el5.i386.rpm
rpm -Uvh nginx-0.6.32-1.el5.i386.rpm
chkconfig nginx on
/etc/init.d/nginx start
然后访问本机的80端口,就可以看到页面了,这表示安装一切正常。 修改/etc/nginx/nginx.conf文件中的server_name部分,修改IP地址为本机IP地址:
server_name 192.168.0.104;
修改/etc/nginx/nginx.conf文件的index部分,加入index.php
index index.php index.html index.htm;
2、安装php
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum -y install lighttpd-fastcgi lighttpd php-cli php-mysql
cd /usr/share/nginx/html/
echo "< ?phpinfo();?>" >phpinfo.php
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u nginx -f /usr/bin/php-cgi
重新配置nginx.conf,增加如下内容
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
3、重启nginx
/etc/init.d/nginx stop
/etc/init.d/nginx start
4、安装数据库
yum -y install mysql-server
chkconfig mysqld on
/etc/init.d/mysqld start
5、把php cgi程序开机自启动
在/etc/rc.d/rc.local文件后添加下面语句
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u nginx -f /usr/bin/php-cgi