FTP在线备份Mysql数据(无需登录phpmyadmin or Cpanel等)

 其实有时候是会遇到这样的困惑的,因为某些原因不便或无法登录数据库的管理后台而又需要将数据备份出来的时候,这个时候也许就会手足无措了,那么我们在不登录数据库管理后台或者其他诸如Cpanel管理平台的情况下怎么将Mysql数据备份出来呢?很简单,只需要写一个代码文件就可以搞定。

  在当前web目录下新建一个php文件(名字可以自定义,如:backupdatabase.php),添加以下内容:

   db-`date +%Y%m%d `.sql” ) ; ?>

保存之后访问该文件,即可在当前web目录下面生成一个名为:”db-当前年月日.sql”的文件,即以数据库的备份文件。

PS:需要注意的是防止数据泄漏和使文件可写,建议备份完之后删除该文件

解密DirectAdmin的Custombuild

1. What is custombuild?
Custombuild is a tool, which can install/update:

  • Apache 1.3, 2.0 or 2.2
  • AWstats
  • Autoconf
  • Automake
  • cURL
  • Dovecot
  • Exim configuration files
  • FreeType
  • GD
  • libiconv
  • libjpeg
  • libpng
  • libmcrypt
  • libmhash
  • mod_perl
  • MySQL
  • PHP (with or without suPHP) 4, 5 or 6
  • ProFTPD
  • Pure-FTPd
  • SpamAssassin
  • Webalizer
  • Zend Optimizer
  • Zlib

Update web-applications as:

  • Atmail Open webmail
  • Roundcube webmail
  • Squirrelmail webmail
  • phpMyAdmin
  • UebiMiau webmail

2. Why should I use it?
Custombuild is able to install PHP with suPHP, all versions of PHP (4,5,6), Pure-FTPd, SpamAssassin, ProFTPD, MySQL, Exim, RoundCube webmail, Atmail lite webmail, and so on. It has an options file, which allows you to use 2 copies of PHP, choose Apache 2.0 or 2.2, option to rewrite all configs if they got damaged etc. It can also show (./build versions) or update all needed software with only 1 command (./build update_versions). CustomBuild can send you email notifications about the updates too.

3. How to install custombuild?
1.1:

Code:
cd /usr/local/directadmin
wget http://files.directadmin.com/services/custombuild/1.1/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
./build

1.2 BETA:

Code:
cd /usr/local/directadmin
wget http://files.directadmin.com/services/custombuild/1.2/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
./build

When you edit options.conf file, run:

Code:
./build update_data

You need to run this command for the first time:

Code:
./build all d

4. How to use options.conf?

  • Do not set both CLI and CGI of the same PHP version to “yes”.
  • After the changes every time run “./build update_data”

5. How to see what’s set in the options.conf file?
Use “./build options” to see what’s set in the options.conf file. The output will be something like:

Quote:
Apache: 1.3.37
Dovecot: 1.0.3
MySQL: 5.0.45
PHP: 5.2.3 as CLI and 4.4.7 as CGI with mail() header patch
Run “clean” every time: yes

6. What each option does in options.conf?

