Archive for linux

centos nfs4

http://www-theorie.physik.unizh.ch/~dpotter/howto/kerberos#nfsv4

http://www-theorie.physik.unizh.ch/~dpotter/howto/certificates

这个配置比较简单

http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html

先收集一些资料,实现之后将相关资料汉化

现在国内做Nfsv4的人还是比较少。

评论

centos软件安装

  1. rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
  2. vi /etc/yum.repos.d/utterramblings.repo
  3. [utterramblings]
  4. name=Jason's Utter Ramblings Repo
  5. baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
  6. enabled=1
  7. gpgcheck=1
  8. gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
  9.  
  10. yum install php php-mysql mysql-server php-gd php-mbstring php-pear php-pear-MDB2 php-pear-MDB2-Driver-mysql php-pecl-Fileinfo php-soap postgres ImageMagick ImageMagick-devel cachefilesd
  11.  
  12. chkconfig --level 2345 iptables off
  13. chkconfig --level 2345 ip6tables off
  14.  
  15. pecl install memcache
  16.  
  17. libevent以及memcache默认安装
  18.  
  19. vi /etc/ld.so.conf.d/memcache.conf
  20. /usr/local/lib
  21. ldconfig
  22.  
  23.  memcached -u apache -d -m 64 -l 127.0.0.1 -p 11211
  24.  
  25. 编辑/etc/php.d/memcache.ini
  26. 将Session设置用Memcache保存
  27.  
  28.  
  29. 编辑
  30. /etc/cachefilesd.conf
  31. 缓存目录位置
  32.  
  33. /etc/sysctl.conf
  34. net.ipv4.conf.default.arp_ignore = 1
  35. net.ipv4.conf.default.arp_announce = 2
  36. net.ipv4.conf.all.arp_ignore = 1
  37. net.ipv4.conf.all.arp_announce = 2
  38.  
  39.  
  40. chkconfig --level 2345 httpd on
  41. chkconfig --level 2345 cachefilesd on

评论 (1)

redhat as使用centos源

通过 http://mirror-status.centos.org 网站查找离自己最近的镜像站点,替换下面文件中的相应地址:

1.修改 /etc/yum.repos.d/rhel-debuginfo.repo 为如下内容:

  1. [base]
  2. name=Red Hat Enterprise Linux $releasever -Base
  3. baseurl=http://mirror.be10.com/centos/5.0/os/$basearch/
  4. gpgcheck=1
  5. [update]
  6. name=Red Hat Enterprise Linux $releasever -Updates
  7. baseurl=http://mirror.be10.com/centos/5.0/updates/$basearch/
  8. gpgcheck=1
  9. [extras]
  10. name=Red Hat Enterprise Linux $releasever -Extras
  11. baseurl=http://mirror.be10.com/centos/5.0/extras/$basearch/
  12. gpgcheck=1
  13. [addons]
  14. name=Red Hat Enterprise Linux $releasever -Addons
  15. baseurl=http://mirror.be10.com/centos/5.0/addons/$basearch/
  16. gpgcheck=1

2.下载并导入KEY

cd /etc/pki/rpm-gpg
wget http://mirror.be10.com/centos/RPM-GPG-KEY-CentOS-5
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*

评论

NFS資料

设定最佳的NFSD的COPY数目。

linux中的NFSD的COPY数目是在/etc/rc.d/init.d/nfs这个启动文件中设置的,默认是8个NFSD,对于这个参数的设置一般是要根据可能的CLIENT数目来进行设定的,和WSIZE、RSIZE一样也是要通过测试来找到最近的数值。 Read the rest of this entry »

评论

uschedule 實現每秒執行cron

FreeBSD安裝很簡單,只要進入

/usr/ports/sysutils/uschedule/

make install clean

就完成了相關的安裝

配置

uscheduleconf /etc/schedule-root root root

添加執行的命令行

uschedulecmd -i dosomething ~/bin/dosomething

這樣寫是執行~/bin/dosomething命令,還需要配置運行間隔

uschedule –late 1 dosomething ’*-*-* 08:00:00’

這樣寫是每天八點的時候,每一秒運行一次dosomething ,而dosomething 在上面配置的。

如果需要一直運行的話,只要這樣寫就行了

uschedule –late 1 dosomething ’*-*-* *:*:*’

命令配置好,之後就是啟動相關的進程

uscheduled &

還有停止某進程之類的,麻煩自己看一下幫助,很簡單的。

评论 (1)

Apache+Tomcat虚拟主机配置

评论

