System upgrade
Code: WWW # cd / usr / ports / net / cvsup-welch-gui www # make clean www # make deinstall www # make install www # make clean www # Source ~ / .cshrc www # CD / USR / SRC / Share / Examples / CvsuP WWW # EE Standard-Suppirl
Quote: * Default host = change_this.freebsd.org Modified to faster domestic FreeBSD CVSUP server: * Default host = cvsup.cn.freebsd.org or * default host = cvsup.FreebsdChina.org
Code: WWW # cvsup -g -l 2 standard-suppile www # ee ports-suppile
Quote: * Default host = change_this.freebsd.org Modified to faster domestic FreeBSD CVSUP server: * Default host = cvsup.cn.fault host = cvsup.cn.Freebsd.org or * default host = cvsup.FreebsdChina.org Upgrade all ports is completely unnecessary Therefore, you can add the ports-all to the front of it. Continue to rearward, there are many ports branches, open the need to open, unwanted to keep the list #, such as the installation of the installation is to build WebServer, you can choose the following: Ports-base ports-archivers ports-comms ports-converters ports-databases ports-deskutils ports-devel ports-dns ports-editors ports-emulators ports-ftp ports-java ports-lang ports-mail ports-math ports-misc ports-net ports-print ports-security ports-shells ports- SYSUTILS PORTS-TEXTPROC PORTS-WWW
Code: www # cvsup -g -l 2 ports-support www # ee /etc/make.conf
Quote: # Specify the Ports software first downloaded from China: master_site_override = ftp: //ftp.freebsdchina.org/pub/freebsd/ports/distfiles/$ {dist_subdir}
Code: WWW # cd / usr / src www # make buildworld www # make installworld
Quote: It is best to get off work, then make World, let it complete slowly, it is too long, wait until the flowers are dead.
Code: www # reboot
Quote: The system has been updated to the latest version, restart the machine. Explanation: Since the installed version is a Current branch, Make World does not necessarily always succeed. If it is not successful, the CVSUP system source code will be successful after segmentation, and maybe it can be successful. Next, the kernel is customized.
Code: www # uname -a
Quote: Check out the update.
Customized kernel
Quote: # Before you work, you must take a good look at the relevant section of the manual. There is a good post: kernel custom you can refer to. Specific steps are as follows:
Code: #www cd / usr / src / sys / i386 / conf #www #www cp generic kern.old #www cp generic mykern #www ee my kindrn
Quote: Edit this file with EE, follow the posts mentioned above according to your hardware situation, software requirements edit, and start compiling the kernel. Since our CVSUP is over, it is compiled by the "new" method mentioned in the manual. Code: #www cd / boot #www cp -r kernel kernel.old #www cd / usr / src #www make buildkernel kernconf = mykern #www make installkernel kernconf = mykern
Quote: It is also a long process, end cups, look at the newspaper waiting. After the prompt is completed ...
Code: #www reboot
Quote: You can then install the Webserver software. But before installation, I want to explain, you must first understand some common sense of the FB directory. The directory mainly stores the root directory of the file type / file system. / bin / Basic tool directory in a single user and multi-user environment. / boot / programs and configurations used during the operating system during startup loading. / boot / defaults / defaults each step boot the configuration content. / DEV / device contact. / etc / system started configuration and script. / etc / defaults / system default startup configuration and script. / etc / mail / related to the configuration of the mail system. / etc / namedb / named configuration file. / etc / periodic / daily scripts run each week and monthly run. / etc / ppp / ppp configuration file. / MNT / administrator is accustomed to using the interiors of the hook. / Proc / running file system. The Home catalog of the / root / root user. / sbin / The basic utility required by the storage system program and management in a single user and multi-user environment. / Stand / long-lasting unique program environment. / TMP / storage temporary files, usually stores MFS (8) memory-based file systems that do not need to be protected after restarting. / usr / store most users' applications. / usr / bin / storage utility command, program design tool, and application software. / usr / include / storage standard C include file. / usr / lib / storage library file. / usr / libdata / store data files for various utilities. / usr / libexec / storage system Practical or background program (executed from additional programs). / usr / local / store local execution file, library file, etc., and also the default installation directory installed by FreeBSD Ports. / usr / local in / usr overall arrangement, please check with man.hier.7; In addition to / usr / local / share, the man catalog is placed directly under / usr / local / share, while ports documentation in Share / Doc / Port. / USR / OBJ / target files obtained by coupled / usr / src. / usr / ports stores freeBSD collected Ports (optional). / USR / SBIN / storage system background program and system tool (executed by the user). / usr / share / storage architecture independent file. / USR / SRC / store BSD or local source code file. / usr / x11r6 / storage X11R6 executable file, library file, configuration file, etc. directory (optional). / VAR / storage Multipurpose Record, Temporary, Short-term, and Print Detachment System Files. / VAR / LOG / Store Various System Record Files. / var / mail / storage user Mailbox file. / VAR / SPOOL / Various printers and mail system spooling directory. The / VAR / TMP / storage system is restarted before the controlled temporary file. / VAR / YP NIS mapping.
Installation of WebServer software under Ports
Quote: There is also something to explain, especially students who have just turned from MS Windows to learn FBs to clarify the following installation knowledge. Install the software in the ports, install Make Install, reverse mount Make deinstall, if not installed in the Ports, such as Make Install after some Textbook Tar, you can delete the Make Install program, no need to be like Windows Looking for "Control Silver" "Add Delete Programs" to remove, you can delete the program directly, you will not leave garbage, and you will not cause "system unstable" as in Windows. The Make Install process is usually placed on / usr / local / bin or sbin, and the function library is placed in / usr / local / lib, putting the data file in / usr / local / next its own directory, you These things have been deleted, even if some files do not delete it, it is only a waste of some space, (160g IDE hard drive is about RMB 800 in 2004.10, you don't care about the space occupied by those software. ) Will not cause system unstable, which is different from Windows. In addition, there is a Makefile on the Ports directory of the relevant software. It is recommended that you can open it before installation, you will have new discovery ... nonsense, say more, then let go. Code: WWW # mkdir / usr / local / db www # cd / usr / ports / databases / mysql40-server www # ee makefile
Quote: db_dir? = / Var / db / mysql change to db_dir? = / Usr / local / db / mysql
Code: www # make BUILD_OPTIMIZED = yes BUILD_STATIC = yes install clean www # cd / usr / ports / textproc / expat2 www # make clean www # make deinstall www # make install www # cd / usr / ports / www / apache2 www # make WITH_OPENSSL_PORT = yes install clean www # cd / usr / ports / www / mod_fastcgi www # make WITH_APACHE2 = yes install www # cd / usr / ports / www / mod_php4 www # make install www # cd / usr / local / etc / apache2 www # ee httpd.conf
Quote: Insert four lines LoadModule fastcgi_module libexec / apache2 / mod_fastcgi.so AddHandler fastcgi-script fcgi fcgi fpl AddType application / x-httpd-php .php AddType application / x-httpd-php-source .phps found DirectoryIndex, AddDefaultCharset other related Statement, modified to: DirectoryIndex index.html index.php index.html.var adddefaultcharset GB2312 StartServers 10 MinSpareServers 10 MaxSpareServers 15 ServerLimit 2000 MaxClients 1500 MaxRequestsperChild 10000
Code: WWW # apachectl configtest
# Test whether the syntax of apache's httpd.conf is correct.
Code: WWW # cd / usr / local / etc WWW # cp php.ini-dist pHP.INI WWW # ee /usr/local/www/data/index.php reference: # index.php Only one line can you? PHPINFO ()?> # Test support for PHP
Code: WWW # EE / etc / rc.conf
Quote: # 加 两 行 a ac2_enable = "yes" apache2ssl_enable = "no" # apache2ssl_enable = "no", if you don't need SSL, = NO, in fact, the default value is "no", it is convenient to use it in the future. "Yes", if you don't have "certification", set it to "NO". Get off work, turn off the machine, install it tomorrow
Code: WWW # HALT
Quote: # # 接 确 确 m m 是 对 对 对 密 到 吧 吧 吧 吧 安装 到 密 给 给 给 给 给 给 给 给 给 密 密 密 密 给 密 密 密 密 密 给 密 密 密 密 密 密 密
Code: WWW # mysqladmin -u root password "Password you want to give mysql root" WWW # mysql -u root -p
[quote] Enter Password: # Enter the mysql password
Quote: Welcome to the mysql monitor. Commands end with; or / g. Your mysql connection ID is 50 to server version: 4.0.21 Type 'Help;' or '/ h' for help. Type '/ c' to clear To Buffer. MySQL> # Description mysql is running, or ps | grep mysql
Code: WWW # ps | grep mysql
Quote: 457 P0 S 0: 00.07 Grep mysql 118 con- i 0: 00.18 / bin / sh / usr / local / bin / mysqld_safe --user = mysql --dataDir = / usr / db / mysql - pid-file = /
#Wick you can start installed
Code: WWW # cd / usr / ports / ftp / pure-ftpd www # made with_mysql = 1 with_lang = simplified-Chinese install clean www # cd / usr / local / etc WWW # cp pure-ftpd.conf.sample pure-ftpd .conf www # cp pureft-mysql.conf.sample /etc/pureftpd-mysql.conf www # cd / usr / local / etc WWW # eE pure-ftpd.conf
Reference: ChrootEveryone yes BrokenClientsCompatibility no MaxClientsNumber 50 Daemonize yes MaxClientsPerIP 3 VerboseLog no DisplayDotFiles yes AnonymousOnly no NoAnonymous yes SyslogFacility ftp DontResolve yes MaxIdleTime 15 MySQLConfigFile /etc/pureftpd-mysql.conf LimitRecursion 2000 8 AnonymousCanCreateDirs no MaxLoad 4 AntiWarez yes Umask 133: 022 MinUID 100 AllowUserFXP no AllowAnonymousFXP no ProhibitDotFilesWrite no ProhibitDotFilesRead no AutoRename no AnonymousCantUpload yes CreateHomeDir yes MaxDiskUsage 99 CustomerProof yes Code: www # ee pureftpd-mysql.conf
Quote: Pay attention to these lines, other do not modify # If your mysql is installed by Ports defaults, then select mysqlsocket /tmp/mysql.sock's few rows should be paid attention to and mysqluser, mysqlpassword, mysqldatabase under SQL.txt Specifies in the consistent mysqluser ftp mysqlpassword sunnyxp888 mysqldatabase ftpusers mysqlcrypt MD5
Code: www # ee sql.txt
# 以下 我 我 我 l l 语 语 改 改 改 改 地 地 地 地 地 改 地 改 改 改 地 地 地 地 地 地 地
Reference: DELETE FROM mysql.user where user = 'ftp'; INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv) VALUES ( 'localhost', 'ftp', PASSWORD ( 'sunnyxp888') , 'Y', 'Y', 'Y', 'Y'); FLUSH PRIVILEGES; DROP DATABASE IF EXISTS ftpusers; CREATE DATABASE ftpusers; USE ftpusers; DROP TABLE IF EXISTS admin; CREATE TABLE admin (Username varchar (35) NOT NULL default '', Password char (32) binary NOT NULL default '', PRIMARY KEY (Username)) TYPE = MyISAM; INSERT INTO admin VALUES ( 'Administrator', MD5 ( 'sunnyxp888')); DROP TABLE IF EXISTS user; Create Table Users (User Char (16) Not Null Default ', Password Char (32) Binary Not Null Default', Uid Int (11) Not Null Default '2000', GID INT (11) Not Null Default '2000' , Dir Char (128) Not Null Default ', Quotafiles Int (10) Not Null Default' 500 ', Quotasize Int (10) Not Null Default' 30 ', UlbandWidth Int (10) Not Null Default' 80 ', DLBANDWIDTH INT (10) Not null default '80', Status Enum ('0', '1') Not Null Default '1', Ipaccess VA Rchar (15) Not null default '*', Comment Tinytext Not Null, Primary Key (User), Unique Key User (User) type = Myisam; Insert INTO `Users` VALUES ('Test', MD5 ('Sunnyxp888') , '2001', '2000', '/ Home / Test', '500', '30', 80, 5, 1, '*', '*'); Code: WWW # mysql -u root -p < Sql.txt www # rm sql.txt www # ee rc.conf
Quote: # Add a line, automatic pure-ftpd starts pureft_enable = "yes" # 到 这里 到 到 到 到 到 到
Code: WWW # /usr/local/etc/rc.d/pure-ftpd.sh start
Quote: # 好, assume that the IP of this machine is 192.168.1.6, then you open your browser, enter the address: ftp: // test: sunnyxp@192.168.1.6 # You find you can upload, download. # Additional USER table records in the FTPUsers library can increase FTP users. Code: www # reboot
OK, here, you have installed a server that can provide Web & FTP services. As for how to optimize, you can go to Google, or look at the relevant books.