PHP options:

  • default_php – this option is only used when 2 versions of PHP are installed on the system. Possible values: 4 (available only in 1.1 version of CustomBuild), 5, 6 (available from 1.2 version of CustomBuild) (default: the latest version of PHP)
  • php5_ver – select PHP5 branch. Possible values: 5.2, 5.3 (default: 5.2)
  • phpX_cli – install/update PHP as CLI (default option) using “./build php” or “./build all”. Possible values: yes/no (default: yes (for the latest version of PHP).
  • phpX_cgi – install/update PHP as CGI using “./build php” or “./build all”. Possible values: yes/no (default: no).
  • php_ini – update PHP configuration file using “./build php-ini” or “./build all”. Possible values: yes/no (default: no). This option is only available from CustomBuild 1.2.
  • php_ini_type – this option is used to set what type of php.ini file CustomBuild needs to use while executing “./build php-ini”. Possible values: dist/recommended (default: recommended). This option is only available from CustomBuild 1.2.
  • zend – install/update Zend Optimizer using “./build zend” or “./build all”. Possible values: yes/no (default: no).

MySQL options:

  • mysql – this option is used to choose the version of MySQL. Possible values: 4.1, 5.0, 5.1 (default: 5.0).
  • mysql_inst – install/update MySQL using “./build mysql” or “./build all”. Possible values: yes/no (default: no).
  • mysql_backup – backup MySQL every time with MySQL update. Possible values: yes/no (default: yes).

Apache options:

  • apache_ver – this option is used to choose the version of Apache. Install/update it using “./build apache”. Possible values: 1.3, 2.0, 2.2 (default: 2.2).

Web applications:

  • phpmyadmin – install/update phpMyAdmin using “./build phpmyadmin” or “./build all”. Possible values: yes/no (default: yes).
  • atmail – install/update Atmail Open webmail using “./build atmail” or “./build all”. Possible values: yes/no (default: no).
  • squirrelmail – install/update SquirrelMail webmail using “./build squirrelmail” or “./build all”. Possible values: yes/no (default: yes).
  • roundcube – install/update RoundCube webmail using “./build roundcube” or “./build all”. Possible values: yes/no (default: yes).
  • uebimiau – install/update UebiMiau webmail using “./build uebimiau” or “./build all”. Possible values: yes/no (default: no).

Mail options:

  • exim – install/update Exim using “./build exim” or “./build all”. Possible values: yes/no (default: no). This option is only available from CustomBuild 1.2.
  • mail-header-patch – use PHP mail() header patch whith PHP installation/update. Possible values: yes/no (default: yes). No longer available since PHP 5.3.0.
  • dovecot – install/update Dovecot using “./build dovecot” or “./build all”. Possible values: yes/no (default: yes).
  • eximconf – update exim configuration file (/etc/exim.conf) using “./build exim_conf” or “./build all”. Possible values: yes/no (default: no).

Jailed shell options:

  • jail – install/update jailed shell programs using “./build all_jail”. Possible values: yes/no (default: no).

FTP options:

  • proftpd – install/update ProFTPD using “./build proftpd” or “./build all”. Possible values: yes/no (default: yes).
  • pureftpd – install/update Pure-FTPD using “./build pureftpd” or “./build all”. Possible values: yes/no (default: no).

Statistics options:

  • awstats – install/update AWstats using “./build awstats” or “./build all”. Possible values: yes/no (default: no).
  • webalizer – install/update webalizer using “./build webalizer” or “./build all”. Possible values: yes/no (default: yes).

Crontab options:

  • cron – enable crontab for CustomBuild, use “./build cron” to set-up. Possible values: yes/no (default: no).
  • email – set email for notifications. Possible values: any email address (default: [email protected]).
  • notifications – enable email notifications about the updates. Possible values: yes/no (default: yes).
  • da_autoupdate – Update DirectAdmin automatically when update is available. Possible values: yes/no (default: yes).
  • updates – update software/applications automatically when updates are available. Possible values: yes/no (default: no).
  • webapps_updates – update (automatically) only web applications (as phpMyAdmin, RoundCube, Atmail, SquirrelMail etc.). Possible values: yes/no (default: no).

CustomBuild options:

  • custombuild – version of the CustomBuild script that you want to use. Possible values: 1.1/1.2 (default: your version).
  • autover – this option is used to download versions.txt every time with every “./build” command. Possible values: yes/no (default: no).
  • bold – turn bolded text on/off. Possible values: yes/no (default: yes).
  • clean – execute “./build clean” every time. Possible values: yes/no (default: yes).
  • cleanapache – exclude apache from “./build clean”. Possible values: yes/no (default: no). This option is only available from CustomBuild 1.2.
  • clean_old_tarballs – execute “./build clean_old_tarballs” every time. Possible values: yes/no (default: yes).
  • clean_old_webapps -execute “./build clean_old_webapps” every time. Possible values: yes/no (default: yes).
  • fileserver – this option is used to set the server to download files from. Value “1” means files.directadmin.com server and value “2” means files4.directadmin.com server (Europe). Possible values: 1/2 (default: 1). This option is only available from CustomBuild 1.2.

7. How to use suPHP?

  • Do not set chmod >755 to directories or files in them.

8. Where the suPHP log is located?

Code:
/var/log/suphp.log

9. Why do I get “500 Internal server error”?
Check your suPHP log for any errors. The most common issues are:

  • file or directory has chmod >755
  • file or directory is not owned by the user.

10. How do I include this script by default with the DirectAdmin install?
Type the following before running the setup.sh:
CustomBuild 1.1:

Code:
echo "1.1" > /root/.custombuild

CustomBuild 1.2:

Code:
echo "1.2" > /root/.custombuild

11. I’ve messed up my apache (httpd) configs, how I can restore working versions?
Type:

Code:
./build rewrite_confs

12. How to make PHP6, PHP5 or PHP4 default for 1 host if both are installed as CGI?
Add this to .htaccess for PHP4 as default:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php4 .php
</FilesMatch>

Add this to .htaccess for PHP5 as default:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php5 .php
</FilesMatch>

Add this to .htaccess for PHP6 as default:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php6 .php
</FilesMatch>

13. How to make PHP6, PHP5 or PHP4 default for 1 host if it’s installed as CLI?
Add the following code to .htaccess:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler application/x-httpd-php .php
</FilesMatch>

14. How to update everything what’s needed?
Firstly, you need to run:

Code:
./build update

To fetch the latest versions file.

Run this if you want to look what updates are available:

Code:
./build versions

Run this if you want to update everything what’s possible:

Code:
./build update_versions

15. I have installed PHP6 (or PHP5, PHP4) as CGI. How do I need configure them?
PHP4 configuration file is located here: /usr/local/etc/php4/cgi/php.ini
PHP5 configuration file is located here: /usr/local/etc/php5/cgi/php.ini
PHP6 configuration file is located here: /usr/local/etc/php6/cgi/php.ini
suPHP configuration file is located here: /usr/local/suphp/etc/suphp.conf

16. I have installed PHP6 (or PHP5, PHP4) as CGI. Where can I find the bin file?
PHP4: /usr/local/php4/bin/php
PHP5: /usr/local/php5/bin/php-cgi
PHP6: /usr/local/php6/bin/php-cgi

17. I have installed both PHP5 and PHP6 (or PHP4) as CGI, but I see a CLI version in /usr/local/bin/php. Why?
CLI version of PHP is needed for DirectAdmin. It must exist as CLI for the DirectAdmin skins.

18. When I restart apache I get this error: Invalid command ‘suPHP_UserGroup’. How can I solve it?
Probably you had compiled suPHP manually with –with-setid-mode=owner. You need to compile it again with –with-setid-mode=paranoid, or do:

Code:
cd /usr/local/directadmin/custombuild
./build update
./build clean
./build suphp

19. I have installed PHP6 (or PHP5, PHP4) as CGI, but I can not use IP/~user now. Why?
http://help.directadmin.com/item.php?id=176

20. I have installed PHP as CGI and I get the “Invalid command ‘php_admin_flag’, perhaps misspelled or defined by a module not included in the server configuration error now. What do I need to do?
You have an old copy of DirectAdmin templates that only work with PHP as CLI. You need to update your copy of DirectAdmin and execute this command:

Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

21. How to fix “gcc: /usr/lib/mysql/libmysqlclient.so: No such file or directory“?

Code:
cp /usr/lib/libmysqlclient.* /usr/lib/mysql/

For 64-bit OS:

Code:
cp /usr/lib/libmysqlclient.* /usr/lib64/mysql/

22. I have installed PHP as CGI and I get some errors when trying to use the webmail. Why?
You get them because some folders/files are owned by apache, and they need to be owned by the user. Use this to fix the problem:
Squirrelmail:

Code:
chown -R webapps:webapps /var/www/html/squirrelmail

Uebimiau (/webmail):

Code:
chown -R webapps:webapps /var/www/html/webmail

Roundcube:

Code:
chown -R webapps:webapps /var/www/html/roundcube

23. Is it possible to use custom configuration files for PHP, Apache, SuPHP?
Yes it is, CustomBuild checks for “custom” directory in /usr/local/directadmin/custombuild. So, just use:

Code:
cd /usr/local/directadmin/custombuild
cp -Rp configure custom

It will create custom directory for you, and now you can just edit configuration files from the custom directory. If you want – you can have only 1 custom configuration file, all the others will be used from “configure” directory then (and will be updated with “./build update”).

24. I made a script that installs apache modules automatically, but I need to include their settings into the httpd.conf file. Is there an easy way to do that?
CustomBuild creates ability to include modules settings easily into the apache configuration file. You just need to create a file in /etc/httpd/conf/extra (or the other directory) and include it in /etc/httpd/conf/extra/httpd-includes.conf. It will automatically load your settings and CustomBuild won’t rewrite the file with “./build rewrite_confs”. If you need a custom PHP or Apache configuration file – just upload it to custom directory. E.g. if you have /usr/local/directadmin/custombuild/custom/ap2/configure.php5 file it will use it instead of /usr/local/directadmin/custombuild/configure/ap2/configure.php5.

25. How to fix “configure: error: Size of “void *” is less than size of “long”“?
You do not have /usr/local/lib in /etc/ld.so.conf file. Use the following commands to fix the problem:

Code:
touch /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

26. Is it possible to see what configuration files CustomBuild is using at the moment?
Yes, it is. CustomBuild has a new feature now:

Code:
./build used_configs

It will show something like:

Quote:
Apache configuration file: /usr/local/directadmin/custombuild/configure/ap2/configure.apache
PHP4 configuration file: /usr/local/directadmin/custombuild/custom/suphp/configure.php4
PHP5 configuration file: /usr/local/directadmin/custombuild/custom/ap2/configure.php5
ProFTPD configuration file: /usr/local/directadmin/custombuild/configure/proftpd/configure.proftpd

It will detect files from “custom” folder too.

27. I can not start apache because of “Invalid command ‘suPHP_Engine’, perhaps misspelled or defined by a module not included in the server configuration” error. What is wrong?
You have suPHP compiled in “owner” instead of “paranoid” mode. Use the following command to fix the problem:

Code:
./build suphp

28. Is it possible to change an option without editing options.conf file?
Yes, it is. Just run:

Code:
./build set option_name value

29. Is it possible to make PHP more secure using the CustomBuild script?
Yes, it is. You need to run “./build secure_php”. At the moment it disables some dangerous PHP functions as:

Code:
exec, system, passthru, shell_exec, escapeshellarg, escapeshellcmd, proc_close, proc_open, dl, popen, show_source

If you have any requests for the FAQ – feel free to post them into this thread.

重置DirectAdmin安装的Mysql的Root密码,并运行Mysql_secure_installation

DirectAdmin默认会安装WEB环境,装完的MYSQL没有给我们root密码,没法直接运行mysql_secure_installation。怎么办呢?

以下就是解决办法:

1.获得directadmin的mysql管理员密码。

路径是/usr/local/directadmin/conf/mysql.conf

2.利用mysql已经创建的MYSQL管理员账户重置ROOT密码。

mysql -u da_admin -p

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpass’);

