“linux”目录存档

squid Invalid URL

2009年07月31日,星期五

配置如下:

cache_peer 16.158.83.109 parent 80 0 no-query originserver name=vmcentos

cache_peer_domain vmcentos www.vmcentos.com

cache_peer_access vmcentos allow all

http_port 80

但总是出现下面的错误:

The following error was encountered while trying to retrieve the URL: /phpldapadmin/htdocs/cmd.php?cmd=login_form&server_id=0

Invalid URL

Some aspect of the requested URL is incorrect.

Some possible problems are:

  • Missing or incorrect access protocol (should be http:// or similar)
  • Missing hostname
  • Illegal double-escape in the URL-Path
  • Illegal character in hostname; underscores are not allowed.———————————————————————————————-解决方法:在http_port 80后加上defaultsite=www.vmcentos.com就可以了, 如下:

    http_port 80 defaultsite=www.vmcentos.com

RHEL5 启动停在:Starting System Message Bus…

2009年06月17日,星期三

RHEL5 启动停在:Starting System Message Bus…
这是由LDAP 引起。

由于系统进不去, 所以可以用putty, 或telnet工具进入系统, 把
/etc/ldap.conf
修改为:bind_policy soft
reboot. 就可以了

bad interpreter: No such file or directory

2009年05月21日,星期四

在运行perl脚本的时候, 明明在文件头加了#!/usr/bin/perl, 且这个路径也是对的, 可./test.pl运行之后, 还是会有

./test.pl: /usr/bin/perl^M: bad interpreter: No such file or directory 的错误

上网找到了原因, 原来是文件的编码不对, 解决方法如下(转:http://blog.csdn.net/luckqt/archive/2008/12/25/3605138.aspx):

sh脚本异常:bad interpreter: No such file or directory

Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory

分析:这是不同系统编码格式引起:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息。
解决:1)在windows下转换:
利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File–>Conversions–>DOS->UNIX即可。
2)也可在Linux中转换:
首先要确保文件有可执行权限
#sh>chmod a+x filename

然后修改文件格式
#sh>vi filename

利用如下命令查看文件格式
:set ff 或 :set fileformat

可以看到如下信息
fileformat=dos 或 fileformat=unix

利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix

:wq (存盘退出)

最后再执行文件
#sh>./filename

CentOS 5安装ssl

2009年05月12日,星期二

以root身份进入控制台,进入下面命令:

~]# yum -y install mod_ssl

~]# cd /etc/pki/tls/certs/

certs]# make server.key
certs]# openssl rsa -in server.key -out server.key
certs]# make server.csr
certs]# openssl x509 -in server.csr -out server.pem -req -signkey server.key -days 365
certs]# chmod 400 server.*

certs]# vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/server.pem ← 追加
SSLCertificateKeyFile /etc/pki/tls/certs/server.key ← 追加

成功!

更多可参照:http://www.centospub.com/make/ssl.html(该页面教程基于CentOS4.4,所以与上面步骤和命令略有不同)。

Samba服务器-windows下访问linux

2009年04月17日,星期五

在公司一直都用\\192.168.*.*来直接访问linux服务器下文件夹,但自己回家却一直没能够在windows下这样访问虚拟机上的linux系统(CentOS),今天这个问题终于解决了,原来要用到samba服务器,Samba 服务器的能够实现 Windows 网络中的文件共享。在linux系统上装上samba,合理配制, 启动samba后,就可以通过IP在windows下直接访问linux文件目录了,这样确实很方便,网上配制方法的文章很多,可以参照:http://www.centospub.com/make/samba.html