最小化安装centos 5

关闭selinux

vi /etc/selinux/config

添加

SELINUX=disabled

下载安装脚本

  1. 根据提示进网页操作
  2. https://IP:2087
    1. 最小化安装系统,装了cpanel及相关服务 httpd mysqld 等等...
    2. [email protected] [~]# rpm -qa|awk 'END{print NR}'

总共几个步骤,确认directadmin的”磁盘使用情况”保持正常

1) 检查/etc/cron.d/directadmin_cron
文件是否包含
10 0 * * * root echo ‘action=tally&value=all’ >> /usr/local/directadmin/data/task.queue

2) /usr/sbin/repquota /home
如果没有分出/home这个分区的,就应该是/usr/sbin/repquota /

3) 重新检查磁盘配额
/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;

4) 检查/etc/fstab的/home或者/ 是否有usrquota,grpquota

5) 如果repquota返回的值不完整,运行
echo “action=tally&value=all” >> /usr/local/directadmin/data/task.queue

6) 确认 quota_partition=/ 或者quota_partition=/home
在directadmin.conf里

cd /usr/local/directadmin
./directadmin c | grep quota_partition

7) 检查/home目录下的tmp文件夹已存在,没有的话就创建它
ls -lad /home/tmp
chmod 1777 /home/tmp

8) /usr/local/directadmin/dataskq d2000

至此,directadmin的磁盘配额恢复正常.

directadmin重新编译的方法

cd /usr/local/directadmin
mv custombuild custombuild.old
wget http://files.directadmin.com/services/custombuild/1.1/cu
stombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
./build suphp
./build all d #这个过程比较久
./build rewrite_confs
 
*************************************
*                                   *
*   All parts have been installed   *
*                                   *
*************************************
 
Type: /sbin/service httpd restart
 
 
更改配置文件 /usr/local/directadmin/custombuild/options.conf
把
php5_cli=yes
php5_cgi=no
改成
php5_cli=no
php5_cgi=yes
 
更改配置文件 /usr/local/suphp/etc/suphp.conf
把日志的level改为info
;Loglevel
;loglevel=warn
loglevel=error
 
 
然后重启apache
测试phpinfo页面下
Server API     CGI/FastCGI 
就是成功了。
 
这样在top里就能找出哪个虚拟主机用户跑高apache的cpu或内存了!
 
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                         
30855 xxx    17   0 25236  10m 4464 S 52.5  0.3   0:00.31 /usr/local/php5/bin/php-cgi
 
suPhp日志 /var/log/suphp.log
 
Note: 如果发生Internal Server Error (http500) 大多数为文件宿主不正确
则继续运行
./build roundcube
./build squirrelmail
./build phpmyadmin
参考官方的帮助 http://help.directadmin.com/item.php?id=197

Webmin和Virtualmin是著名的主机管理面板, 可以用来管理多个WEB网站。网站和网站之间不能越界管理到对方的文件,有利于网站独立。如果是多人合租VPS服务器,使用面板来控制就比较好。

查看在Debian上面的安装方法:

deb http://mirrors.163.com/debian stable main contrib main non-free
deb-src http://mirrors.163.com/debian stable main contrib main non-free
 
apt-get update
apt-get install perl -y
apt-get install libnet-ssleay-perl openssl libauthen-pam-perl 
libio-pty-perl libmd5-perl -y
wget -c http://prdownloads.sourceforge.net/webadmin/usermin_1.400_all.deb
 
dpkg -i usermin_1.40_all.deb
wget -c http://software.virtualmin.com/gpl/scripts/install.sh
chmod +x install.sh
./install.sh
 
 The systems currently supported by install.sh are:
 CentOS 4 and 5 on i386 and x86_64
 Debian 4.0 and 5.0 on i386 and amd64
 Ubuntu 8.04 LTS on i386 and amd64
 
  If your OS is not listed above, this script will fail.  More details
 about the systems supported by the script can be found here:
 
Continue? (y/n)  Y
 
Please enter a fully qualified hostname (for example, example.com): debian.com 
#输入您的域名安装开始.. 
#-------------------------------------------------------------------------
INFO - Removing Debian standard Webmin package, 
if they exist (because they're broken)...
INFO - Removing Debian apache packages...
INFO - Installing dependencies using command: /usr/bin/apt-get 
--config-file apt.conf.noninteractive -y --force-yes install 
postfix postfix-pcre webmin usermin ruby libapache2-mod-ruby 
libxml-simple-perl libcrypt-ssleay-perl unzip zip postfix-tls
...in progress, please wait...
 
这里提示需要等待,可能需要花费15分钟以上
#-------------------------------------------------------------------------
 
INFO - /usr/bin/apt-get --config-file apt.conf.noninteractive -y --force-yes
 install virtualmin-base
...in progress, please wait...
Extracting templates from packages: 100%
Extracting templates from packages: 100%

#------------------------------------------------------------------------

这里也会花费很长时间.

加入 extension=mysql.so 使php5支持mysql
还有安装GD库 ( 虚拟主机必不可少的 )

debian:~# vi /etc/php5/apache2/php.ini
debian:~# apt-get install php5-gd -y