3.运行mysql_secure-installation

会提示输入root密码,输入你刚刚重置的密码即可。

PS:转载请注明出处,谢谢!

Debian/Ubuntu更换网卡换IP完美解决方案

第一步:修改网卡信息

 

修改文件/etc/udev/rules.d/z25_persistent-net.rules 文件,原来为:

protime-linux:/etc/udev/rules.d# cat z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:15:3a:48″, NAME=”eth0″
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:15:3a:52″, NAME=”eth1″
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:af:1c:c7″, NAME=”eth2″

修改后:

protime-linux:/etc/udev/rules.d# cat z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:15:3a:48″, NAME=”eth2″
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:15:3a:52″, NAME=”eth1″
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM==”net”, DRIVERS==”?*”, ATTRS{address}==”00:0c:29:af:1c:c7″, NAME=”eth0″

保存重启后可以看到原来的网络配置又回来了。
第二部:修改IP
debian的IP地址信息的文件是保存在/etc/network/interfaces,直接编辑该文件就可以。

#可以看到文件中的设置为动态IP的语句
iface eth0 inet dhcp

当然也可以设置为静态IP地址,如:

在 /etc/network/interfaces 中,删除 iface eth0 inet dhcp,添加一下内容

iface eth0 inet static
address 172.17.10.40
netmask 255.255.0.0
broadcast 172.17.0.255
network 172.17.0.0
gateway 172.17.10.100

