Nginx WordPress伪静态rewrite
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite ^ /index.php last;
}
将上述代码插入:
(1)/usr/local/nginx/conf/vhosts.conf (普通)
(2)/usr/local/nginx/conf/vhost/domain.conf (LNMP http://lnmp.org/)
server {…} 中,
重启 nginx(/etc/init.d/nginx restart) 即可生效。
作者: 方舟笔记
SSH用FTP将服务器上的文件上传到其他服务器
SSH用FTP将服务器上的文件上传到其他服务器 一:检查Linux系统是32位还是64位 getconf LONG_BIT 二:安装FTP客户端 yum install ftp rpm -Uvh http://mirror.centos.org/centos/6/os/i386/Packages/ftp-0.17-54.el6.i686.rpm rpm -Uvh http://mirror.centos.org/centos/6/os/x86_64/Packages/ftp-0.17-54.el6.x86_64.rpm ftp /*启用FTP客户端 open zhangfangzhou.cn /*打开远程服务器 user /*输入用户名 Password: /*输入密码 put FileZilla_3.7.4_win32-setup.exe /public_html/ark.net.cn/Software/FTP/FileZilla_3.7.4_win32-setup.exe /put是上传命令,第 一个FileZilla_3.7.4_win32-setup.exe是本地文件名,第二个是远程文件名。意思就是把本地的FileZilla_3.7.4_win32-setup.exe上传到远 程FTP里,并且命名为FileZilla_3.7.4_win32-setup.exe,这样SSH就可以自己上传了。
LNMP下实现Discuz 伪静态rewrite
LNMP下FTP服务器的安装和使用(PureFTPd)
Windows Server 2003 更改用户密码
Windows Server 2003 更改用户密码
一、Ctrl+Alt+Del回到界面就有更改密码选项。
二、CMD 命令方式 net user 用户名 密码 net user administrator 0(0是密码) net user admin /add (添加用户admin) net user admin 123456 (admin密码设置为123456) net localgroup administrators admin /add (把admin添加到管理员组中) net user admin /delete (删除admin) 如果要修改密码为空,net user administrator ""(两个紧挨着的")
三、本地用户和组。
LNMP下WordPress无法编辑主题文件
WordPress无法编辑主题文件
LNMP(LNMP一键安装包http://www.lnmp.org/) 原因:PHP屏蔽函数scandir导致。 PHP禁止浏览目录造成,需要修改PHP的配置文件php.ini。 解决:PHP配置文件php.ini中找到scandir并删除(disable_functions=中的) 位置 /usr/local/php/etc/php.ini disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl ,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server 改为: disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl ,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server 重启LNMP,输入命令:/root/lnmp restart 即可,单独重启mysql:/etc/init.d/mysql restart
WordPress绑定多个域名
将多个域名绑定到同一个站点上,通过多个域名访问。
1、先将多个域名,解析到同一个目录下。
2、打开WordPress目录下的wp-config.php文件,然后将require_once(ABSPATH . 'wp-settings.php'),改成如下的样式:
$current_sitename= $_SERVER['HTTP_HOST'];
if ($current_sitename == "wp.huleiyang.cn") {
define("WP_SITEURL", "http://wp.huleiyang.cn");
define("WP_HOME", "http://wp.huleiyang.cn");
} elseif ($current_sitename == "dz.huleiyang.cn") {
define("WP_SITEURL", "http://dz.huleiyang.cn");
define("WP_HOME", "http://dz.huleiyang.cn");
}
require_once(ABSPATH . 'wp-settings.php');
3、修改后,后台将不可更改,WordPress地址(URL)、站点地址(URL)。
4、我喜欢的固定连接方式,/%postname%.html
WordPress自动添加关键词和描述的方法
WordPress自动添加关键词和描述
<?php
if ( is_home ())
{
$description = "www.zhangfangzhou.cn,Discuz,WordPress,PHP,Red Hat,CentOS,Linux,Windows server 2008,Cisco,H3C,Network Engineering ";
$keywords = "Discuz,WordPress,PHP,Red Hat,CentOS,Linux,Windows server 2008,Cisco,H3C,Network Engineering ";
}
else if ( is_single ())
{
if ( $post->post_excerpt)
{
$description = $post->post_excerpt;
} else {
$description = mb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)
),0,220);
}
$keywords = "";
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag ) {
$keywords = $keywords.$tag->name.","; }
} else if ( is_category()) {
$description = category_description();
}
?>
<meta name = "keywords" content="<?php echo $keywords; ?>" />
<meta name= "description" content="<?php echo $description; ?> "/ >

































