- 等级
- 建筑队长
- 等级进度
-
- 积分
- 310
- 阅读权限
- 45
- 主题
- 精华
- 社区币
- 星梦
- 注册时间
- 2004-2-16
- 最后登录
- 1970-1-1
|
Port 80<BR>User nobody<BR>Group nobody<BR><BR>#################################################################<BR>ServerAdmin yourname@test.8866.org<BR>#################################################################<BR>#################################################################<BR>DocumentRoot "/usr/local/www/htdocs"<BR>#################################################################<BR><BR>Options FollowSymLinks<BR>AllowOverride None<BR>rectory><BR>#################################################################<BR><BR>#################################################################<BR>Options Indexes FollowSymLinks MultiViews<BR>AllowOverride None<BR>Order allow,deny<BR>Allow from all<BR>rectory><BR><BR>UserDir public_html<BR>Module><BR><BR>#################################################################<BR><BR>DirectoryIndex index.html index.htm index.php<BR>Module><BR>#################################################################<BR>AccessFileName .htaccess<BR><BR>Order allow,deny<BR>Deny from all<BR>Satisfy All<BR>les><BR>UseCanonicalName On<BR><BR>TypesConfig /usr/local/www/conf/mime.types<BR>Module><BR>DefaultType text/plain<BR><BR>MIMEMagicFile /usr/local/www/conf/magic<BR>Module><BR>HostnameLookups Off<BR>ErrorLog /usr/local/www/logs/error_log<BR>LogLevel warn<BR>LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined<BR>LogFormat "%h %l %u %t \"%r\" %>s %b" common<BR>LogFormat "%{Referer}i -> %U" referer<BR>LogFormat "%{User-agent}i" agent<BR>CustomLog /usr/local/www/logs/access_log common<BR>ServerSignature On<BR><BR>Alias /icons/ "/usr/local/www/icons/"<BR><BR>Options Indexes MultiViews<BR>AllowOverride None<BR>Order allow,deny<BR>Allow from all<BR>rectory><BR>Alias /manual/ "/usr/local/www/htdocs/manual/"<BR><BR>Options Indexes FollowSymlinks MultiViews<BR>AllowOverride None<BR>Order allow,deny<BR>Allow from all<BR>rectory><BR>ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"<BR><BR>AllowOverride None<BR>Options None<BR>Order allow,deny<BR>Allow from all<BR>rectory><BR>Module><BR><BR>IndexOptions FancyIndexing<BR>AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip<BR>AddIconByType (TXT,/icons/text.gif) text/*<BR>AddIconByType (IMG,/icons/image2.gif) image/*<BR>AddIconByType (SND,/icons/sound2.gif) audio/*<BR>AddIconByType (VID,/icons/movie.gif) video/*<BR>AddIcon /icons/binary.gif .bin .exe<BR>AddIcon /icons/binhex.gif .hqx<BR>AddIcon /icons/tar.gif .tar<BR>AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv<BR>AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip<BR>AddIcon /icons/a.gif .ps .ai .eps<BR>AddIcon /icons/layout.gif .html .shtml .htm .pdf<BR>AddIcon /icons/text.gif .txt<BR>AddIcon /icons/c.gif .c<BR>AddIcon /icons/p.gif .pl .py<BR>AddIcon /icons/f.gif .for<BR>AddIcon /icons/dvi.gif .dvi<BR>AddIcon /icons/uuencoded.gif .uu<BR>AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl<BR>AddIcon /icons/tex.gif .tex<BR>AddIcon /icons/bomb.gif core<BR>AddIcon /icons/back.gif ..<BR>AddIcon /icons/hand.right.gif README<BR>AddIcon /icons/folder.gif ^^DIRECTORY^^<BR>AddIcon /icons/blank.gif ^^BLANKICON^^<BR>DefaultIcon /icons/unknown.gif<BR>ReadmeName README<BR>HeaderName HEADER<BR>Module><BR><BR>AddEncoding x-compress Z<BR>AddEncoding x-gzip gz tgz<BR>AddLanguage da .dk<BR>AddLanguage nl .nl<BR>AddLanguage en .en<BR>AddLanguage et .ee<BR>AddLanguage fr .fr<BR>AddLanguage de .de<BR>AddLanguage el .el<BR>AddLanguage he .he<BR>AddCharset ISO-8859-8 .iso8859-8<BR>AddLanguage it .it<BR>AddLanguage ja .ja<BR>AddCharset ISO-2022-JP .jis<BR>AddLanguage kr .kr<BR>AddCharset ISO-2022-KR .iso-kr<BR>AddLanguage nn .nn<BR>AddLanguage no .no<BR>AddLanguage pl .po<BR>AddCharset ISO-8859-2 .iso-pl<BR>AddLanguage pt .pt<BR>AddLanguage pt-br .pt-br<BR>AddLanguage ltz .lu<BR>AddLanguage ca .ca<BR>AddLanguage es .es<BR>AddLanguage sv .sv<BR>AddLanguage cz .cz<BR>AddLanguage ru .ru<BR>AddLanguage zh-tw .tw<BR>AddLanguage tw .tw<BR>AddCharset Big5 .Big5 .big5<BR>AddCharset WINDOWS-1251 .cp-1251<BR>AddCharset CP866 .cp866<BR>AddCharset ISO-8859-5 .iso-ru<BR>AddCharset KOI8-R .koi8-r<BR>AddCharset UCS-2 .ucs2<BR>AddCharset UCS-4 .ucs4<BR>AddCharset UTF-8 .utf8<BR><BR>LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw<BR>Module><BR><BR>######################################################################<BR>AddType application/x-tar .tgz<BR>AddType image/x-icon .ico<BR>AddType application/x-httpd-php .php<BR>####################################################################### <BR><BR>Module><BR><BR>BrowserMatch "Mozilla/2" nokeepalive<BR>BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0<BR>BrowserMatch "RealPlayer 4\.0" force-response-1.0<BR>BrowserMatch "Java/1\.0" force-response-1.0<BR>BrowserMatch "JDK/1\.0" force-response-1.0<BR>Module><BR><BR>#############################for expires.c###############################<BR><BR>ExpiresActive on<BR> ExpiresByType image/gif "access plus 1 month"<BR> ExpiresDefault "now plus 1 day"<BR>Module><BR>#########################################################################<BR><BR>#############################for mod_gzip################################<BR><BR>mod_gzip_on Yes<BR>mod_gzip_minimum_file_size 1000<BR>mod_gzip_maximum_file_size 300000<BR>mod_gzip_item_include file \.html$<BR>mod_gzip_item_include file \.htm$<BR>mod_gzip_item_include file \.php$<BR>mod_gzip_item_include mime text/.*<BR>mod_gzip_item_include mime httpd/unix-directory<BR>mod_gzip_temp_dir /tmp/mod_gzip<BR>mod_gzip_dechunk Yes<BR>mod_gzip_keep_workfiles No<BR>Module><BR>##########################################################################<BR><BR>按“Ctrl+[”,存盘退出。<BR><BR><BR><BR>php的配置文件:php.ini<BR><BR>test# ee /usr/local/www/php/lib/php.ini<BR><BR>加入或更改如下内容:<BR><BR>register_globals = On<BR>mysql.default_port = 3306<BR><BR><BR>按“Ctrl+[”,存盘退出。<BR><BR><BR>mysql<BR><BR>test# cd /usr/local/mysql<BR>test# ./bin/safe_mysqld --user=mysql &<BR><BR>test# ./bin/mysql<BR><BR>mysql>use mysql<BR>mysql>grant all privileges on *.* to "winname"@"192.168.0.3";<BR><BR>mysql>quit<BR>Bye<BR>test# killall mysqld<BR><BR><BR>samba的配置文件:smb.conf<BR><BR><BR>test# ee /usr/local/samba/lib/smb.conf<BR><BR>加入或更改如下内容并把所有关于printer的部分用“;”注释掉:<BR><BR>#======================= Global Settings =====================================<BR>[global]<BR>workgroup = WORKGROUP<BR>server string = FreeBSD<BR>hosts allow = 192.168.0.3 127.<BR>guest account = winname<BR>log file = /var/log/samba/log.%m<BR>#============================ Share Definitions ==============================<BR>;[homes]<BR>; comment = Home Directories<BR>; browseable = no<BR>; writeable = yes<BR>[sos]<BR>path = /sos<BR>public = yes<BR>writeable = yes<BR>[htdocs]<BR>path = /usr/local/www/htdocs<BR>public = yes<BR>writeable = yes<BR><BR>按“Ctrl+[”,存盘退出。<BR><BR>test# chown -R winname /sos<BR>test# chown -R winname /usr/local/www/htdocs<BR><BR><BR>ez-ipupdate的配置文件:qdns.conf<BR><BR>test# ee /usr/local/ez/qdns.conf<BR><BR>加入或更改如下内容:<BR><BR>service-type=qdns<BR>user=user:passwd<BR>host=test.8866.org<BR>interface=tun0<BR>max-interval=2073600<BR>cache-file=/tmp/ez-ipupdate.cache<BR><BR>其余部分用“#”注释掉。按“Ctrl+[”,存盘退出。<BR><BR><BR>配置ipfw<BR><BR>test# ee /etc/ipfw.conf<BR><BR>加入如下内容:(其中希网的DNS服务器的ip为202.108.36.139)<BR><BR>#ipfw防火墙规则的修正:(其中xxx.xxx.xxx.xxx和yyy.yyy.yyy.yyy是你所处地区的DNS服务器的IP)<BR><BR># /etc/ipfw.conf<BR><BR>add 00100 allow ip from any to any via lo0<BR><BR>add 00310 deny log ip from any to any ipopt rr<BR>add 00320 deny log ip from any to any ipopt ts<BR>add 00330 deny log ip from any to any ipopt ssrr<BR>add 00340 deny log ip from any to any ipopt lsrr<BR>add 00350 deny tcp from any to any in tcpflags syn,fin<BR><BR>add 00400 allow tcp from any to me 80 in<BR><BR>add 00500 check-state<BR>add 00520 allow tcp from any to any out setup keep-state<BR>add 00530 allow tcp from any to any out<BR><BR># ICMP<BR>add 00600 allow icmp from any to any icmptype 3<BR>add 00610 allow icmp from any to any icmptype 4<BR>add 00620 allow icmp from any to any out icmptype 8<BR>add 00630 allow icmp from any to any in icmptype 0<BR>add 00640 allow icmp from any to any in icmptype 11<BR><BR># DNS<BR>add 00700 allow ip from xxx.xxx.xxx.xxx to any<BR>add 00710 allow ip from any to xxx.xxx.xxx.xxx<BR>add 00720 allow ip from yyy.yyy.yyy.yyy to any<BR>add 00730 allow ip from any to yyy.yyy.yyy.yyy<BR>add 00740 allow ip from 202.108.36.139 to any<BR>add 00750 allow ip from any to 202.108.36.139<BR>add 00760 allow udp from any to any out<BR><BR><BR># LAN<BR>add 00900 allow ip from 192.168.0.0/16 to any<BR>add 00910 allow ip from any to 192.168.0.0/16<BR><BR><BR>按“Ctrl+[”,存盘退出。<BR><BR><BR>再配置rc.conf<BR><BR>还记得前面/etc/rc.conf中有:<BR><BR>#ipfw_enable="YES"<BR>#ipfw_type="/etc/ipfw.conf"<BR><BR>吗?<BR><BR>test# ee /etc/rc.conf<BR><BR>去掉前面的“#”,按“Ctrl+[”,存盘退出。<BR><BR>至此,大功告成!<BR><BR>test# reboot<BR><BR>以root身份登入FreeBSD<BR><BR>运行samba<BR><BR>test# /usr/local/samba/sbin/smbd start<BR>test# /usr/local/samba/sbin/nmbd start<BR><BR>运行mysql<BR><BR>test# cd /usr/local/mysql<BR>test# ./bin/safe_mysqld --usr=mysql &<BR><BR>运行apache<BR><BR>test# /usr/local/www/bin/apachectl start<BR><BR>运行ez-ipupdate<BR><BR>test# /usr/local/ez/ez-ipupdate -c /usr/local/ez/qdns.conf<BR><BR><BR>好了,如果没有什么异常,你的FreeBSD就正在运行着现在最流行的apache,mysql和samba。<BR><BR>2 Windows上<BR><BR>右键点击网上邻居,在菜单上选择属性,点击左键,打开后,右键点击本地连接,在菜单上选择属性,双击“Internet 协议<BR><BR>(TCP/IP)”,选择“使用下面的IP”,“IP地址(I)”处输入“192.168.0.3”,“子网掩码”处输入“255.255.255.0”,“默认网关”处输入<BR><BR>“192.168.0.1”;记得你在FreeBSD里记下的DNS服务器的IP吗?在“使用下面的DNS服务器地址”处输入它们,确定。好了,赶紧打开网上邻<BR><BR>居吧,看到FreeBSD里的sos和htdocs文件夹拉吧,你可以随意地在Windows和FreeBSD的这两个文件夹之间拷贝文件了。<BR>打开MS-DOS,在根目录下输入:<BR><BR>C:\>ping 192.168.0.1<BR><BR>有回应,表示局域网配置正常。<BR><BR>C:\>ping test.8866.org<BR><BR>有回应,表示域名解析成功。<BR><BR>打开一个你常去的网站,这是通过FreeBSD作网关上去的。<BR><BR><BR>打开记事本,输入:<BR><BR><BR><BR>hello,world! welcome to test.8866.org.<BR><BR><BR><BR>存为index.html,拷贝到网上邻居FreeBSD的htdocs内,打开IE,在地址栏输入:<BR><BR>http://test.8866.org<BR><BR>回车,看到那行字了吗?这就是你的首页。<BR><BR>再打开记事本,输入:<BR><BR>phpinfo();<BR>?><BR><BR>存为phpinfo.php,拷贝到网上邻居FreeBSD的htdocs内,在地址栏输入:<BR><BR>http://test.8866.org/phpinfo.php<BR><BR>回车,你会看到你的WEB服务器的信息。会有类似的一行:<BR><BR>This program makes use of the Zend Scripting Language Engine:<BR>Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies with Zend Optimizer<BR>v2.1.0, Copyright (c) 1998-2003, by Zend Technologies <BR><BR><BR><BR><BR>配置调试用服务器<BR><BR>apache<BR><BR>安装在C:\www\apache下<BR><BR>httpd.conf中加入或改写:<BR><BR>LoadModule php4_module c:/php/sapi/php4apache.dll<BR>LoadModule gzip_module modules/ApacheModuleGzip.dll <BR><BR>AddModule mod_php4.c <BR>AddModule mod_gzip.c<BR><BR>ServerName localhost<BR><BR>AddType application/x-httpd-php .php <BR><BR><BR>LogFormat "%h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info1<BR>LogFormat "%h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n <BR><BR>Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2<BR><BR>CustomLog logs/access.log common_with_mod_gzip_info2<BR><BR>mod_gzip_on Yes<BR>mod_gzip_minimum_file_size 300<BR>mod_gzip_maximum_file_size 0<BR>mod_gzip_maximum_inmem_size 100000<BR>mod_gzip_keep_workfiles No<BR>mod_gzip_dechunk Yes<BR>mod_gzip_temp_dir "c:\www\apache\mod_gzip_tmp"<BR>mod_gzip_item_include file \.html$<BR>mod_gzip_item_include file \.htm$<BR>mod_gzip_item_include file \.jsp$<BR>mod_gzip_item_include file \.php$<BR>mod_gzip_item_include file \.pl$<BR>mod_gzip_item_include mime ^text/.*<BR>mod_gzip_item_include mime ^application/x-httpd-php<BR>mod_gzip_item_include handler ^perl-script$<BR>mod_gzip_item_include handler ^server-status$<BR>mod_gzip_item_include handler ^server-info$<BR>mod_gzip_item_exclude file \.css$<BR>mod_gzip_item_exclude file \.js$<BR>mod_gzip_item_exclude mime ^image/.*<BR>Mldule> <BR><BR>Window 2000下可以用“服务”方式启动apache <BR>MS-DOS下,输入:<BR><BR>C:\>cd www\apache <BR>C:\www\apache>apache -i -n "apache" <BR><BR>这样就把apache安裝到系统的服务中了,你可以在控制台的服务中看到apache列在服务列表內,以后开机时就自动执行apache了。<BR>要启动apache也可以直接在MS-DOS下输入:net start apache,关闭apache输入:net stop apache <BR><BR>mod_gzip<BR><BR>将ApacheModuleGzip.dll拷贝至C:\www\apache\modules,创建c:\www\apache\mod_gzip_tmp即可。<BR><BR><BR>php<BR><BR>将php解压缩到C:\www\apache\php<BR><BR>将php4ts.dll拷贝C:\windows\system<BR><BR>将php.ini-dist拷贝至C:\WINNT 目录下,并改名为 php.ini<BR><BR>修改php.ini:<BR><BR>register_globals = On<BR>mysql.default_port = 3306<BR><BR><BR><BR>ZendOptimizer<BR><BR>执行ZendOptimizer*.exe<BR><BR>安装目录设为 C:\www\apache\Zend<BR><BR><BR>安装程序将自动更新php.ini,并在其内容结尾处自动添加: <BR> <BR>[Zend]<BR>zend_optimizer.optimization_level=15<BR>zend_extension_ts="C:\www\apache\Zend\lib\ZendOptimizer.dll"<BR><BR><BR>mysql<BR><BR><BR>运行setup,安装到C:\www\mysql下<BR>将C:\www\mysql目录下的my-example.cnf文件改名为my.cnf拷贝到c:\目录下面<BR>打开MS-DOS<BR><BR>C:\>write my.cnf<BR><BR>[mysqld]<BR>port=3306<BR><BR>basedir = C:/www/mysql/<BR><BR>保存后退出。<BR><BR>设定mysql为“服务”方式启动:<BR>MS-DOS下,输入:<BR><BR>C:\>cd apache\mysql\bin<BR>C:\>apache\mysql\bin>mysqld-nt --install <BR><BR>以后开机时就自动执行mysql了,和apache一样,启动mysql时也可以在 DOS 下输入: net start <BR><BR>mysql关闭mysql时输入: net stop mysql <BR><BR><BR>phpMyAdmin<BR><BR>将phpMyAdmin的zip文件解压缩到C:\www\apache\htdocs\localsql\和C:\www\apache\htdocs\serversql\目录下<BR><BR><BR>编辑localsql内的Config.inc.php<BR><BR>$cfg['PmaAbsoluteUri'] = 'http://localhost/localsql/';<BR><BR>$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname<BR>$cfg['Servers'][$i]['port'] = '3306'; // MySQL port - leave blank for default port<BR>$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket<BR>$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')<BR>$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection<BR>// (requires PHP >= 4.3.0)<BR>$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings<BR>// (this user must have read-only<BR>$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"<BR>// and "mysql/db" tables)<BR>$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?<BR>$cfg['Servers'][$i]['user'] = 'root'; // MySQL user<BR>$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed<BR>// with 'config' auth_type)<BR>$cfg['Servers'][$i]['only_db'] = ''; <BR><BR><BR><BR><BR>编辑serversql内的Config.inc.php<BR><BR>$cfg['PmaAbsoluteUri'] = 'http://localhost/serversql/';<BR><BR>$cfg['Servers'][$i]['host'] = '192.168.0.1'; // MySQL hostname<BR>$cfg['Servers'][$i]['port'] = '3306'; // MySQL port - leave blank for default port<BR>$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket<BR>$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')<BR>$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection<BR>// (requires PHP >= 4.3.0)<BR>$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings<BR>// (this user must have read-only<BR>$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"<BR>// and "mysql/db" tables)<BR>$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?<BR>$cfg['Servers'][$i]['user'] = 'winname'; // MySQL user<BR>$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed<BR>// with 'config' auth_type)<BR>$cfg['Servers'][$i]['only_db'] = ''; <BR><BR><BR>这样,当Windows和FreeBSD上的apache和mysql运行着的时候,在Windows的IE地址栏中输入:<BR><BR>http://localhost/localsql/index.php<BR><BR>时,连入Windows上的mysql;<BR><BR>输入:<BR><BR>http://localhost/serversql/index.php<BR><BR>时,则连入FreeBSD上的mysql;<BR><BR>这样,你就可以同时管理调试用的和正式使用的两个数据库了。<BR><BR><BR>至此,你完成了组网的基本过程。当然,根据你的实际情况重新编译内核是必要的,在这里不再累数。<BR>可算完了,不好意思,还有几句废话:<BR><BR><BR>1 个人使用的带宽少的可怜,就不要一边运行服务器,一边在Windows上看在线电影,打在线游戏和长时间下载了,当然你要是Money充足,拉<BR><BR>个百兆专线,我强烈建议你做以上所有事情,否则就白瞎了,呵呵。<BR><BR>2 一般的PC与好的专业服务器的性能是没法比的,再者即使你有最好的专业服务器,没有带宽也是白搭。<BR><BR>3 带宽垄断终究是不会长久的,现在日本的个人家庭ADSL的传输速率是:12Mbps/1Mbps,上行1Mbps达不到我想800kbps还是能达到的,包月费<BR><BR>折合人民币不到280元,未来的趋势可见一斑。<BR>4 作服务器的PC,建议使用:<BR><BR>P4 CPU<BR>Maxtor ATA133 Disk<BR><BR>选择主板要注意:<BR><BR>FSB与内存总线的搭配<BR>南北桥总线的传输率<BR>支持ATA133<BR>当然,你要做IDE的RAID就更象服务器了。<BR>5 以上为个人体会与借鉴他人体会的总结,难免有不妥之处,请不吝指正。 |
|