重启网络
#/etc/init.d/networking restart

 

IE8去除增强安全配置

很多朋友反映 IE8的设置很郁闷,尤其是增强安全配置!!
现在咱们就一起快速让IE随心所欲:
第一步:打开您的服务器管理器:
a. 如果您已经打开了windows 7 的theme 效果,按照如下方法打开服务器管理器:
b. 如果您没有打开theme效果那么请按照下图所示打开服务器管理器:
开始–管理工具—服务器管理器
第二步:关闭IE安全配置项:
点击服务器,如下图
找到配置IE ESC 点击它,如下图
在配置IE ESC向导中选择禁用,如下图
这样您在重新打开IE就可以随心所欲的上网冲浪了.
———————————————华丽的分割线——————————————————
看到很多朋友说找不到位置,
这里补充两张图,
第一张:系统版本(这里跟系统版本的关系不大)
第二张:确切位置图示

本文出自 “宋杨-活动目录、虚拟化..” 博客,请务必保留此出处http://angerfire.blog.51cto.com/198455/197694

防止服务器网卡被禁用

  防止网卡被意外禁用,这个对大家可能没有多大的用途,但如果你有服务器托管在外面,那可就有用了,如果你那天不小心点到了“禁用”,呵呵,那后果我就不用说了吧,你的服务器马上就跟你说拜拜了,而且必须进入机房去重新启用网卡才可以(我就碰到了这样的倒霉事啊)。
  闲话不多说,下面说重点:
  实现的方法,用组策略来实现。
  步骤:
  1、运行——》gpedit.msc
  2、导航至:用户配置——》管理模板——》网络——》网络连接
  3.1、找到“禁止启用/禁用 LAN 连接的组件”,设置为“已启用”
  3.2、找到“启用/禁用 LAN 连接的能力”,设置为“已禁用”
  3.3、找到“为管理员启用 Windows 2000 网络连接设置”,设置为“已启用”
  4、运行——》gpupdate /force
  你现在检查一下本地连接的属性,“禁用”按钮已经变成灰色的不可用状态,这下你再也不用担心意外点中,让你的服务器跟你说拜拜了。

