FreeBSD 5.2.1R Web Server Extraction Example Process

zhaozj2021-02-16  59

This document gives the friends who come into contact with FreeBSD as they. I am more embarrassing this person, but I have always been confident. Because I want to instigate a web server, I know that FreeBSD is more stronger in this regard, so they are determined to prepare to engage a self-itbsd web server. It used to play MS's Windows series, starting freebsd, of course, some touching the door, the following is some of my preliminary experience about FreeBSD, hoping to help later newcomers. I am also a rookie of FreeBSD, everyone is bare. The following text is not a note for me. When I am afraid that I will have an omission in some links in the future, so I will become this article, please also ask the hipster ax. First, the basic requirement to play freebsd this Unix type operating system, I think it first needs to have the following two basic capabilities, otherwise it will be very difficult. 1. Good English ability. Although FreeBSD also has a graphical interface (GUI), if it is a server, more is the command line (like a MSDOS) operation, in the example of the web server here, almost a pure command line job. Therefore, English is important. 2. UNIX foundation. Basic UNIX instructions To know, such as LS, PWD, CP, MAN, RM, MKDIR, RMDIR, etc. In particular, we must know the role of the Man command. Also knowing that Scroll Lock and More Directions are required when the screen shows too much. The following is a simple example of the usage of several instructions. LS (Column Directory, Dir) LS | More (Column Directory, Using Pipes and More Command Split Screen Shows Excessive Content) CP ABC ABC_BAK (Copy of File, Copy Similar to MSDOS) CP -R ABC ABC_BAK (Catalog Copy) RM -R ABC / * (all files and subdirectories under the subdirectoric ABC, similar to the MSDOS DEL, but allowing the -R option to operate for subdirectory) Man Ls (detailed description of the LS command) ) Mv abc ../ABC_BAK (Mobile and rename ABC for the ABC_BAK under the parent directory, ABC can also be a document for the document) 3. There is a bookD handbook, the paper version is of course good, electronic version is also good: http: http: http: http: //www.freebsd.org.cn/snap/doc/en_cn.gb2312/books/Handbook/ II. Some statements before installing the system first declare that I am using the latest freebsd5.2.1Release ISO format CD installed, now The burner is all over place, and you downloaded ISO from the Internet to engraved a CD to install freebsd, it should be not difficult. Second, FreeBSD's full installation upgrade requires a good network environment, even if you have a disc, you still need to go on the Internet, so you have a fast internet connection. Third, the installation process and the premature note 1. Although the installation of the operating system has said a lot of difficulties about FreeBSD, in fact, if you have better English, you will find the freebsd kernel system is still very simple. A total of 30 minutes. And FreeBSD5.2.1 is sufficiently advanced, and my server has not encountered any problems all correctly identified.

FreeBSD 5.2.1 has a total of 4, one of which named boot, and its ISO named DISK1 (notice is not bootonly), boot disc plas into the optical drive, BIOS set the optical drive start, restart the machine, the machine Start from the optical drive and enter the kernel of FreeBSD 5.2.1 and automatically start the SysInstall program in the CD. The program is a text graphical interface and is also very friendly. First, select Standard installation, which is also recommended installation mode. There is also a MINI installation, the installed system is the smallest, the run is the highest, but it may be facing more adjustments. A. Hard disk partition and UNIX partition quota are assigned as an initiator, choose the Standard mode installation, then entered the FDISK program interface of FreeBSD, and MSDOS's fdisk is very similar, but the prompt below the screen is more friendly. If you have two or more hard drives, FDISK will ask you to do partitions on that hard disk. Since I am doing a server, there is no dual system, etc., so select the existing partition with the upper and lower arrows and press the D key to remove these existing partitions to make a empty disk, then press A to automatically assign into a nature, and finally Press Q to exit FDISK, so simply divide a hard disk area. Then SysInstall will prompt your server if you need to use bootmgr, if you don't need multiple boot, you can choose Standard, I choose Bootmgr - allowed multiple boots in this place. Then use DiskLabel to create a UNIX partition and assign partition space. This picture is similar to fdisk, you can use the up and down direction keys to select the required partition, then click the prompt to the screen and divide the partition according to your own requirements. I use the default method here: choose A automatic division, choose Q to exit. Special Tip: MySQL installation will be installed to / var partition by default. If you don't want to change the default installation of MySQL, then you should adjust the automatic division / var partition, more adjustment. / VAR partition is only 256m by default, and a slightly large database is not enough. I didn't use the default installation partition / var in the MySQL installation below, but changed to the / usr partition, so I didn't need to change any partition size here. B. Tips for the installation process Select the partition and quota completion, then the package selection screen will appear, you can choose developer or anything else. As a web server, I think it is better to choose developer, but I didn't understand it at the time, I didn't choose anything, I didn't choose exit. In fact, it is not necessary to choose, there is still a chance behind it. The subsequent picture is prompted from what media installation, we are of course yourself ISO CD - choose CD / DVD, machines don't start, and other media are actually not selected. After the media is selected, the screen prompt: user confirmation requested last chance! Are you suwany? When you are confirmed, the previous partition settings are about to take effect, the original things in the hard disk will be deleted, and start installation The initial kernel system. The initial kernel installation is very fast (10 minutes), and has most popular hardware, I use FB5.2.1 a smooth recognition of all hardware. Subsequently after installation settings, you will first ask if you take PPP / SLIP mode connectivity network, if you don't choose No, I am ADSL's DHCP mode Internet, so NO. If you are a dial mode, let it be based on the prompt.

