方舟笔记

方舟笔记

Nginx WordPress伪静态rewrite

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) 即可生效。

phpStudy (10)

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就可以自己上传了。

SSH FTP (0) SSH FTP (1) SSH FTP (2) SSH FTP (3)

LNMP下实现Discuz 伪静态rewrite

LNMP下实现Discuz 伪静态rewrite(LNMP一键安装包http://www.lnmp.org/)
第一步,修改conf文件,找到站点.conf文件,LNMP在/usr/local/nginx/conf/vhost下
第二步,登陆Discuz后台,全局,SEO设置,全部选中,提交,查看当前的 Rewrite 规则,复制。
第三步,将站点.conf下载到本地编辑,替换include discuz.conf;为刚才复制的Rewrite 规则
第四部,重启LNMP,登陆SSH使用如下命令:/root/lnmp restart

LNMP Discuz (0) LNMP Discuz (1) LNMP Discuz (2) LNMP Discuz (3) LNMP Discuz (4) LNMP Discuz (5)

LNMP下FTP服务器的安装和使用(PureFTPd)

LNMP下FTP服务器的安装和使用(PureFTPd)

(LNMP一键安装包http://www.lnmp.org/)

一:安装PureFTPd
cd lnmp1.0-full
./pureftpd.sh

PureFTPd (0)

 

二:按提示输入你MySQL的root密码、FTP用户管理面板的密码、MySQL的FTP数据库密码。PureFTPd (1) PureFTPd (2) PureFTPd (3)

 

三:如果使用的是MySQL 5.5,前面安装完后需要按http://lnmp.org/faq/fix-pureftpd-bug-mysql-55.html修复才可以,如果不能确定版本
执行:/usr/local/mysql/bin/mysql -V 就会显示。

PureFTPd (4)

 

四:打开http://Domain或IP/ftp/,输入FTP用户管理面板的密码,开始使用。PureFTPd (5) PureFTPd (6) PureFTPd (7)

Windows Server 2003 更改用户密码

Windows Server 2003 更改用户密码

一、Ctrl+Alt+Del回到界面就有更改密码选项。

Windows Server 2003 Change Password(1) Windows Server 2003 Change Password(2)

二、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 ""(两个紧挨着的")

Windows Server 2003 Change Password(3)

三、本地用户和组。

Windows Server 2003 Change Password(4) Windows Server 2003 Change Password(5) Windows Server 2003 Change Password(6)

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 Edit (0) WordPress Edit (1) WordPress Edit (2) WordPress Edit (3) WordPress Edit (4) WordPress Edit (5) WordPress Edit (6) WordPress Edit (7)

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

more domain

WordPress自动添加关键词和描述的方法

WordPress自动添加关键词和描述seo

 登录自己的网站后台,然后点击编辑按钮,点击header.php文件,在<head>与</head>之间任意地方(一般加到<title></title>下面)加上如下代码:

<?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; ?> "/ >