iis限制,流量限制与cpu限制的对比

流量限制就是直接限制网络流量,这种限制通常是最严厉的一种流量限制,10个g的流量大体支持50人在线以内.当月流量超过后,在一个月内网站都不能正常访问了,解决办法是升级空间或加大流量!
二:cpu限制
cpu限制看起来没有限iis或网络流量,但由于每一个程序运行都需要一定的cpu配额,也是变相的流量限制,通常网页显示在线过多都是由于cpu限额过小引起的!通过刷新或15秒后可以得到暂时的正常运行,通常1%的cpu限额相当于20个iis连接!这对于论坛空间很重要,论坛的cpu限额一旦过小就会不能正常运行!
三:iis限制
iis限制是现在用的最多的,也是被大多用户或主机商认可,是唯一宽松的流量限制,通常20个iis就相当于1%cpu占用!

 

总而言之,虚拟主机实际上没有不限流量的,总的可以分为以上三种方式,您如何选择,要看您的需要,如果您的程序占用cpu很少,是优化的程序可以选择限cpu的,这样您的在线就可以得到最大的发挥,如果您是初学者,或是论坛用户,或网站程序中有bbs,选择iis限制或直接流量限制是一个好的选择!

关于同时连接数与在线人数问题的详解
很多用户对连接数的概念认识都很模糊,现介绍如下:

