Configure the download server

  
environment platform in APACHE environment: FreeBSD6.1 server: APACHE2.0.59 component:
libiconv-1.9.2_2.tbz pkgconfig-0.20.tbz #pkg_addFile required when adding components
libxml2-2.6 .23_1.tbz perl-5.8.8.tbz #Components to be added using pkg_add
mod_bw-0.7.gz mod_limitipconn-0.22.tar.gz #Modules for speed limit and IP multithreading download depending on the version Sometimes, you can install APACHE directly. If /bin/apxs in the APACHE home directory cannot load and compile modules, you need to install perl support. On my machine, I installed perl to put the above six components into the same directory. I used to put it in /root/src #------------------- -------------------------------------------------- --------------------first step--------------------------- ---------www#pkg_add libxml2-2.6.23_1.tbz
www#pkg_add perl-5.8.8.tbz
www#tar zxvf httpd-2.0.59.tar.gz
www#cd httpd-2.0.59
www#./configure --prefix=/usr/local/apache --enable-so
www#make
www#make install
#prefix The directory enable-so used to make the APACHE installation is used to enable the APACHE to load the mod dynamic module. We start loading two restricted modules www#/usr/local/apache/bin/apxs -i -c - a /root/src/mod_bw/mod_bw.cwww#/usr/local/apache/bin/apxs -i -c -a /root/src/mod_limitipconn/mod_limitipconn.c If the loading is successful, you can check /usr/local/Is there any of the following text in apache/bin/httpd.conf? #LoadModule foo_module modules/mod_foo.so
LoadModule bw_module modules/mod_bw.so
LoadModule limitipconn _module modules/mod_limitipconn.so If there is any, then our APACHE has been loaded

#-------------------- -------------------------------------------------- ------------------- Part II ---------------------------- ------ Edit APACHE main configuration file to find the following in the /usr/local/apache/bin/httpd.conf file is configured correctly DocumentRoot "/usr/local/apache/htdocs" Whether to specify your own website The root directory finds <Directory />
Options FollowSymLinks
AllowOverride None
</Directory> prefixed with
BandWidthModule On
ForceBandWidthModule On
BandWidth all 50000 first two The sentence is to enable the speed limit mode, the third sentence is to set the limit speed, the unit is byte. We set the speed limit below 50k
find #ExtendedStatus On this line configuration will cancel the previous comment "#", or directly write this sentence in the above configuration, and then add: <Location /down>
MaxConnPerIP 1
</Location>Because the /usr/local/apache/htdocs/down directory is all downloaded by the website, it is single-threaded, if not specified The /down directory is likely to cause customers to be unable to browse the web when downloading content, because browsing the web will also generate a thread. #------------------------------------------------- -------------------------------------------------- --------Additional --------------------------------------- Apache via bin/apachectl or Bin/httpd to control start or stop. # /usr/local/apache/bin/httpd -k start #Start apache
# /usr/local/apache/bin/httpd -k stop #停apache
# /usr/local/apache/bin/httpd -k restart # Restart apache If you want APACHE to start with random machine, you can write a startup script to cd /usr/local/etc/rc in /etc/rc.d directory. .d
vi apache.sh
Add the following content:
/usr/local/apache/bin/apachectl start &
Execute: wq! command to save and exit, and execute the following command: < BR>chmod 777 apache.sh#------------------------------------------ -------------------------------------------------- ----------------
Copyright © Windows knowledge All Rights Reserved