(Debian的vhcs再次配置,原来发的地方找不着了,之前放在了www.qooq.net上了。今天做个统一备份放在了http://hi.xoao.com 上。统一转到wp上来,以做以后查阅之用)

其实安装基本系统到是比较容易的,反而安装服务软件比较头痛,不知道选 Apache 2 好还是 Apache 1 好,不知道选 MySQL 4.1 好还是 MySQL 4.0 好,总之反正我自己不懂,出错就重来,所以好在基本系统容易装。

都反复装了 N 次基本系统了。

  1. 安装服务软件

    apt-get install postfix postfix-tls proftpd-mysql courier-authdaemon courier-base courier-imap courier-maildrop courier-pop libberkeleydb-perl libc-dev libcrypt-blowfish-perl libcrypt-cbc-perl libcrypt-passwdmd5-perl libdate-calc-perl libdate-manip-perl libdbd-mysql-perl libdbi-perl libio-stringy-perl libmail-sendmail-perl libmailtools-perl libmd5-perl libmime-perl libnet-dns-perl libnet-netmask-perl libnet-perl libnet-smtp-server-perl libperl5.8 libsnmp-session-perl libterm-readkey-perl libtimedate-perl perl perl-base perl-modules bind9 diff iptables libmcrypt4 mysql-client-4.1 mysql-common-4.1 mysql-server-4.1 patch php4 php4-mcrypt php4-mysql php4-pear procmail libterm-readpassword-perl libsasl2-modules libsasl2 sasl2-bin apache2 apache2-common apache2-mpm-prefork libapache2-mod-php4 gawk libgd1g make gcc

    • 配置 Courier 时选 No
    • 配置 Postfix 时选 Internet Site, Mail 处输入 root,在 sync updates 处选 No
    • 配置 MySQL 选择 Standalone

    其实不知道哪里错了,每次都会装个 apache 1,因为决定使用 apache 2,所以

    apt-get --purge remove apache-common

  2. 配置 MySQL 和 Apache2
    • 加入密码

      mysql -u root -p
      use mysql
      update user set password=password("新的密码") where user="root";
      flush privileges;
      \q

    • 修改 MySQL 配置文件

      vi /etc/mysql/my.cnf

      查找 skip-external-locking, 在下面添加一行:

      max_connections = 2000

    • 修改 Apache 配置文件

      vi /etc/apache2/apache2.conf

      查找 MaxKeepAliveRequests ,将其改成

      MaxKeepAliveRequests 1000

      下方添加:

      ServerLimit 5000

      稍下方可以看到:

      <IfModule prefork.c>
      StartServers 5
      MinSpareServers 5
      MaxSpareServers 10
      MaxClients 20
      MaxRequestsPerChild 0
      </IfModule>

      修改如下(maxclients的大小请根据你的服务器性能来定,主要取决于ram的大小,一般512M可以改为300,
      1G改为 700, 2G改为 1200):

      <IfModule prefork.c>
      StartServers 10
      MinSpareServers 10
      MaxSpareServers 15
      MaxClients 1000
      MaxRequestsPerChild 50000

      </IfModule>

如果你是第一次来这儿,欢迎订阅 feedsky RSS feed。 第一时间看到更多精彩内容,谢谢你的访问!
原文地址:http://my.xoao.com/debian-vhcs-2
转载请注明出处,非常感谢!
admin on 10月 9th, 2007 | File Under Linux使用 | -