Then you ask you to enter the TCPIP settings of your network card. If it is DHCP, connect the network cable, the machine will automatically get the settings. If it is a static IP, you can set IP, mask, gateway, DNS, etc. according to your own machine. Then then the machine will ask the following questions: Do you set the machine to gateway - no (we are web server, not a gateway) set whether the machine is an inetd super server - NO (we have SSH and Pureftpd, no inetd) is set to NFS Server / Client - No (we are not this) is set to anonymous ftp - no (we don't need this purpose) Do you need to set SSHD - YES (we will pass this more secure mode Remote Control Server) Select time zone - According to the prompt selection, you will prompt your Beijing time abbreviation to be "CST" requires Linux compatibility --yes (maybe I will install some Linux software for the server, such as CS Server), you need to set system console - default Very good, you don't have to change the studies. Do you need to configure a mouse - NO (I can't see what is necessary to configure the mouse as a hosted Webserver if you need to add a user - add one, you can add it, you can use it according to the prompt. This user is managed remotely after the server is logged in to the server. After adding this user, you will ask you to have the root password, you can enter. If you don't add a user, let you set the root password. In fact, these installations are set up, as long as the English is good, according to the prompt, there will be no problem. C. After the installation, after the installation, you can enter the SysInstall's Configure to perform the final package and the Contribution selection, and the CONTRIBUTION selection. Package is a binary package that has been compiled and can be run directly. After the default standard is installed, as WebServer, I see the CVSUP (online upgrade) and the unzip under Archivers (some zip packs may be used). Two packages under NET. After selecting the installation, install them in the system. Then go to the Contibution installation code. It is highly recommended that you have to select all SRC code. There are many categories under SRC, even GAME. When I learned FreeBSD, I was always lacking this one. Later, I learned it. After I installed the SRC, it was a lot, and I rarely prompted when compiled, and the future CVSUP is also beneficial. The other is Ports, don't say, it is also full. I am here, that is, I chose SRC and Ports. After selecting the installation, install them into the system. At this point, an initial freebsd5.2.1 is installed. Although it looks more, it is actually 30 minutes. If you are the first time I installed freebsd, don't worry about it, you can first look at the manual, familiar with how to familiarize freebsd. 2. The first step after the system is installed, is CVSUP, immediately synchronize your SRC source code and Ports code. For more details on CVSUP, please see the CVSUP section of the FreeBSD manual, which I only introduce the process in this example. Since CVSUP requires an internet environment, you need to pick up your network cable.

Enter the following directory: #CD / USR / SRC / Share / Examples / CVSUP is a few CVSUP's Supfile example. We can modify these examples directly for us. First edit Standard-Suppirl, this file is an example file for upgrading the kernel source code. I personally like to edit the file with EE (because there is a prompt, and use the habit close to Windows), enter the following instructions: #ee standard-suppile can see a lot of things, but don't change, it is default it to upgrade all System source code - this is good. We only need to modify one place, find below to find this line: * Default host = change_this.Freebsd.org Change to the specified FreeBSD official CVSUP server: * Default host = cvsup.freebsd.org or faster domestic FreeBSD CVSUP server: * Default host = cvsup.cn.faut Host = cvsup.cn.freebsd.org * default host = cvsup.freebsdchina.org Exited and saved, run the following instructions Start CVSUP online upgrade code: #cvsup standard-suppile This is also our first time with FreeBSD Internet. If the network is unblocked, you can see the connection prompt and start the automatic upgrade source code. If you are not smooth, or if the CVSUP server is busy, you can try it to try a CVSUP server. If it is a network setting problem, you can change the NIC settings in sysinstall - configure - networking. You can also edit the /etc/rc.conf this file with EE to check the problem. System source code upgrade, my ADSL can be done by 30 minutes. Then we upgrade the Ports code. Many things in Ports are unsuitable, we can edit it slightly. Open the ports-support this file: #ee ports-support first, first specify a CVSUP server, and the method has changed on the above-mentioned method. Then choose the Ports tree that needs to be upgraded. As the webserver, the upgrade all ports is completely unnecessary, so you can add the Ports-all to the front of the front. Continue to find, there are a lot of Ports branches, we will open the need to open, no need to keep the #, it is canceled.

For example, the following lines will be added #, it is useless to WebServer; I removed the first #, or stayed, so as not to compile questions: ports-base # ports-arabic ports-archivers #ports -astro # ports-audio # ports-benchmarks # ports-biology # ports-cad # ports-chinese ports-comms ports-converters ports-databases ports-deskutils ports-devel ports-dns ports-editors ports-emulators # ports-finance # ports-french ports-ftp # ports-games # ports-german # ports-graphics # ports-hebrew # ports-hungarian # ports-Irc # ports-japanese ports-java # ports-Korean ports-lang ports-mail ports- Math # ports-mbone ports-misc # ports-multimedia ports-net # ports-news # ports-punm # ​​ports-posis # portus-polish # ports-portuguese ports-print # ports-russian # ports-science ports-security ports -Shells ports-sysutils ports-textproc # ports-ukrainian # ports-vietnamese ports-www # ports-x11 # ports-x11-clocks # ports-x11-fm # ports-x11-fonts # ports-x11-servers # ports- X11-Toolkits # ports-x11-WM photo is compiled above, you can save exit, then run the CVSUP Start Upgrade Ports: #cvsup ports-support This upgrade process is about 30 minutes. At this point, all code upgrades are completed. 3. Make World and custom kernel. Regarding the details of Make World, you should also read the relevant part of the manual, and continue to introduce the situation in this example. After the upgrade is completed, the Make World is required. Since our system is just installed, clean, so there is not so much problem. Enter: #CD / USR / SRC #Make BuildWorld will start a 30 minute compilation process, if there is nothing wrong with compilation, continue: #make installworld to update the system as the latest version, then restart the machine. Here you need to declare that because 5.2.1 is the Current branch, Make World does not necessarily always succeed. If you can succeed, congratulations. If it is not successful, the CVSUP system source code can be successfully passed, and it may be successful. I installed 2 server myself, the first one was not successful, and the second one was successful after a month. No success, don't worry too much, after all, 5.2.1 is Release, relatively stable. Down, we need to customize the kernel. The necessity of custom kernel I want to say that I don't have to say, you should also look at the relevant part of the manual. Also please see this post carefully: http://www.freebsdchina.org/forum/viewtopic.php?t=1706 is very detailed.

Specific operation, enter the following directory: #CD / USR / SRC / SYS / I386 / Conf can see a file called Generic. Copy this file a copy, such as Samplekern, which will be the profile of your future kernel. #CP Generic Samplekern #ee samplekern Edits Samplekern with EE, follows the posts mentioned above, according to your own hardware situation, software requirements edit, start compiling the kernel. Since our CVSUP is over, it is compiled by the "new" method mentioned in the manual. #CD / USR / SRC Make Buildkernel Kernconf = Samplekern This compilation process is about 20 minutes. Do not worry about install first, first back the old kernel, so as not to be unexpected. #CD / boot #cp -r kernel kernel.old Next, the kernel is installed: #make installkernel kernconf = Samplekern After installation, it can be restarted. Since I own is a server installed at home, so I added to the kernel file the following lines, in order to form a shared Internet capacity: #ipfirewall for NAT options IPFIREWALL options IPDIVERT options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT = 100 and / etc / There are also a few lines in rc.conf: # for natd gateway_enable = "yes" fiRewall_enable = "yes" firewall_type = "natd_enable =" NATD_INTERFACE = "EM0" NATD_FLAGS = "" 2 described above, compile and compile Install the kernel to achieve a shared Internet. FreeBSD is a gateway, Windows to do a workstation, and subsequent work can be made from the workstation to log in with SSH, and does not affect the workstation on the Internet. After all, FreeBSD has a lot of adjustments from the installation to the truly input. The general server-specific motherboard is integrated with 2 NIC. Common Intel100M card device code is FXP, Intel1000M card is EM, card code can be seen in sysinstall when you install the system, you can see it in sysinstall - configure - networking. In this example, two cards are 1000m card, the first network card is EM0, and the Internet is connected. 4. Server software installation new thin kernel compilation is completed, it is installed. It is recommended to install it in the order below. Before installing the software, it is recommended to add the following line in the file: master_site_override = ftp: //ftp.FreeBsDChina.org/pub/freebsd/ports/distfiles/$ {dist_Subdir} Specify ports software first Download from China. Otherwise all software downloads abroad, sometimes it is not. A. MYSQL 4.0 installation I chose mysql4.0, not old, not new. When the second time was installed, Ports had reached a version 4.0.20. In this case, in this example, specifically explanation. As mentioned earlier, MySQL default database is placed in / var partition, if your database is very big, then you need to divide / var zone to a large enough.

LDCONFIG Boss recommends 4G. If you want to put the database to the / usr partition like me, then: #mkdir / usr / dB first build a database directory in / usr, then #CD ​​/ USR / PORTS / DATABASES / MYSQL40-Server #EE Makefile Opens Makefile, Found DB_DIR? = / Var / db / mysql to change to db_dir? = / Usr / db / mysql then follow this post, according to Delphij's old teachings, in front of the air line in front of the CONFIGURE_TARGET in Makefile, add two lines Optimization options: build_optimized = YES build_static = YES Save Exit Editing. Then #make #make install starts downloading and starts the installation database. After the compilation is installed, the restart machine can start the mysqld daemon, and if you can see the mysql> prompt if you can see the mysql> prompt, you can explain it. However, the just-installed MySQL default database connection is 100, which is far from cope with the requirements of the big website. In accordance with this approach: http://www.fanqiang.com/a2/b1/20010705/140800801.html Specific to MySQL4.0 for FreeBSD 5.2.1 in this example, you should modify the number of connections: #ee / usr / local / bin / mysqld_safe is looking for a line 312 (version 4.0.20 is 314 line), which is very long, starting with "$ nohup_nicness", with ">> $ Err_Log 2> & 1". The row is nestled in an IF statement. In the end of 312, ">> $ ERR_LOG 2> & 1" before, "-O MAX_CONNECTIONS = 1000", (note that each of the front and then leaves a space). Then find 314 lines down, and it is also a long line, starting with "Eval" $ nohup_nicness "," >> $ Err_Log 2> & 1 "end. Similarly," >> $ Err_Log 2> & 1 "beforehand" - O Max_connections = 1000. Save Exit. Then restart, at this time the mysql40 is 1000 concurrent databases. You can check it with the following: #CD / usr / local / bin #Mysqladmin -uroot -p variables will Take a long list, press the scroll lock, scroll up the screen, you can see a display inside | MAX_CONNECTIONS | 1000 | So indicating that the maximum concurrent connection has been modified to 1000. At this point, the mysql database is installed. B. Apache2 Install the same, from the ports Apache, there will be no difficulties: #CD / usr / ports / www / apache2 #make #make install is completed. This is as simple. Compilation may ask the relevant software GetText installation option, all Select it. When compiling, you may be prompted to install the new version of the TextProc / Expat2 error. The reason is that there is already an old version of Expat2 in the machine. Just delete the old version to reinstall the new version of Expat2: #CD / usr / ports / textproc / expat2 #make deinstall #make install #cd / usr / ports / www / apache2 #make #Make Install Continue Make.

C. Apache2 MOD installation Apache2 comes with SSL, so there is no need to install SSL. MOD_GZIP can't find an article about Apache2, is it no need to install, it is strange. So the remaining is Fastcgi and PHP. As required, first pick fastcgi for apache2, first see post: http://bbs.chinaunix.net/forum/viewtopic.php?t=221295 Enter instruction: #CD / usr / ports / www / mod_fastcgi #make with_apache2 = YES Install ok, completed. It is PHP down. #CD / USR / PORTS / WWW / MOD_PHP4 # Make then download compilation, the middle will prompt you to choose the compile configuration option. MySQL has been selected by default, and the GD and OpenSSL are also selected. Other options I don't know what to use, I haven't chosen. Then #make install php4.3.6 is installed. D. WEB installation After setting First, set the Apache's PHP access capabilities. #CD / usr / local / etc / apache2 #ee httpd.conf in addtype application / x-gzip .gz .tgz, add the following 3 lines: #PHP Support AddType Application / X-httpd-php .php AddType Application / X -HTTPD-PHP-SOURCE .PHPS then sets the website default boot page Allow INDEX.PHP. Also in httpd.conf, you don't have to exit. Find DirectoryIndex index.html index.html.var Add index.php to: DirectoryIndex index.php index.html index.html.var Set the Apache Default character set to Simplified Chinese. Found: AddDefaultCharset ISO-8859-1 Change to AddDefaultCharset GB2312 In addition, a website with a large number of visits, Apache default 150 connections must not work. Please modify according to this post: http://www.cnfug.org/journal/3/02.html The specific operation is as follows. Find: After find this, modify the recommended value of the post is: StartServers 10 MinSpareServers 10 MaxSpareServers 15 ServerLimit 2000 MaxClients 1500 MaxRequestsPerChild 10000 At this point, httpd.conf of Set the settings. You can save exit. Of course, if you want to engage in virtual hosts, please set the virtual host-related part according to the example of the manual and the httpd.conf tail. For my virtual host settings, you can see the explanation after I have followed by FTP. Work has not yet finished, set INI to PHP. If there is nothing special requirements, you can use the default recommended php.ini directly. #CD / usr / local / etc #cp php.ini-recommented php.ini At this time, restart the machine, HTTP mode access this server, such as http://192.168.0.1, you can see the page of Apache2.

At this point, you can use the EE to write a simple PHP test page in the server's default web directory, for example #ee /usr/local/www/data/index.php file, only such a line of code: This time you visit http://192.168.0.1, you can see the PHP page information of this unit. After seeing PHPINFO, you can install Zend Optimizer first. Zend Optimizer can only be manually installed, and you can't find it in Ports. After downloading ZendOptimizer-2.5.2-FreeBSD5.1-i386.tar.gz from httore/products/ze-optimizer.php, uploaded to the server in any directory. You can also use a USB flash drive and the burning disk to the server. Then decompress, install: #tar -zxvf zendoptimizer-2.5.2-freebsd5.1-i386.tar.gz #CD Zendoptimizer-2.5.2-FreeBSD5.1-i386 #. / Install.sh then the Zend Optimizer installation screen appears, Step by step by step. Completed, will prompt x Your php.ini is relocated to the: / usr / local / zend / etc Directory xx and a symbolic link from the former place: xx /usr/local/etc/php.ini is created. Xxxx Your ORIGINAL PHP.INI WAS BACKED-UP TO: XX /USR / IPAL/EtC/php.ini-zend_optimizer.bak x This time you visit http://192.168.0.1/index.php, you can see Zend Optimizer in PHPINFO Information. At this point, the Web section has all installed settings. E. Pure-ftpd installation Pure-ftpd installation, I fully learn this post: http://www.freebsdchina.org/forum/viewtopic.php?t=10279 The front of MySQL is not seen. Start directly from the Pure-ftpd section. This should be continued in this example. #CD / usr / ports / ftp / pure-ftpd #ee makefile According to the following posts, add the necessary configure_args in your makefile, and save exit EE. In this case, the installation directory is not specified, using the Ports default installation directory. #make with_mysql = 1 with_lang = Simplified-Chinese Install Clean Subsequent installation will be completed smoothly. Continue the following configuration, perform the following: #CD / usr / local / etc #cp pure-ftpd.conf.sample pure-ftpd.conf #cp pureftpd-mysql.conf.sample pureftpd- MySql.conf opens a newly generated pure-ftpd.conf, remove the Note of the MySQL database - ready to use MySQL as a verification. MySQLCONFIGFILE / Etc/pureftpd-mysql.conf again specifies an anonymous login: Noanonymous YES again specified Allow uploader modified file Name: NoreName No Allows login users to use Chmod instructions NOCHMOD NO users can delete files KEEPALLFILES NO Automatic Establishment Account Home Dir CreateHomedir Yes conf set. Then import the initial value of the database.

Paste the following to the copy of the copy as a text file (the original post There are several errors), such as ftp.mysql, then perform the following command to import mysql database: #mysql -u root -p123456

You also need to set up pureftpd-mysql.conf #ee pureftpd-mysql.conf to modify according to the default prompts in the file, is very simple. It is also possible to refer to the modification of the post mentioned above. At this time, the revision in the system is all completed. You will now restart the system, you can try Test1 / 123456 to log in to FTP. Subsequently, we install the PHP-Manager to implement the FTP management of Web mode according to the above posts. Download ftp.zip (Chinese ftp.zip: http://forum3.games.sina.com.cn/upload/39/400/20040615/1025/205182/205182.zip Please download as soon as possible, late, maybe Sina Delete), pass it to the server, then #mv ftp.zip / usr / local / www / data #cd / usr / local / www / data #unzip ftp.zip #ee ftp / config.php Modify config.php CONFIG.PHP The connection parameters inside, other things are basically not changed. save. Then you can access this Web management page with http://192.168.0.1/ftp/. Log in to the management page, enter your password (this example is 123456), you can see the preset user TEST1, and its status. Fourth, some of the issues after the system is installed. In this example, this web server is used to support 4 to 5 websites or forums. So the above installation process is actually for this purpose. So subsequent useful precautions, here is a brief description. 1. First, if you want to manage the database very convenient, you should install a phpMyAdmin, you can use the ports, it is very simple, and it is also the default in / usr / local / www / data. 2. Second, if you want to make it easier to monitor the server status, you can also install a phpsysinfo, and the ports can be installed, and the same default is in / usr / local / www / data. In this case, when the server will host the / usr / local / www / data, you can use the virtual host that you know. From this virtual host, you can see the status of the entire server, manage the MySQL of the server, add FTP users and hosts. (Ports PHPSYSINFO2.1) Some issues on Intel onboard Gigabit NICs have some questions, downloading a 2.2 version from PHPSYSInfo's website to fix this problem, and 2.2 supports Simplified Chinese.) 3. About new virtual hosts. Follow the PureftPD in this example, whenever you generate an account in the FTP management page, such as web1, then log in to Server with FTP software, Server automatically generates a user named Web1, and at the same time in / home Generate a web1 directory, specifically: / home / web1 (actually / usr / home / web1) If you want to limit Web1 quotas, you can set it in the management page. Then then the web virtual host directory of Web1, of course, in httpd.conf, is also specified as / home / web1 in this class. Simple? 5. Remotely control your own web server. In addition to the simple control of the phpMyAdmin and FTP, the web page, which is mentioned above, you certainly don't have the ultimate remote control ability: ssh2. I am a rookie, I don't have the advice of this thing. In short, this thing is very secure and can be remotely connected to your SERVER's means.

I didn't mention SSH in front, and in fact, the third step of self-hitting, after the initial installation of the operating system, we can use SSH to remotely control the server, not only the effect and server's local console The same, and it may be more convenient - because we can use a Win2K computer, it is very convenient to look at the post here, while watching the side, you can use Windows Ctrl-C / V, how good. First, statement, all the basic knowledge about SSH installation and connection can be found in this post: http://www.freebsdchina.org/forum/viewtopic.php?t=10210 Let's follow my practice, Simply talk about the SSH application method in this example. 1. First download the SSHClient client on your Win2k, it is free and it seems to be more useful. http://www.ssh.com/support/downloads/secureeshellwks/non-commercial.html 2. Since the SSH has been selected when we install the operating system, the operating system part does not need to be set, the default will Start the SSHD daemon. 3. When the system is installed, I have prompted whether to add a user, I have prompted to add at least one user, such as your own English name, and this user must be the Wheel group, only the WHEEL group user can switch to switch root. If you didn't add it, then a user who added a WHEEL group now, this user will be your future login to Server. 4. After installing SSHCLIENT on Win2k, you can directly connect your Server, which is logged in with the Wheel group username and its password. After logging in, you can switch, then enter the root password, you can switch to root. 5. The above login method is safe enough, and others can't eave, but there will be vulnerabilities in the future. Since we are still a local LAN mode connection between us and Server, there is no security problem, so we will use the password mode to serve, you can use sshclient to generate a key, turn into a Key method, so it is basically no security Vulnerability. The practice is as follows: Open SSHCLIENT, menu Select Edit - Settings, the Settings dialog box appears. Inside the Global Settings - User Authentications - Keys option, you can see the Generate New button, press after pressing the prompt, but generate a key, put this key file, press the button Upload, you can put this KEY The file is uploaded to the home directory you logged in on Server, the specific location is /Home/yourname/.ssh2. This .ssh2 directory is automatically generated when uploaded. But the freebsd default directory name is .ssh, not .ssh2. So, according to the posts above, we log in to Server with the Wheel group users just mentioned, and do the following: $ su password: #LS can see that there is already a .ssh2 directory. Continue below: #mv .ssh2 .ssh is renamed .ssh #cd .ssh # ssh-keygen -x -f yourkey.pub >> Authorized_keys Enter the SSH directory, import the KEY file you just uploaded into the machine's verification file.

At this point, you can already exit SSHCLIENT, log in to your server in key, do not need to enter your password, you can log in directly, and you don't have to worry. The software comes with a SFTP, which is also encrypted, safe. Sixth, thank you, I have no good saying this rookie. Top these, in the guests, they are pediatrics, laughing. However, in the spirit of Free, I wrote these messy words. Let's make a new couple later. I'm also a little bit of selfishness - give me myself a note.嘿嘿. (Doing your own blog, I didn't think about it. Only by this book, I'm going to see someone's blog. I am currently working in my own Server. Thank you for this: delphij, ldconfig, jayvan, xiaohua, likuku, and a lot I think Friends. They gave me a lot of timely, useful tips, so that I can start this server first in 1 month, thank you very much! ! Seven, postscript - About Apache log polling. The server has been running for a month and a half, and the hard drive is not big, the log problem has a big problem that plagues me. Unfortunately, I still don't quite use cron and cronolog. I have seen the chedong blog these days, and finally do it, share it with you. I do this: First download the cronolog package, pass the SSH to Server, unpack installation, will be very good installed by default. #tar -zxvf cronolog-1.6.2.tar.gz #cd cronolog-1.6.2 #. / configure #make install then open httpd.conf #ee /usr/local/etc/apache2/httpd.conf to virtual host Set the part, change the log logging to the following: Customlog "| / usr / local / sbin / cronolog /yours/log/access%w.log" common errorlog "| / usr / local / sbin / cronolog / yoursite / Log / Error% W.Log "Run the crontab -e directive to add the following two tasks: 0 5 * * / bin / rm / yoursite / log / access`date -v-6d /% W`. LOG 10 5 * * * / BIN / RM / YOURSITE / LOG / ERROR`DATE-V-6D /% W`.log restarts Apache, the next log will make a backup every day and only reserve 1 week.嘿嘿. Appendix A: Important documents for newcomers, their location and their use. /etc/make.conf compiled global control profile, which is very complex, have an example, you can refer to. /etc/rc.conf rc should be the meaning of resources. This file manages the important resources of Server, such as network card settings, daemon enable off, and the function is turned off. /usr/local/etc/rc.d This is not a file, but a directory, which is equivalent to DOS's autoexec, which is automatically performed when the machine is started. At the same time, you have to close the Apache or MySQL, you can achieve the purpose of running the SH Script here. / usr / local / etc 这个 This is also the same as a file, but a directory. Most of the configuration files for the rear loaded software of the non-operating system are placed here.

转载请注明原文地址:https://www.9cbs.com/read-18692.html

New Post(0)