phpMyAdmin 2.11.10 安装配置错误

2011年1月18日 root 没有评论

欢迎使用 phpMyAdmin 2.11.10
Probably reason of this is that you did not create configuration file. You might want to use setup script to create one.
错误
MySQL 返回:
#1045 – Access denied for user: ‘root@localhost’ (Using password: NO)

config.sample.inc.php和libraries/config.default.php修改更细了无数遍,依然如故。
最终,发现目录名称原来必须修改为【phpmyadmin】才可以正常使用!

之前为了安全考虑,我把phpmyadmin 目录给改名了,谁想到问题出在这里,我一直修改配置文件,我的美好时光啊 :|

分类: Windows Server 标签:

Nginx 301重定向的方法 旧域名指向到新域名

2011年1月2日 root 没有评论

因为公司有个主域名(www.jinyijian.com)现在没有备案,所以把域名指向到国外的VPS上了,VPS装的是IIS,在IIS上设置了301重定向到原来备案过的域名(www.1j1kshop.com),国内的服务器我装的是LINUX,用的Nginx服务,现在想在NGINX里面设置成,无论输入www.jinyijian.com和jinyijian.com还是1j1kshop.com域名地址都直接访问www.1j1kshop.com这个域名,我用的是以下的方法是判断nginx核心变量host(老版本是http_host):