1、浏览者访问站点,必需与站点通过TCP协议,建立连接。这个连接在从服务器上读取信息时存在,读取结束时,一般即自动关闭。所以,当一个页面已经完全地显示在客户端的显示器上时,使用的连接也许已经关闭了。

2、每个浏览者,访问某站点时,可能会占用1——3个连接,这是由计算机自动处理的,这样做的目的是为了加快速度。
相关问题:所以,对于连接数为30的基础型主机而言,有时只能十几个人访问,就不足为怪了。

3、论坛中统计的在线人数,是以某一时间段内访问论坛的活动人数为标准的,与连接数应无关系。比如动网论坛,默认好象是40分钟内(?记不清了)的活动人数。也许论坛显示某用户还在线,但该用户由于不(正)在读取论坛中页面,所以也就不会占用连接数。
相关问题:
(1)所以,只要浏览者对论坛的访问不过于集中,不会在某一时间点超出最大同时连接数,则论坛中统计的在线人数,会大大超出空间允许的最大同时连接数。
(2)某些用户为了显示论坛的人气,可以在调大论坛统计在线人数的时间范围(动网论坛提供此功能),甚至可以将一天内所有浏览你站点的人,都算作在线人数。

4、虽然服务器中可以规定每个站点的最大连接数,但同时也存在服务器的总计最大连接数。所以,即使规定用户站点的最大连接数为不限,当服务器达到了最大连接数时,仍不能访问站点。而服务器的最大连接数一般在1000——2000。
相关问题:
(1)这就是为什么服务商敢于开出不限连接数的主机,本质上不是无限连接数的。
(2)西部数码提供的主机,允许连接数均较高,应该可以满足用户需求。

5、现在的主机服务中,有些服务商利用许多人对上述概念模糊,而误导消费者,所以购主机者应谨慎从事

了解什么是IIS连接数
IIS连接数指并发连接数,什么意思呢?
要分几种情况:(以100M空间50人在线为例)
A 用户单点下载你的文件,结束后正常断开,这些连接是按照瞬间计算的,就是说你50人的网站瞬间可以接受同时50个点下载
B 用户打开你的页面,就算停留在页面没有对服务器发出任何请求,那么在用户打开一面以后的20分钟内也都要算一个在线,就是说你50人的网站20分钟内可以接受不同用户打开50个页面
C 上面B的情况用户继续打开同一个网站的其他页面,那么在线人数按照用户最后一次点击(发出请求)以后的20分钟计算,在这个20分钟内不管用户怎么点击(包括新窗口打开)都还是一人在线。
D 当你的页面内存在框架(Iframe),那么每多一个框架就要多一倍的在线!因为这相当于用户同一时间向服务器请求了多个页面。
E 当用户打开页面然后正常关闭浏览器,用户的在线人数也会马上清除。

然后了解什么是论坛在线人数。
论坛在线只是计算一定时间内的活动用户数。
这里的时间用户可以自己设定,动网论坛默认为40分钟的相对准确值。

根据上面的说明,显然论坛在线和IIS连接数的概念不同
为什么会出现IIS连接数和论坛在线不符合的情况?
现具体分析如下:

1:您使用了插件版论坛或者美化版论坛!
现在的插件很垃圾,不但占服务器资源,而且会使论坛运行变慢(没有插件可以快一倍以上),同时很占在线人数,有的插件调用很多框架,少则2、3个,多则4、5个! 甚至有在线播放音乐,这样一个人在线就相当与很多人在线!而美化版论坛因为使用大量的图片,也同样比标准版论坛占用IIS数量大。

