说明:
之前写过一篇《基于虚拟用户的 vsftpd 服务配置》,最终并没有采用这种方式使用FTP功能,原因为:
所有虚拟用户在实际操作文件时都会转化为同一个本地用户,如果其中一个虚拟FTP用户出现安全问题(比如上传一个php的phpspy文件管理器),所有的网站就都不安全了,因为在服务器上网站文件都属于同一个本地用户,可能是 www、apache、nobody、或自定义的用户。
最终使用了基本本地用户的VSFTPD,文件权限各自独立。
安装步...
分类为 Linux 的文章:
第一步:安装 httpd-itk,rpm下载地址
yum -Uvh httpd-itk-2.2.23-1.w5.i386.rpm
第二步:编辑“/etc/sysconfig/httpd”增加:
HTTPD=/usr/sbin/httpd.itk
第三步:编辑“/etc/httpd/conf.d/php.conf”增加:
<IfModule itk.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
第四步:添加用户
useradd-s /bin/nologin -m -d /var/www/WebSite/upall_cn -g webusers upall_cn
第五步:修改目录...
添加GPG-KEY:
# rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
在 /etc/yum.repos.d/CentOS-Base.repo 末尾添加以下内容:
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
更新PHP:
yum -y update php
<完>
可以修改/etc/issue、/etc/motd这两个文件。在终端(tty1-tty6)登陆后会显示指定字串。
“/etc/issue”中可以使用的“变量”:
\d 本地端时间的日期;
\l 显示第几个终端机介面;
\m 显示硬体的等级 (i386/i486/i586/i686…);
\n 显示主机的网路名称;
\o 显示 domain name;
\r 作业系统的版本 (相当于 uname -r)
\t 显示本地端时间的时间;
\s 作业系统的名称;
\v 作业系统的版本。
如果你想在使用者进去的时候显...
命令:
[root@localhost ~]# yum install setuptool ntsysv system-config-network
解释:
setuptool 貌似是setup工具本身,安装后自带了一个Authentication configuration。
ntsysv 管理服务的
system-config-network 安装网络配置
mod_bandwidth : Configuration
Global configuration directives :
BandWidthDataDirSyntax : BandWidthDataDir <directory>
Default : “/tmp/apachebw”
Context : server config
Sets the name of the root directory used by mod_bandwidth to store its internal temporary information. Don’t forget to create the needed directories : <directory>/master and <directory>/lin...
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update up...
代码:
$vi ~/.vimrc
let &termencoding=&encoding
set fileencodings=utf-8,gbk
$:wq
编辑 ~/.bashrc 添加以下代码:
export LC_TIME=”zh_CN.UTF-8″ #使用中国人的方式显示日期
alias date=’date -d today +”%Y年 %m月 %d日 %A %H:%M:%S %Z”‘ #格式化date命令的格式
说明:
logwatch 邮件中 httpd 部分的显示通常会是下边的样子,但是服务器上有N多个网站、网站的目录名称相同的也很多,将其对应到相应的网站上将会耗费大量时间。
Requests with error response codes
400 Bad Request
/: 5 Time(s)
/100117/small/2012051116812204yGwm.jpg: 1 Time(s)
/customer/uploadfile/1324/1324_201203251308211pYHL.JPG: 1 Time(s)
/customer/uploadfile/1324...
#!/bin/bash
# 说明:站点添加工具[独立代码、数据库]
# 日期:2012-03-31 22:31:21 [6]
# 用法: x dn.ext
# 补充:mpm-itk、vsftpd、mysql
# 需要手动删除mysql数据库、vsftpd用户
# buildhttpdpwd buildmysqlpwd 用于根据域名计算密码
# 作者:/
# 显示帮助
if [ -z "$1" ]; then
echo " Usage: `basename $0` domainName comment"
exit
fi
cd /root/bin/
# 变量配...
在目录中查找文本
grep -rni "text string" /path/to/directory
# -r 在子目录中执行递归搜索
# -n 显示包含该模式的行号
# -i 忽略文本字符串的大小写
统计某个文件夹中指定类型的文件的总体大小
find . -name "*.png" | xargs du -ck # KB
find . -name "*.png" | xargs du -cm # MB
让假 ASCII 字符的文件名现出原形
export LC_ALL=C
ls -al
# 例:
# a:а c:с d:ԁ e:е
# ...