server {
server_name www.1j1kshop.com 1j1kshop.com www.jinyijian.com jinyijian.com;
if ($host != ‘www.1j1kshop.com’ ) {
rewrite ^/(.*)$ http://www.1j1kshop.com/$1 permanent;
}

经过这样设置以后就能实现无论输入这两个域名,都会直接访问www.1j1kshop.com了。

分类: Linux 标签:

linux下mysql忘记root密码的解决方法

2010年12月21日 root 没有评论

我其中有一次修改root密码,结果更改后忘了记录了,后来怎么也登录不到phpMyAdmin上,最后没办法,只能从新修改root密码。
下面是修改root密码的具体步骤。

一. MySQL密码的恢复方法之一
如果忘记了MySQL的root密码,可以用以下方法重新设置:
1. KILL掉系统里的MySQL进程;
killall -TERM mysqld
2. 用以下命令启动MySQL,以不检查权限的方式启动;
版本不一样启动的文件名可能有区别,就是用
你如果没有这个文件 /usr/local/mysql/bin/safe_mysqld –skip-grant-tables &
就使用 /usr/local/mysql/bin/mysqld_safe –skip-grant-tables &

3. 然后用空密码方式使用root用户登录 MySQL;
mysql -u root
4. 修改root用户的密码;
mysql> update mysql.user set password=PASSWORD(‘新密码’) where User=’root’;
mysql> flush privileges;
mysql> quit

分类: Linux 标签:

Windows服务器的IIS常用的命令

2010年11月26日 root 没有评论

一些常用的命令:

net stop iisadmin /y 停止IIS admin服务

net start w3svc 启动IIS web服务

net start msftpsvc 启动IIS ftp服务

net start smtpsvc 启动IIS smtp服务

net start cisvc 启动index(索引)服务

分类: Windows Server 标签:

连接上VPN还访问不了facebook, twitter,youtube?

2010年11月2日 root 没有评论

第一个原因:

DNS 缓冲。 这种情况的通常原因是因为你在未开启vpn的情况下访问了facebook这样的网站。

这个时候自然访问不上,同时却在本机留下了缓冲。

这种情况通常在几分钟之内就可以访问了。也可以尝试 在dos窗口运行 ipconfig /flushdns

该命令会刷新DNS缓冲。

第二个原因:

你的浏览器开了代理什么的。确认一下关掉代理。

第三个原因:

dns 被劫持了,即使使用国外的dns,也会被劫持。

有些机子开vpn能够访问,

有些 机子确不能。

并且 排除了代理,防火墙,本地网络的原因。

这个时候同时ping远程网站,比如facebook。

不能访问的机子通常获取了一个怪异的ip,从任何地方都ping不通的ip。

而 能访问的机子ip,在不能访问的机子上直接可以访问,也可以ping通。

这种情况我们可以去掉VPN服务器的DNS。切换另外的dns。

在windows系统中,可以在本地网络连接的属性中,

去掉默认的dns,选用国外的dns,比如google的。或者 opendns。

分类: 代理 VPN 标签:

显示本机 Linux 发行版代号 版本号 产品代号

2010年10月20日 root 没有评论
显示本机 Linux 发行版代号
lsb_release -is
显示 Linux 发行版版本号
lsb_release -rs
显示 Linux 的产品代号
lsb_release -cs
分类: Ubuntu 标签:

Linux下cp命令直接覆盖不提示参数

2010年10月15日 root 没有评论

新做了服务器,cp覆盖时,无论加什么参数-f之类的还是提示是否覆盖,这在大量cp覆盖操作的时候是不能忍受的。。。

刚开始的时候我想很多人都和我一样,直接使用这个命令

# cp -r -f  复制目录名/ 复制到新目录/

这样还会挨个提示覆盖,加了-f也是没有用的。
那么我们试试下面的命令,在cp前面加个\看看能不能使用。

# \cp -rf 复制目录名/ 复制到新目录/

是不是好了呢?

分类: Linux, Ubuntu 标签: ,

VPN是什么?vpn代理 VPN的功能 VPN的作用

2010年10月15日 root 没有评论

一、产品特点:

*使用方便:无需另外下载登录代理软件,彻底避免恶意软件对您的侵害!使用店家给您的账号和密码就可以在电脑上直接使用!

*可以玩任何美国或者欧洲的在线游戏,比如魔兽世界美服、欧服!可以跳过网络提供商对某些应用的过滤,比如某些国内不能使用的IP网络电话等!

*在网上匿名,可以隐藏你真正的IP,其他人看到的只是虚拟的IP!比如隐藏你的QQ地址!隐藏你的上网踪迹!

*不像代理服务器。一旦连上,所有的应用程序都自动使用安全加密的连接
可以跳过一些网站的屏蔽,有些网站不允许中国用户访问,或只允许美国用户访问!

*跨国网络用户——可以跳过网络监管、过滤,可以访问国外网站,就跟直接在美国上网一摸一样!

二、购买须知-买家必看:

小本经营,只为增加一个好评而设,本商品不接受中差评,有问题先联系店家。请大家多多谅解和支持!谢谢!

三、交易流程:

本商品不是自动发货商品,请购买宝贝的朋友们先拍好,然后联系店家旺旺索取卡密,然后确认收货给好评。

四、计费规则:

有效期:开通之时起24小时。

五、支持的操作系统:

●Windows XP

●Windows Vista

●Windows 7

●Mac OS: Tiger, Leopard, Snow Leopard

●iPhone

●iPad

●Windows Mobile系列,如多普达系列智能机。

六、连接错误:

1. 691错误

主要为密码错误,请检查您的ip地址,用户名及密码是否输入正确,如果都是正确的请联系卖家。

2. 619错误(注意和691错误区别)
一般是由于您的系统或者网络堵塞VPN端口造成的.
解决办法:重启机器

3. 800、678、769错误

这三个错误比较类似。当出现上述错误的时候,可能是防火墙或者路由器挡住了。 可以关闭防火墙,如果没装专业的防火墙,那么进路由器设置一下:
步骤:打开IE–输入192.168.1.1– 用户名密码都是admin–高级设置– 系统服务–穿透防火墙–PPTP通过和ipsec后面的勾上,确定。
个别路由器内容不同,原理一样,找到上面的部分,允许通过即可。

4. 如果连上VPN以后无法访问国外的XXX网站?

如果您的系统是Windows XP以及Windows 2000,这个很有可能是您的DNS设置错误造成的。请先尝试将所有本地连接 以及 ADSL拨号连接(如果有的话)的DNS设置成:
8.8.8.8
8.8.4.4
然后再运行一下ipconfig /flushdns命令清空DNS缓存

七、注意事项:

包天、包周只可用于小流量使用,不可BT等下载使用,否则账号被停,店家免责!

请合法使用,勿违法滥用,否则后果自负!

八、购买VPN:

淘宝直营店:http://shop59435645.taobao.com
百度有啊店:http://youa.baidu.com/shop/3ee82bfcf9d4cb43752b3b52

分类: 代理 VPN 标签:

编译安装ibus错误make: *** 没有指明目标并且找不到 makefile。 停止

2010年10月14日 root 没有评论

最近ibus输入法“没有输入窗口”的问题一直在困扰着我,重装了N变也不行,最后干脆把所有的输入法都删除了,然后自行编译安装,以下是安装过程。

备注:不过安装完重启后还是提示 没有输入窗口 ,后来我在要输入的地方,点击右键,发现有个输入法,输入法里面可以选择使用哪种输入法,选择以后再使用,有了,不知道前几天我在线安装的时候是不是也可以这样解决?

make

make: *** 没有指明目标并且找不到 makefile。 停止。 make: ***

刚开是出现这个,我以为是make的问题,谁知道原来不是,是我第一步编译的时候就出问题了,只是我没有仔细看,直接make了

./configure –prefix=/usr

提示错误,configure: error: Your intltool is too old. You need intltool 0.35.0 or later.
说intltool版本太低了,要求版本0.35.0以上,升级下intltool版本先。

安装intltool
sudo apt-get update –fix-missing
sudo apt-get install intltool

然后接着再安装
./configure –prefix=/usr

又提示错误 No package ‘gconf-2.0′ found
没有找到gconf-2.0,接着安装gconf-2.0

sudo apt-get install libgconf2-dev
就可以解决No package ‘gconf-2.0′ found问题了 太棒了我要继续

./configure –prefix=/usr

编译成功了,显示如下:

Build options:
Version 1.3.7
Install prefix /usr
Build shared libs yes
Build static libs no
Gtk2 immodule dir ${exec_prefix}/lib/gtk-2.0/2.10.0/immodules
Gtk3 immodule dir
Build gtk2 immodule yes
Build gtk3 immodule no (disabled, use –enable-gtk3 to enable)
Build XIM agent server yes
Build python modules yes
Build gconf modules yes
Build memconf modules no
Build introspection no
Build vala binding yes
Build document no (disabled, use –enable-gtk-doc to enable)
Enable key snooper no (disabled, use –enable-key-snooper to enable)
Snooper regexes “xchat,pidgin,empathy”

看到上面的提示,就可以继续安装了,

make
sudo make install

命令安装。
3、安装ibus-pinyin-1.3.10
1)编译前的环境准备,安装以下软件
sudo apt-get install uuid uuid-dev
sudo apt-get install libboost-all-dev
sudo apt-get install sqlite3
进入到解压后的ibus-pinyin-1.3.10源码目录
./configure –disable-db-android –enable-db-open-phrase –prefix=/usr
make
sudo make install
到此编译安装结束。