以秒运行Crontab

在Liux或BSD下,Crontab可以实现以秒运行程序的。

格式如下:

1 minute 1
1,5 minutes 1 and 5
* any minute
*/5 any minute that is divisible by 5

1:2 second 2 of minute 1
1:2,5:10 second 2 of minute 1 and second 10 of minute 5
*:3 second 3 of any minute
*:*/5 any second that is divisible by 5

只是设置分钟那里跟平时的不大一样,其他部分一样。

评论 (4)

[转]以最少的Web服务器达到最大的性能──“互联星空播客”今日上线

  引用
  新浪科技讯 2007年5月17日,新浪与中国电信联合召开新闻发布会,正式宣布双方在播客业务上结为全面合作伙伴关系,新浪播客将以联合品牌“新浪-互联星空播客”的全新形象跟网民见面。今后,网民不仅将体验到速度更流畅、内容更丰富的播客平台,而且无论在新浪网,还是互联星空网站都可使用播客的全部服务。
  http://tech.sina.com.cn/i/2007-05-17/10091512192.shtml
Read the rest of this entry »

评论

Secure Apache TRACE Vulnerabilities

  1. telnet www.example.com 80

After the response

  1. Trying 12.34.56.78...
  2.  Connected to www.example.com.
  3.  Escape character is '^]'.

enter these commands:

  1. TRACE /index.html HTTP/1.1
  2.  Host: www.example.com
  3.  [CR]
  4.  [CR] = Carriage Return, for a blank line to signify the end of the headers being sent

If your server is “vulnerable” you will get a response back similar to this one (status 200):

  1. HTTP/1.1 200 OK
  2.  Date: Sat, 17 Dec 2005 23:51:29 GMT
  3.  Server: Apache/1.3.33 Sun Cobalt (Unix) mod_ssl/2.8.22 OpenSSL/0.9.6 PHP/4.3.10 mod_auth_pam_external/0.1 mod_perl/1.29
  4.  Connection: close
  5.  Transfer-Encoding: chunked
  6.  Content-Type: message/http
  7.  30
  8.  TRACE /index.html HTTP/1.1
  9.  Host: www.example.com
  10.  0
  11.  Connection closed by foreign host.

This is “bad” because an attacker could get cookie or other information returned by using a carefully crafted request.

To protect your server, you must login as root and add this block of code to every VirtualHost container in /etc/httpd/conf/httpd.conf and /etc/httpd/conf/vhosts/site[1-n]:

  1. # Block TRACE/TRACK XSS vector
  2.  RewriteEngine On
  3.  RewriteCond %{REQUEST_METHOD} ^TRAC(E|K)
  4.  RewriteRule .* - [F]

Then restart Apache

  1. /etc/rc.d/init.d/httpd reload

Once you do that, you can perform the same test and the reply will look different:

  1. HTTP/1.1 403 Forbidden
  2.  Date: Sat, 17 Dec 2005 00:01:06 GMT
  3.  Server: Apache/1.3.33 Sun Cobalt (Unix) mod_ssl/2.8.22 OpenSSL/0.9.6 PHP/4.3.10 mod_auth_pam_external/0.1 mod_perl/1.29
  4.  Last-Modified: Fri, 11 Feb 2005 05:30:57 GMT
  5.  ETag: "601d904-4dd-420c4311"
  6.  Accept-Ranges: bytes
  7.  Content-Length: 1245
  8.  Content-Type: text/html
  9.  
  10.  ... HTML content snipped ...

评论

svn安装

在网上找了很多资料,大部分的SVN都需要跟Apache结合使用。基于对Linux不是太熟悉,不敢重装Apache,只好想其他办法来解决这问题。其实,与Apache结合用户权限管理起来更方便。

安装:
./configure –with-apr=apache源码目录/scrlib/apr –with-apr-util=apache源码目录/scrlib/apr-util
make
make install

使用:

开启服务:
svnserve -d –root=SVN项目保存目录

建立项目命令:
svnadmin create project_name SVN项目保存目录/project_name
建立项目之后,进入文件夹,可以看到一个conf的文件夹。进入文件夹可以看到3个文件(如果没有passwd文件,可以用vi创建),
编辑 svnserve.conf 把anon-access = read ,auth_access = write
还有password-db = passwd 的注释去掉,还有[general]的注释也要去掉。
vi passwd文件,如果是新文件,则输入:
[user]
your_name = your_password
这里设置的your_name是你的用户名,your_password是你的密码,这个是访问SVN必要的通行证。

评论