Tips

  1. vsftpd

ftpd的话,以下是一些文件的位置约定:
/usr/sbin/vsftpd ---- VSFTPD的主程序
/etc/rc.d/init.d/vsftpd ---- 启动脚本
/etc/vsftpd/vsftpd.conf ---- 主配置文件
/etc/pam.d/vsftpd ---- PAM认证文件
/etc/vsftpd.ftpusers ---- 禁止使用VSFTPD的用户列表文件
/etc/vsftpd.user_list ---- 禁止或允许使用VSFTPD的用户列表文件
/var/ftp ---- 匿名用户主目录
/var/ftp/pub ---- 匿名用户的下载目录
mount --bind [目录A] [目录B]
这样就把目录A挂载到目录B下面了

 

修改hostname

vi /etc/sysconfig/network

修改HOSTNAME一行为"HOSTNAME=主机名"(没有这行?那就添加这一行吧),
然后运行命令" hostname 主机名

 

添加path

/etc/profile 文件最后添加
PATH=/usr/mynewpath:$PATH
export PATH
重新登录一下

 

 

tomcat

/usr/share/tomcat5

 

VNCSERVER

[root@localhost sysconfig]# rpm -qa |grep vnc
vnc-server-4.1.2-14.el5
vnc-4.1.2-14.el5

[root@localhost ]# vncserver

 

VNC缺省使用twm窗口管理器。如果用户想用KDE桌面环境,编辑$HOME/.vnc/xstartup文件,注:
掉除unset SESSION_MANAGER和exec /etc/X11/xinit/xinitrc以外所有的行。在这个文件的末
尾添加一行:
startkde &

vi /etc/sysconfig/vncserver
就两句:
VNCSERVERS="1:root"
ARGS="-geometry 800x600 -alwaysshared"

 

linker

gcc中链接(linker) 时 -lvirt  寻找的是libvirt.so  .so动态库

而linux下用g++编译代码,在连接一个c的静态库(.a)的时候,总是提示: undefined reference to`错误,找不到库函数。这是因为用g++编译c的库函数,c++的命名机制已经将调用的库函数改名称了,所以必须在c库函数前加上 extern “C”。
可以在每个函数声明处加extern void ***();也可以在包含库文件处加:
extern "C"
{
#include "xxx.h"
}

cdt配置linker

UNP配置

./configure
生成新的config.h

进入各个lib*目录 make

生成的libunp.a为静态库

 

HTTPD解决中文乱码

http.conf配置文件更改:

defaultcharset off

页面head里添加:
<META content="text/html; charset=gb2312" http-equiv="Content-Type"/>

 

 

PHP安装

tar zxvf php.tar.gz -C /usr/php5;
cd /usr/php5
./configure
make
make install

httpd配置文件:/etc/httpd/conf/
任意位置添加:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

更改
DirectoryIndex index.php index.html index.html.var index.htm
(添加了 index.php)

开启PHP错误报告:(/etc/php.ini)

display_errors = On

.php文件权限:
chmod 755 *.*

posted on 2010-07-31 13:42  yangyh  阅读(294)  评论(0)    收藏  举报