Archive for February, 2009

Apache之userdir

Apache有个userdir的模块

http://httpd.apache.org/docs/2.2/howto/public_html.html

以前没用过,想用一下,可是就是很403,日志也是简单的
Permission denied: access to /~username denied

后来在另一台用yum安装的服务器上找到答案。
# The path to the end user account ‘public_html’ directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a “403 Forbidden” message.

具体操作过程就是 
#chmod -R 711 /home/*
#cd /home/username/
#chmod 755 -R public_html

一切正常了。

No Comments

Linux技巧

Q:如何禁用 gnome 的 最近的文档
A:
$rm .recently-used.xbel
$mkdir .recently-used.xbel

Q:安装gd-2.0.35出错
gd-2.0.35]# make
cd . && /bin/sh /root/gd-2.0.35/config/missing –run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV’ not found in library
cd . && /bin/sh /root/gd-2.0.35/config/missing –run automake-1.9 –foreign
cd . && /bin/sh /root/gd-2.0.35/config/missing –run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] Error 1
A: yum install -y fontconfig && yum install -y gettext-devel

No Comments

RHEL5.3支持NTFS读写

Red Hat Enterprise Linux Server release 5.3 (Tikanga)
sudo mount /dev/sda6 /mnt/wine
mount: unknown filesystem type ‘ntfs’
默认是不支持NTFS格式的,可以通过安装ntfsmount来支持NTFS读写

第一步安装 Fuse
wget http://nchc.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.4.tar.gz
tar xvzf fuse-2.7.4.tar.gz
cd fuse-2.7.4
./configure && make && sudo make install

第二步安装ntfsprogs

http://jaist.dl.sourceforge.net/sourceforge/linux-ntfs/ntfsprogs-2.0.0.tar.bz2

tar jxvf ntfsprogs-2.0.0.tar.bz2
cd ntfsprogs-2.0.0
./configure –enable-fuse-module && make && sudo make install

第三步先加载fuse模块
sudo modprobe fuse
否则会出现下列错误
fuse: device not found, try ‘modprobe fuse’ first
fuse_mount failed.
Unmounting /dev/sda6 ()

第四步挂载
sudo ntfsmount /dev/sda6 /mnt/wine/

ok了,现在可以使用NTFS分区了。

6 Comments

XFS修复实战

昨天突然断电,倒置一块1T的硬盘分区表损坏
幸亏一个分区,重建分区表 fdisk /dev/sdc
重建后依然无法挂载(文件系统为xfs)。

尝试xfs_repair,经历了漫长的时间,修复完成。
mount 提示 Structure needs cleaning
xfs_repair -L /dev/sdc1 重新写入log

再次mount,成功挂载。
修复的数据存在于lost+found里面。
但是有大部分数据丢失。知识所限
不知是硬盘故障还是技术问题,如果有朋友有好的解决方案,请赐教。

No Comments

昨天把系统换到Redhat Linux Server 5.3(x86_64)

用了好久的Ubuntu做桌面,感觉渐渐熟悉了。想换换口味,虽然服务器一直用CentOS
但是桌面因为这样那样的问题没怎么用redhat系列的东西。
刚好RHEL5.3刚刚发布,从http://rhn.redhat.com注册了一个帐号。
下载了一个DVD,现在一张cd光盘不行了。不知道Centos5.3可不可以。

网络安装的,很快就完成了。
下面记录一些过程: Read the rest of this entry »

No Comments

读书计划之笔记2

今天下午把看完了

后面这一块提及到优化、负载均衡、安全方面的东西。
因为大多都从网上看到过,或者做过实验的的。

有一点,不要过早的“优化”,当然了,不是说代码的简洁化了
通过整体的测试,找出瓶颈。再进行整体优化。

No Comments

关于阅读技术类图书的思考(转)

今天在 cu上看到一封信,一个新程序员写给老程序员的信:
内容如下:
尊敬的程杰老师:您好!
首先请允许我这么称呼你,虽然你是高级软件工程师,但我觉得叫你高级软件工程师老师更能表达我对你所写的《大话设计模式》一书无比的喜爱和对你本人无比的敬佩! Read the rest of this entry »

No Comments

读书计划之笔记1

Building Scalable Web Sites

1、To get started designing and building your first large-scale web application, you’ll need four things.
a. An idea
b. Find some people to build it
c. The most important thing you need is a method of discussing and recording the development process
d. With pens and Wiki in hand, we can start to design our application architecture and then start implementing our world-changing application. Read the rest of this entry »

No Comments

读书计划之book list

好久没认真读过几本书了,最近越来越发现知识很匮乏。
就有了今天的读书计划:
读书列表:
1. <Building Scalable Web Sites> By Cal Henderson
2. <iptables-tutorial> By Oskar Andreasson
3. <建筑的永恒之道>(美)C.亚历山大 (The Timeless Way of Building)
4. <High.Performance.MySQL.Second.Edition>
5. To Add

No Comments

网易开源软件镜象站点

网易上线了一个开源镜象网站,域名是 http://mirrors.163.com/。目前提供了Debian、Ubuntu、Fedora、Gentoo、Centos、FreeBSD等流行开源操作系统以及Eclipse等开源软件的镜象。

速度还不错,呵呵,以后又多了个速度源。添加到/etc/apt/sources.list
######### 163.com
deb http://mirrors.163.com/ubuntu intrepid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu intrepid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu intrepid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu intrepid-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu intrepid-proposed main restricted universe multiverse

apt-get update 更新一下,速度还行。赞一个!

PS:服务器
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 05 Feb 2009 06:49:43 GMT

No Comments