后安装配置:
“系统”->“首选项”->“启动应用程序”中添加
名称:IBus
命令:ibus-daemon –xim
注释:启动IBus输入法框架
这样就能开机自启动IBus输入法了。

分类: Linux, Ubuntu 标签:

Nginx下常用Rewrite(伪静态规则)

2010年9月29日 root 没有评论

相信现在大部分用Linux VPS的朋友都在使用这个迅速传播的Nginx,今天就整理一下最常见的PHP程序的Rewrite(伪静态规则)。

Discuz 7 伪静态 Rewrite规则:
rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page\%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;

WordPress 伪静态 Rewrite规则:
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;
}
}

PHPCMS 伪静态 Rewrite规则:
location / {
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$2&page=$3;
rewrite ^(.*)show-([0-9]+)\.html$ $1/show.php?specialid=$2;

####以下为PHPWind 伪静态化rewrite规则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;
}

ECSHOP 伪静态 Rewrite规则:
if (!-e $request_filename)
{
rewrite “^/index\.html” /index.php last;
rewrite “^/category$” /index.php last;
rewrite “^/feed-c([0-9]+)\.xml$” /feed.php?cat=$1 last;
rewrite “^/feed-b([0-9]+)\.xml$” /feed.php?brand=$1 last;
rewrite “^/feed\.xml$” /feed.php last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3 last;
rewrite “^/category-([0-9]+)-b([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2 last;
rewrite “^/category-([0-9]+)(.*)\.html$” /category.php?id=$1 last;
rewrite “^/goods-([0-9]+)(.*)\.html” /goods.php?id=$1 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$” /article_cat.php?id=$1&page=$2 last;
rewrite “^/article_cat-([0-9]+)(.*)\.html$” /article_cat.php?id=$1 last;
rewrite “^/article-([0-9]+)(.*)\.html$” /article.php?id=$1 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html” /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2&page=$3 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2 last;
rewrite “^/brand-([0-9]+)(.*)\.html” /brand.php?id=$1 last;
rewrite “^/tag-(.*)\.html” /search.php?keywords=$1 last;
rewrite “^/snatch-([0-9]+)\.html$” /snatch.php?id=$1 last;
rewrite “^/group_buy-([0-9]+)\.html$” /group_buy.php?act=view&id=$1 last;
rewrite “^/auction-([0-9]+)\.html$” /auction.php?act=view&id=$1 last;
rewrite “^/exchange-id([0-9]+)(.*)\.html$” /exchange.php?id=$1&act=view last;
rewrite “^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/exchange-([0-9]+)-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2 last;
rewrite “^/exchange-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1 last;
}

SHOPEX 伪静态 Rewrite规则:
location / {
if (!-e $request_filename) {
rewrite ^/(.+\.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last;
}
}

SaBlog 2.0 伪静态 Rewrite规则:
# 只带月份的归档
rewrite “^/date/([0-9]{6})/?([0-9]+)?/?$” /index.php?action=article&setdate=$1&page=$2 last;
# 无分类翻页
rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last;
# 分类
rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last;
rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last;
# 归档、高级搜索
rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last;
# 全部评论、标签列表、引用列表 带分页
rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last;
# tags
rewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last;
# 文章
rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last;
# RSS rewrite ^/rss/([0-9]+)?/?$ /rss.php?cid=$1 last;
rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last;
# 用户 rewrite ^/uid/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&uid=$1&page=$2 last;
rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last;
# 地图文件
rewrite sitemap.xml sitemap.php last;
# 自定义链接
rewrite ^(.*)/([0-9a-zA-Z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last;

Typecho 伪静态 Rewrite规则:
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;
}
}

以上规则都是在网上收集的,感觉那些写Rewrite规则的朋友,我还会继续收集新的伪静态,以后会不定期的进行更新。

分类: Linux 标签: ,