Webserver-Freebsd-7-2.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 § дѥішѧчшѤѸк WebServer ѱчѕѲнҖ FreeBSD 7.2 § діцѨћѩдќѥ www.mu-ph.org ѱчѕ ѯѝіѧєёѤьыѫҙ ьѧшѕҙьіѥ Email: [email protected] 12 ѝѧкўѥзє 2552 * * * * * * * * * Objective: шҖѠкдѥіъѼѥ WebServer еѠк Ѡкзҙді ѲўҖъдѐѫ ҐѥѕѲьѠкзҙдієѨ WebSite ѲнҖкѥь ѱчѕѲўҖ ѯьѪѸѠъзьјѣѨѷ 5 GBytes Specifications °Á¦ºÉ°¸ÉÄo CPU: Intel(R) Xeon(R) CPU E5405 @ 2.00GHz (1995.01-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x1067a Stepping = 10 Ram 2G HardDisk IDE 500G ¨³ 250 εª°o° o°Â¦ 500G ¦oµ / , swap ¨³ /backups o°¸É° 250G ¦oµ /var , /tmp , /usr ¨³ /usr/local Lan card 1 Ä (onboard) Ân partion ´¸Ê www# df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad5s1a 507630 146844 320176 31% / devfs 1 1 0 100% /dev /dev/ad7s1g 400913540 16644420 352196038 5% /backups /dev/ad7s1e 1012974 12 931926 0% /tmp /dev/ad7s1f 10154158 1150928 8190898 12% /usr /dev/ad5s1d 231978828 4 213420518 0% /usr/local /dev/ad7s1d 60931274 1066 56055708 0% /var www# ѱюіѰдієъѨѷјк 1. ÂoŠ¢j¤¸ÉεÁ} 2. Compile Kernel Á¡ºÉ°Ä®o¦°¦´ Firewall ¨³ Quota 3. Update ports tree 4. µ¦·´Ê Firewall 5. µ¦Îµ Quota 6. ·´Ê mysql50-server 7. ·´Ê Apache22 8. ·´Ê PHP5 9. ·´Ê PHP5-extensions 10. ·´Ê ZendOptimizer 11. ·´Ê webmin 12. ·´Ê phpmyadmin 13. ·´Ê vsftp 14. ·´Ê awstats 15. ·´Ê ntp 16. ·´Ê clamav 17. ·´Ê hostsentry 18. ·´Ê portsentry 19. ·´Ê lynx 20. ·´Ê phpbb3 21. ·´Ê denyhosts 22. µ¦ Backup Áª µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 Ã¥ Á¦·¤¡´»r ¥· r¦µ Page 1 µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 јѼѥчѤэъѨѷ 1). ѰдҖѳеѰђґєъѨѷлѼѥѯюҝь ѲьдѥішѧчшѤѸкѝѥєѥіщћѩдќѥѳчҖлѥд http://bsd.psru.ac.th/microcom/micro240/install53_1.pdf http://bsd.psru.ac.th/microcom/micro240/install53_2.pdf ѯєѪѷѠшѧчшѤѸк FreeBSD 7.2 ѯіѨѕэіҖѠѕѰјҖњ ѯіѥдѶъѼѥдѥіѰдҖѳеѰђґєъѨѷлѼѥѯюҝьѯэѪѸѠкшҖьъѼѥѳчҖѱчѕ login as: sermpan Using keyboard-interactive authentication. Password: Last login: Mon Aug 10 11:02:38 2009 from proxy.mu-ph.org Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.2-RELEASE (GENERIC) #0: Fri May 1 08:49:13 UTC 2009 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the [email protected] mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. $ su root Password: www# ѯіѧѷєчҖњѕѰдҖѰђґє Welcome ѲўҖјчдѥі Delay лѥд 10 њѧьѥъѨ ѯўјѪѠ 3 њѧьѥъѨ www# vi /boot/defaults/loader.conf ############################################################## ### Loader settings ######################################## ############################################################## #autoboot_delay="10" # Delay in seconds before autobooting, autoboot_delay="3" # Delay in seconds before autobooting, ѰјѣѰдҖѰђґє sshd_config ѯёѪѷѠѠьѫрѥшѲўҖ User нѪѷѠ sermpan ѝѥєѥіщъѨѷлѣ Secure Shell ѳчҖѰшҕѯёѨѕкяѬҖѯчѨѕњ www# vi /etc/ssh/sshd_config # Authentication: AllowUsers sermpan #LoginGraceTime 2m #PermitRootLogin no #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 Save ѰјҖњѝѤѷк Reload www# /etc/rc.d/sshd reload www# µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 Ã¥ Á¦·¤¡´»r ¥· r¦µ Page 2 µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 јѼѥчѤэъѨѷ 2). Compile Kernel ѯёѪѷѠѲўҖіѠкіѤэ Firewall Ѱјѣ Quota www# cd /usr/src/sys/i386/conf/ www# cp GENERIC PH www# vi PH ; ѲўҖѳчҖѯюҝьчѤкьѨѸ (ѯёѧѷєѲѝҕѝҕњьъѨѷѯюҝьёѪѸьѝѨѰчк) www# cat PH # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ../../conf/NOTES and NOTES files. # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.474.2.15.2.1 2008/11/25 02:59:29 kensmith Exp $ cpu I486_CPU cpu I586_CPU cpu I686_CPU #ident GENERIC ident PH # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options MD_ROOT # MD is a potential root device options NFSCLIENT # Network Filesystem Client options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCLIENT options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options ADAPTIVE_GIANT # Giant mutex is adaptive. options STOP_NMI # Stop CPUS using NMI instead of IPI options AUDIT # Security event auditing µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 Ã¥ Á¦·¤¡´»r ¥· r¦µ Page 3 µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 #options KDTRACE_HOOKS # Kernel DTrace hooks # # Add Firewall & Quota to kernel # options IPFIREWALL options IPFIREWALL_FORWARD options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=120 options IPDIVERT options QUOTA # # End of Additional Line # . www# pwd /usr/src/sys/i386/conf www# ll total 82 -rw-r--r-- 1 root wheel 13 Jun 20 2005 .cvsignore -rw-r--r-- 1 root wheel 534 Apr 15 10:14 DEFAULTS -rw-r--r-- 1 root wheel 12472 Apr 15 10:14 GENERIC -rw-r--r-- 1 root wheel 1745 Apr 15 10:14 GENERIC.hints -rw-r--r-- 1 root wheel 1034 Apr 15 10:14 MAC -rw-r--r-- 1 root wheel 131 Apr 15 10:14 Makefile -rw-r--r-- 1 root wheel 38891 Apr 15 10:14 NOTES -rw-r--r-- 1 root wheel 2016 Apr 15 10:14 PAE -rw-r--r-- 1 root wheel 12786 Aug 12 16:51 PH -rw-r--r-- 1 root wheel 3539 Apr 15 10:14 XBOX www# config PH Kernel build directory is ../compile/PH Don't forget to do ``make cleandepend && make depend'' www# cd ../compile/PH www# make depend ; make ; make install . ===> zyd (install) install -o root -g wheel -m 555 if_zyd.ko /boot/kernel install -o root -g wheel -m 555 if_zyd.ko.symbols /boot/kernel kldxref /boot/kernel www# іѠльдіѣъѤѷкъѼѥкѥьѯѝіѶлѝѤѷк Reboot www# reboot µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 Ã¥ Á¦·¤¡´»r ¥· r¦µ Page 4 µ¦·´Ê WebServer Ã¥Äo FreeBSD 7.2 јѼѥчѤэъѨѷ 3). Update ports tree ѯєѪѷѠшѧчшѤѸк FreeBSD 7.2 ѯіѨѕэіҖѠѕѰјҖњ ѯіѥдѶъѼѥдѥі Update ports ъѼѥѳчҖѱчѕ login as: sermpan Using keyboard-interactive authentication. Password: Last login: Tue Aug 4 20:03:36 2009 from proxy.mu-ph.org Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.2-RELEASE (PH) #0: Tue Aug 4 18:53:55 ICT 2009 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the [email protected] mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also