2:您的网站是主页+论坛的形式!
这样主页和论坛要争夺你的在线人数!

3:你的论坛内部有播放器!
一个人在线,然后他在线播放音乐,就占二个人在线!

4:你的论坛内部存在框架形式的网页!
每一个框架,就多一倍的在线!

5:你的论坛设置在线时间过小!
动网默认为40分钟,因为论坛在线只是计算一定时间内的活动用户数,当您设定的时间较小的时候,看起来论坛在线的人数就自然少了!

6:你的空间存在多个论坛!
有的客户在一个空间里上传多个论坛,如bbs  bbs1  bbs2  等等  等等
毫无疑问,这样个论坛也是要争夺再线人数的!

7:你的论坛图片等文件被人盗链!
比如:你的论坛有张图片文件,被粘贴(注意是粘贴不是上传)到别的论坛!
别的论坛的用户在浏览该文件的时候也算一个在线人数!
尤其是LOGO连接的时候注意,一定要对方把您的LOGO上传到他的空间!

8:你的空间上放有下载文件!
如果用户用网络蚂蚁类的软件,每一个线程就表示一个在线,非常厉害!
——————————————————————————————————

解决办法:

1:去掉垃圾的插件版,用标准版!
2:尽量不要采用框架的形式制作页面!
3:不要放任何的音乐、电影、下载!
4:防止盗连情况的发生!
5:升级购买支持更多在线人数的空间!

windows使用cwrsync同步备份数据到linux

如需转载请注明:转载自: 风往北吹的IT博客 [http://blog.yahunet.com/]
本文链接地址:http://blog.yahunet.com/post-31.html

本文介绍了使用cwrsync同步热备windows到linux。

备份是写代码的人必不可少的一项工作,传统的备份,一般就是copy所有数据到一个地方,然后贴上标签,表示是什么时候备份的,这种备份被称之为“整体备份”。
如 果经常进行整体备份,对磁盘的空间占用需求就很大,尤其当你备份大容量的数据的时候,有时候,比如一个星期,只对其中一小部分的内容进行了修改,但是还 是需要全部重新备份一次,很显然,太浪费磁盘空间了;此时增量备份就派上用场了,增量备份,又叫做差异备份,意如其名,只备份修改过的部分。
好了,废话说完了,来看看如何实际操作,我们用到的软件是大名鼎鼎的 rsync,很多网站的镜像就是用它来完成的。

服务端是windows 2003 r2版本,IP:192.168.1.27
客户端是Centos 4.8  IP:192.168.1.28

===================================
服务器端配置:
===================================
1、安装

直接双击就可以,安装到c:/rsync。

2、修改配置文件

c:/rsync/rsyncd.conf
use chroot = false                                                         
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid
lock file = rsyncd.lock
# Module definitions
[test]
path = /cygdrive/e/test/
read only = false
transfer logging = yes
ignore errors = yes
use chroot = no
max connections = 4
read only = yes
list = false
secrets file = /cygdrive/c/rsync/rsyncd.secrets
hosts allow = 192.168.1.28
hosts deny = *

上面定义了1个备份点,只允许 192.168.1.28 连接,需要验证的用户名为 backup
然后创建密码文件,每一行格式为: 用户名:密码,都是明文的

修改c:/rsync/rsyncd.secrets
backup:123456

3、启动服务

右击我的电脑->管理->服务和应用程序->服务
找到RsyncServer,启动类型“自启动”,服务状态“已启动”

====================
客户端的配置
====================

增量备份

备份要求: 所有的数据统一放到一个根目录下,主备份用每个备份点名字命名,增量备份目录为 increment,每个备份点的增量备份数据,全部放到这个目录下面,目录为当前日期,格式为 2007-08-11_11-22
文件目录树如下:
/var/backup/ 备份根目录
|—www/ 备份点1的主目录,这个目录里面的数据是备份完成后最新的
|—increment/ 增量备份根目录
|— www/ 备份点1的差异/修改备份数据
|— 2009-12-04_10-22 从最开始备份到08月11日10点22分,所修改的数据
|— 2009-12-05_11-22 从10点22分到11点22分,所修改过的数据


准备工作:
创建备份根目录: mkdir /var/backup,其他的目录备份时会自动被创建

使用系统自带的rsync工具,插入系统启动光盘,通过rpm安装rsync工具
# echo "123456" > /usr/local/rsync/rsyncd.conf
注意,这里不同于server端,这里只写密码即可
# chmod 600 /usr/local/rsync/rsyncd.conf
客户端基本不用配置什么文件。一个脚本就OK了。

# vi /etc/rc.d/init.d/rsync.sh
#!/bin/bash
unset verb progress
for i in $*; do
[ "$i" = "verb" ] && verb=v
[ "$i" = "progress" ] && progress="--progress"
done
RSYNC_SERVER=192.168.1.27 #rsync server IP
AUTH_USER=backup
BAKROOT=/var/backup/
INC_DIR=increment
NOW=`date +%Y-%m-%d_%H:%M`

[ ! -e $BAKROOT ] && mkdir -p $BAKROOT
PASSWD_FILE=/usr/local/rsync/rsyncd.conf
PASSWD_PERM=`ls -l $PASSWD_FILE|awk '{print $1}'`
if [ "$PASSWD_PERM" != "-rw-------" ]; then
echo -e "\nWARNING: permission of passwd file changed to 0600 \n";
chmod 0600 $PASSWD_FILE
fi
LOGFILE=/usr/local/rsync/log/rsyncbak.log
EXCLUDES=/usr/local/rsync/exclude_file
[ ! -e $EXCLUDES ] && touch $EXCLUDES
BACKUP_MODULES="www" #如需备份多个目录,在“”内添加server端的模块名,用空格隔开
OPTIONS="--force --ignore-errors --delete --delete-excluded \
--exclude-from=$EXCLUDES $progress \
--password-file=$PASSWD_FILE --backup"
rm -f /usr/local/rsync/log/log.*
log_id=0
for bakdir in $BACKUP_MODULES; do
log_id=`expr $log_id + 1`
SUBOPTS="--backup-dir=$BAKROOT/$INC_DIR/$BACKUP_MODULES/$NOW -az${verb}"
rsync $OPTIONS $SUBOPTS $AUTH_USER@$RSYNC_SERVER::$bakdir \
$BAKROOT/$bakdir | tee /usr/local/rsync/log/log.$log_id
done
### 合并临时日志到备份日志中
cat /usr/local/rsync/log/log.* >> $LOGFILE
rm -f /usr/local/rsync/log/log.*
##### end of rsync.sh

# chmod a+x /etc/rc.d/init.d/rsync.sh

开始备份
# /etc/rc.d/init.d/rsync.sh verb progress

备份时,会自动从密码文件读取密码进行验证,备份的详细信息及进度会在当前终端输出,同时也记录到 backup.log 文件中。
两次备份后,如果数据在这段时间内有改动,会产生差异备份数据,用当前时间命名,便于以后查找

如果有些数据你不想备份,可以加入到 exclude_file 文件中,每条记录占一行,支持通配符,比如
/tmp         ## 排除名为 tmp 的根目录
.[a-z]*     ## 不备份以点开头的隐藏文件


(4)任务计划
# crontab -e
0 2 * * * /etc/rc.d/init.d/rsync.sh

香港机房有哪些

香港分别有以下机房可供选择。欢迎大家参考!

  香港宽频机房/HKBN数据中心

  香港第一线机房/DYX数据中心

  中信泰富机房/CPC数据中心

  九仓电讯机房/wharftt数据中心

  HKNET机房/NNT数据中心

  新世界机房/NWT数据中心

  香港KDDI NET机房/数据中心

  和记电讯机房/HGC数据中心

  恆基数码机房/HDC数据中心

  太平洋宽频机房/Pacific数据中心

  电讯盈科机房/PCCW数据中心

  互联优势/IAdvantage数据中心