XX. Build web server version: 2004-06-27-01 Web server = IIS? Wrong! Web server preferred apache. Checking, excellent multi-platform support, good security and high-level customability make it almost occupying web server 7. XX.1 is ready to work to http://www.apache.org, where to find a Dongdong download called httpd. To sour, don't binary. I downloaded the latest version at this time, "httpd-2.0.49.tar.gz". There is also a small verification code file, "httpd-2.0.tar.gz.md5", come back together. Execute "MD5SUM" for "httpd-2.0.49.tar.gz" to see if the resulting string is consistent with "httpd-2.0.94.tar.gz.md5", please re-download. The letters in "httpd-2.0.94.tar.gz.md5" may be capitalized, which does not matter. It should be noted that the string in "httpd-2.0.tar.gz.md5" is likely to be separated by two sets, so that I think the files come back is bad. XX.2 Installing I install the path to install Apache is "/ opt / prog / c / apache". First, "httpd-2.0.49.tar.gz" is thrown into the directory "/ opt / prog / tmp" of the temporary file. Open the terminal, enter this directory: [root @ TFW-RFL40 root] # CD / OPT / PROG / TMP [root @ TFW-RFL40 TMP] # 解压 缩: [Root @ TFW-RFL40 TMP] # tar zxvf./httpd- 2.0.49.tar.gz ... ...... ...... [root @ TFW-RFL40 TMP] # gets the source code directory "httpd-2.0.49" of Apache. Enter this directory: [root @ TFW-RFL40 TMP] # CD httpd-2.0.49 [root @ TFW-RFL40 httpd-2.0.49] # configuration, generated compilation option: [root @ TFW-RFL40 httpd-2.0.49] # ./configure --prefix = "/ opt / prog / c / apache" --Nable-module = so ... .................. [root @ TFW-RFL40 httpd-2.0.49] # "--prefix =" The installation path used to specify the software. "--Enable-module =" enables Apache, and can load the external module of the type it can be loaded after the installation is complete. You can use multiple "--enable-module =" to specify support multiple modules. More parameters are here no. Compile, connect, turn the source code into local binary code: [root @ TFW-RFL40 httpd-2.0.49] # make ... ...... [root @ TFW-RFL40 httpd-2.0.49] # Installation, corresponding The file is sent to the corresponding place.
[root @ TFW-RFL40 httpd-2.0.49] # make install ...... ...... [root @ TFW-RFL40 httpd-2.0.49] # xx.3 Run Now Go to Software Installation: [Root @ TFW- RFL40 httpd-2.0.49] # cd / opt / prog / c / apache [root @ TFW-RFL40 Apache] #Naunch web server: [root @ TFW-RFL40 Apache] # ./bin/apachectl start [root @ TFW- RFL40 Apache] # Enable the browser to access the URL "LocalHost". If your computer has access Ethernet, you can access your own computer with an IP address in another computer browser. The Ethernet environment consisting of physical hosts and virtual machines is equally suitable. I can see the Apache test page that has a big feathers is successful. Restart the web server: [root @ TFW-RFL40 Apache] # ./bin/apachectl restart [root @ TFW-RFL40 Apache] # 关 网 服务 服务: [Root @ TFW-RFL40 Apache] # ./bin/apachectl stop [root @ TFW-RFL40 Apache] # xx.4 Requirements XX.4.1 ... ...... ...... xx.4.2 Chinese support ...... ...... JSP:
Code: xx. Set up JSP Server Version: 2004-06-13-01 JSP is a very promising site dynamic web technology, if you grasp, it is also very vivid. Tomcat is the product of the Apache Fund Jakart project. It was recommended by Sun to do the JSP container and the first choice for JSP servers. Tomcat can act as Apache's JSP extension plugins, you can also run independently, act as web servers. If your site has a small number of visitors, you can even don't install Apache. XX.1 is ready to work to http://www.apache.org, where to find a Dongdong download called Jakart-Tomcat. To binary, don't sour. I downloaded a stable latest version at this time, "jakart-tomcat-4.1.30.tar.gz". There is also a small verification code file, "Jakart-Tomcat-4.1.30.tar.gz.md5", come back together. Execute "MD5SUM" for "jakart-tomcat-4.1.30.tar.gz" to see if the resulting string is consistent with "jakart-tomcat-4.1.30.tar.gz.md5", please re- download. The letters in "jakart-tomcat-4.1.30.tar.gz.md5" may be capitalized, which doesn't matter. It should be noted that the string in "httpd-2.0.tar.gz.md5" is likely to be separated by two sets, so that I think the files come back is bad. Tomcat is running requires J2SDK support. If you do not install J2SDK, please install J2SDK first. XX.2 Installing I install Tomcat's path is "/ opt / prog / m / tomcat". Put "Jakart-Tomcat-4.1.30.tar.gz" / OPT / PROG / TMP "in the discounted file. Open the terminal, enter the directory of the software to install the software: [Root @ TFW-RFL40 root] # CD / OPT / PROG / M [Root @ TFW-RFL40 M] # 解压 缩:: [Root @ TFW-RFL40 M] # tar zxvf / OPT / PROG / TMP / JAKART-TOMCAT-4.1.30.tar.gz ... ...... [root @ TFW-RFL40 M] # Do a link without version numbers, so Tomcat's content can also be seen as installation In "/ opt / prog / m / tomcat", it will be convenient in the future: [Root @ TFW-RFL40 M] # ln -s ./jakart-tomcat-4.1.30./tomcat [root @ TFW-RFL40 M] # The main installation is complete. Modify the environment variable file. I changed "/ etc / profile".
Add the following 9 lines at the end of the file: ###################################################################################################################################################################################################################################################### # Tomcat catalina_base = "/ opt / prog / m / tomcat" catalina_home = "/ opt / prog / m / tomcat" java_home = "/ opt / prog / m / java / j2sdk1.4.1_02" ClassPath = $ ClassPath: $ java_home / lib: $ JAVA_HOME / jre / lib PATH = $ PATH: $ JAVA_HOME / bin: $ JAVA_HOME / jre / bin: $ HOME / bin: $ CATALINA_HOME / bin export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CLASSPATH CATALINA_BASE CATALINA_HOME ### ############################# Catalina_base, Catalina_Home should be the installation location of Tomcat. Java_home is the J2SDK installation location. Since I have a link without a version number, I use 4.1.30 to replace 4.1.27 just delete old links and redo a link, don't have to change this file. XX.3 Run Now Go to Software Installation: [Root @ TFW-RFL40 M] # CD Tomcat [Root @ TFW-RFL40 Tomcat] # 启 JSP server: [root @ TFW-RFL40 Tomcat] # ./bin/startup. SH [root @ TFW-RFL40 Tomcat] # enables the browser and accesses the URL "LocalHost: 8080". If your computer has access Ethernet, you can access your own computer with an IP address in another computer browser. The Ethernet environment consisting of physical hosts and virtual machines is equally suitable. At this point, you should see a Tomcat test page drawn with a yellow cat. Another visit "LocalHost: 8080 / Examples / JSP /", look at the dynamic webpage, if you can work properly, you will succeed. Turn off web server: [root @ TFW-RFL40 Tomcat] # ./bin/shutdown.sh [root @ TFW-RFL40 Tomcat] # xx.4 The higher requirements XX.4.1 define the Tomcat installation directory. I am "/ opt / prog / m / tomcat". Go to the "WebApps" directory. Enter the "Examples" directory. Enter the "JSP" directory. See a file "index.html", this is the index of "localhost: 8080 / example / jsp /". Return to a point. Note that the directory "Examples" has a direct subdirectory Web-INF, which directly contains an application configuration file "Web.xml". There are other directory and files in "Examples" to implement the invariant and changing front desk user interface in the browser. To facilitate continued description, two concepts "Web Applications" and "Web App Same" are defined here. When a directory is like "Examples" described above, it contains a direct subdirectory "Web-INF", and this "web-inf" is directly containing an application profile "Web.xml", saying this directory as "web application master Directory "; a" web application home directory "and all files therein, the collection of directories" Web Application (or web application) ".
Like Examples, in addition to "Web application home directory, there are other directories, files," Web-Inf "in addition to" Web-INF ". In addition to "Web.xml", there are other directorys, files, which are used to complete control of the front interface in the background. XX.4.2 Present Situation Currently, your current Tomcat is available for external Web applications only "http: // host (host name or IP): 8080 / example or ip): 8080 / examples /". From the perspective of the application, in a slightly official case, a single, name-based web application is not very good, there is no related function or content, which is best provided by different web applications; from the perspective of development Look, "Examples" is full of original examples, a lot of files, which continue to develop, more, more chaotic, and difficult to manage. XX.4.3 Preliminary goal of initial goals is to achieve rough layout: there are several directorys, which are equipped with debugging and external web applications, and act as the main directory of each application, temporarily named "app_1", "app2" ... ... "app_x" ... "app_n", of course, "Examples" can also be ranked; use a directory "a" to act as the root directory of the web application, put the web application main directory "App_1", "App2" ... "app_n "All placed;" http: // host / app_x / "as a URL can use the contents of the corresponding web application main directory" App_x ". On my machine, the web application root is "/ opt / prog / m / webApps". For learning, the Web application for debugging has "Root.Web_00", "Typhoon.anti", "Typhoon.Study", "Typhoon.Web_00", and "Examples", "Examples", and "Typhoon.School". XX.4.4 Modify to Tomcat installation directory "/ opt / prog / m / tomcat", enter the configuration file directory "conf", find the file "server.xml". Use the text editor to open "server.xml" where you find the following:
Remify the configuration file "Web.xml", copy one copy to each web-infate directory to replace "Web-INF" in "Web-INF" before renown. Restart Tomcat, use URL "http: // host: 8080 / app_x /", Web application can be used. The target is reached. If you want to use Tomcat to act as a web server directly, "http: // host: 8080 / app_x /" is not very good. Open the "server.xml", find the following paragraph:
Code: XX. Integration Web Server and JSP Server Version: 2004-06-13-02 Apache is a professional web server, focusing on its Bank, and touching the dynamic webpage of JSP, PHP, ASP classes, it can only stand Tomcat is mainly a JSP engine, which acts as a web server is just part-time, and the static page processing capacity is not enough, and a large number of HTTP access cannot be accessed. However, Apache can submit the unformable web pages to other servers and accept the result of processing, and Tomcat can also handle the JSP pages submitted by other servers and return processing results. The two beat it, the division is clear, and the cooperation is pleasant. In the following description, the software version and Apache, Tomcat's installation paths are subject to your actual situation. XX.1 Early Module_Webapp method XX.1.1 Prepare to work to http://www.apache.org, find APR and correspond to your Tomcat version JAKARTA-TOMCAT-Connectors-4.1.30-src download. Everything is source. I am "APR-0.9.4.tar.gz" and "Jakarta-Tomcat-Connectors-4.1.30-Src.Tar.gz". Cover the corresponding MD5 check code files back. Execute "MD5SUM" on the next file, compare the results with the contents of the respective check code files, if you don't do it, please re-download. XX.1.2 Installing the Integration Plug Plock "Jakarta-Tomcat-Connectors-4.1.30-src.Tar.gz" dropping the directory "/ opt / prog / tmp" of the temporary file and decompressed. Enter the Decompressed Directory "JAKARTA-TOMCAT-Connectors-4.1.30-SRC". Notice that the "webapp" directory inside? Put "APR-0.9.4.tar.gz" and uncompatched there. Enter "WebApp", rename the newly generated directory "APR-0.9.4" or link to "APR". Open the terminal, into this directory: [root @ TFW-RFL40 root] # cd/opt/prog/tmp/jakarta-tomcat-connectors-4.1.30/webapp/apr [root @ TFW-RFL40 APR] # generated compilation profile : [Root @ TFW-RFL40 APR] # ./support/buildconf.sh ...... ...... [root @ TFW-RFL40 APR] # Configuration, Generate Compile Options: [Root @ TFW-RFL40 APR] # ./configure --with-apxs = "/ opt / prog / c / apache / bin / apxs" ... ...... [root @ TFW-RFL40 APR] # compiled, connected, to turn the source code into local binary code: [root @ TFW-RFL40 APR] # make ... ...... [root @ TFW-RFL40 APR] # into the directory "apache-2.0", if there is no mistake in front, there will be "mod_webapp.so", this is what needs Integrated plugin. If your Apache version is 1.3.x, the integrated plugin should be in "Apache-1.3". Modify the "MOD_WEBAPP.SO" property to the owner. Go to Apache installation directory "/ opt / prog / c / apache", copy the integrated plugin or move to the directory "Modules".
If the Apache version is 1.3.x, the integrated plugin is copied or moved to the directory "libexec". XX.1.3 Integrates the last step, let Apache work together with Tomcat and needs to modify the configuration file. XX.1.3.1 Apache Edit Apache's configuration file "http.conf", in its last added line: loadModule? WebApp_module? modules / mod_webapp.so If the Apache version is 1.3.x, add this line: loadModule? WebApp_module? Libexec / mod_webapp.so saves modifications. Check if the plug-in module can be loaded normally: [root @ TFW-RFL40 APCHE [root @ TFW-RFL40 Apache] # ./bin/apachectl -configtest If it can be loaded, The appearance appears: SYNTAX? OK [root @ TFW-RFL40 APR] # otherwise checks if there is an error or find other information. Edited "http.conf" again, continue to add the following two lines: ServerName Localhost: 8008 WebAme Localhost: 8008 WebAppConnection WarpConnection Warp localhost: 8008 Go to Tomcat's web app root directory, see which web application needs to be open, put them "WebAppDeploy Examples WarpConnection / App_X" forms a line of lines in the end of the configuration file "httpd.conf". I have to add: WebAppDeploy examples warpConnection / examples WebAppDeploy examples warpConnection / exampless WebAppDeploy examples warpConnection /typhoon.school xx.1.3.2 Tomcat Tomcat configuration file to the directory "/ opt / prog / m / tomcat / conf", with a text editor Open "Server.xml".
If this file has not been changed before, you can find such a paragraph, or similar paragraph:
Open the terminal, into this directory: [root @ TFW-RFL40 root] # CD / OPT / PROG / TMP [root @ TFW-RFL40 TMP] # 解压 缩: [Root @ TFW-RFL40 TMP] # tar zxvf jakarta-Tomcat- Connectors-jk2-src-current.tar.gz ...... ...... [root @ TFW-RFL40 TMP] # Generate compilation profile: [Root @ TFW-RFL40 TMP] # CD JAKARTA-TOMCAT-Connectors-JK2-SRC -current [root @ TFW-RFL40 JAKARTA-TOMCAT-Connectors-JK2-SRC-CURRENT] # CD JK [root @ TFW-RFL40 JK] # cd native2 [root @ TFW-RFL40 NATAVE2] # sh ./buildconf.sh ... ...... ... [root @ TFW-RFL40 Native2] # Configuration, Generate Compile Options: [Root @ TFW-RFL40 APR] # ./configure --with-apxs2 = "/ OPT / PROG / C / APACHE / BIN / APXS "-enable-eapi ... ...... [root @ tfw-rfl40 native2] # I don't know what this EAPI is, but I have successfully compiled this parameter. Compile, connect, turn the source code into local binary code: [root @ TFW-RFL40 APR] # make ...... ...... [root @ tfw-rfl40 native2] # 进 目 "JAKARTA-TOMCAT-Connectors-JK2-SRC -Current / Build / JK2 / Apache2, if there is no error in front, here there will be "mod_jk2.so", which is the integrated plugin required. If your Apache version is 1.3.x, the integrated plugin may be in "jakarta-tomcat-connection-jk2-src-current / build / jk2 / apache". Modify the "MOD_JK2.SO" property to the owner can be executed. Go to Apache installation directory "/ opt / prog / c / apache", copy the integrated plugin or move to the directory "Modules". If the Apache version is 1.3.x, the integrated plugin is copied or moved to the directory "libexec". XX.2.3 Integrates the last step, let Apache work together to work, need to modify the configuration file. XX.2.3.1 Apache edits Apache's configuration file "http.conf", in its last added line: loadModule? WebApp_module? modules / mod_jk2.so If the Apache version is 1.3.x, add this line: loadModule? WebApp_module? Libexec / mod_jk2.so saves modifications. Check if the plug-in module can be loaded normally: [root @ TFW-RFL40 APCHE [root @ TFW-RFL40 Apache] # ./bin/apachectl -configtest If it can be loaded, The appearance appears: SYNTAX? OK [root @ TFW-RFL40 APR] # otherwise checks if there is an error or find other information.
Open "Worker2.Properties". If the Apache version is not 2.0.49, replace its content to the following 21 lines: [SHM] info = scoreboard. Requied for reconfiguration and status with multiprocess servers. File = anon # defines a loading balancer named lb. Use even if you only Have ONE MACHINE. [lb: lb] # Example Socket Channel, Override Port and host. [Channel.socket: localhost: 8009] Port = 8009 Host = 127.0.0.1 # define the worker [AJP13: localhost: 8009] channel = channel .socket: localhost: 8009 group = lb # Map the Tomcat examples webapp to the Web server uri space [uri: / examples / *] group = lb [status:] info = Status worker, displays runtime information [uri: / jkstatus / *] info = the tomcat / jkstatus handler group = status: The above "Worker2.properties" content is above the 2.0.49 version. When the above text is placed into the file, in order to facilitate reading, it is allowed to pull the line spacing with the carriage return. Going to Tomcat's web application roots, see which web app is open to open, add them under "# map the tomcat examples webapp to the web server uri space", replacing the original "[URI : / examples / *] ". I added: [URI: / Examples / *] [URI: / EXAMPLES / *] [URI: /TYPHOON.SCHOOL / *] xx.2.3.2 Tomcat to Tomcat configuration file directory "/ opt / prog / m / Tomcat / conf "opens" server.xml "with a text editor.
If this file has not been changed before, you can find such a paragraph, or similar paragraph:
Open Tomcat Profile "Server.xml", also found this paragraph:
Code: Practice: Typhoon.free.wolf Declaration: Does not bear the resulting adverse consequences: V0.9.3 2004-03-30-01 This article (excluding link) can be reprinted in a non-commercial purpose. Below is the experience of I installation and initial trial PostgreSQL, focusing here. Installing I downloaded PostgreSQL7.3.4, which is the source code, saved as "/opt/lin_app02/tmp/download/postgreSQL/R1/PostgreSQL-7.3.4.TAR.GZ". After downloading, I opened the terminal (RXVT) in this directory, execute the command: [code] [root @ TFW-RFL40F R1] # tar zxvfp ./postgreSQL-7.3.4.tar.gz [/ code] get a directory "PostgreSQL-7.3.4". [code] [root @ TFW-RFL40F R1] # CD postgreSQL-7.3.4 [root @ TFW-RFL40F PostgreSQL-7.3.4] # ./configure --prefix = / opt / lin_app02 / postgres --enable-local - -ENABLE-MULTIBYTE --WITH-Perl --with-ODBC --with-TCL [/ code] ...... Top Step: ./configure configure does not add any options, the system will set up by default Install PostgreSQL, see the relevant options for configre can be used: Configure -help Some of the most commonly used: --prefix = basedir Select a different base path to install PostgreSQL. The default is / usr / local / pgsql. --enable-locale If you want to use localization support. --enable-multibyte Allows the use of multi-byte character encoding. This option is primarily used in Japanese, Korean or Chinese. --with-perl Add Perl module interface. Note that the Perl interface will be installed into the common position of the Perl module (typically in / usr / lib / perl), so you must have ROOT permissions. --with-ODBC makes an ODBC driver package. --With-TCL makes the interface libraries and procedures required for TCL / TK, including libpGTCL, PGTCLSH, and PGTKSH. These compilation parameters tell the compiler How to compile PostgreSQL: [code] [root @ TFW-RFL40F PostgreSQL-7.3.4] # Make [/ code] ... [code] [root @ TFW-RFL40F PostgreSQL-7.3. 4] # Make Install [/ code] ... The middle is not reported, and the installation is complete. Initialization Create a directory where a database file is created: [code] [root @ TFW-RFL40F PostgreSQL-7.3.4] # mkdir / opt / lin_app02 / postgre-data [/ code] To set the environment variable below. For security reasons, PostgreSQL is a privilegeous user such as "root". For convenience, I will manage PostgreSQL as the "Typhoon" of their daily work, but it is recommended that everyone creates a user for managing PostgreSQL. For convenience, I directly modified "/ etc / profile", but it is recommended to modify ".bash_profile" under the personal home directory.
I added the following in the environment variable file: [CODE] ################################################################################################################################################################################################################################################################################### #### # PostgreSQL LD_LIBRARY_PATH = / opt / lin_app02 / postgres / lib export LD_LIBRARY_PATH PGLIB = / opt / lin_app02 / postgres / lib PGDATA = / opt / lin_app02 / postgre-data PATH = $ PATH: / opt / lin_app02 / postgres / Bin manpath = $ manpath: / opt / lin_app02 / postgres / man export pglib pgdata path manpath ############################################################################################################################################################################################################################################################## ######### [/ code] Looks very trouble, actually the following format: ld_library_path = <- Prefix refers to the place> / lib export ld_library_path pglib = <- PREFIX refers to the place> / lib pgdata =
The latter "&" is best brought, otherwise, ...: - D said the startup method said is a formal method, PostgreSQL also provides a package control script "<- Prefix"> / bin / pg_ctl. [CODE] [Typhoon @ TFW-RFL40F Typhoon] $ PG_CTL -L ./123/pg.log start [/ code] If there is a "-l file name" parameter, all errors will be recorded in this file. [CODE] [Typhoon @ TFW-RFL40F Typhoon] $ PG_CTL STOP [/ Code] Stop service. Since it is stopped, don't take any record files. [CODE] [Typhoon @ TFW-RFL40F Typhoon] $ PG_CTL -L ./123/pg.log restart [/ code] is equivalent to "STOP" and "start". [CODE] [Typhoon @ TFW-RFL40F Typhoon] $ PG_CTL RELOAD [/ code] If you make changes to the configuration file, you want to take effect immediately, it will take effect immediately. Note: PostgreSQL administrators are best logged in from "Login:", XDM or KDM because if "su" past operations will not be performed normally. Come together with you. Here is the post I am installing: [URL] http://www.freeelamp.com/new/publish/1022414614/index_html [/ url] [URL] http://chinaUn ket/jh/18/546. HTML [/ URL] [URL] http://chinaunix.net/jh/18/548.html [/ url] I look at the "EGCS-C " mentioned in the link, and I haven't downloaded it, and I only know " EGCS-C "has been integrated into the" GCC "in the high version. My "GCC" is 3.2. If you have a "GCC", if you are more than 2.8, you don't want to find "EGCS-C " everywhere. After the initialization of safety management, there will be two files in the database directory: "postgreSQL.conf" and "pg_hba.conf". Modify "PostgreSQL.CONF" on the 30th line of the top "TCPIP_SOCKET = TRUE" to allow network access. "Pg_hba.conf", based on host access control (Host Based Access). The contents of "#" on the left are all commented, and the instructions or references can be used.
I told my current document as an example (inside Chinese for me): [Code] # posgreSQL Client Authentication Configuration File # ==================== =============================== # # Refer to the postgreSQL Administrator's Guide, Chapter "Client # Authentication" for a Complete Description . A short synopsis # follows # # This file controls:. which hosts are allowed to connect, how clients # are authenticated, which PostgreSQL user names they can use, which # databases they can access Records take one of three forms:. # # local DATABASE USER METHOD [OPTION] # host DATABASE USER IP-ADDRESS IP-MASK METHOD [OPTION] # hostssl DATABASE USER IP-ADDRESS IP-MASK METHOD [OPTION] # # (The uppercase quantities should be replaced by actual values.) # Database Can Be "All", "Sameuser", "SameGroup", A Database Name (or # a comma-separated there "@". # User can be "all", an actual user Name or a group name prefixed with # " " OR a list containing each. IP-address and ip-mask Specify The # set of hosts the record matches. Method Can Be "trust", "reject", # "md5", "crypt", "password", "kRB4", "KRB5", "Ident", or "PAM" . Note # That "Password" Uses Clear-text Passwords; "MD5"
is preferred for # encrypted passwords. OPTION is the ident map or the name of the PAM # service. # # This file is read on server startup and when the postmaster receives # a SIGHUP signal. If you edit the file on a running system, You have # to sighup the postmaster for the change # "pg_ctl rel). # p p u u u fr h --------------------- ------------- # # cast: The default configuration allows any local user to connect # using any postgresql user name, incruding the superuser, over each it either # UNIX-DOMAIN Sockets or TCP / IP. you are on a multiple-user # machine, the default configuration is probably too liberal for you. # Change it to use something other than "trust" authentication. # # If you want to allow non-local connections, you need to add more # "Host" Records. Also, Remember TCP / IP Connections Co. "TCPIP_SOCKET" in PostgreSql.conf. # Type Database User IP-Address IP-Mask Method # Access Database User IP-Address Subnet Mask authentication method local Typhoon Typhoon MD5 # For access to local access, database "Typhoon" to users "MD5" encryption password authentication local Typhoon All Reject # For from local Access, database "Typhoon" is unconditionally refused to verify that all users not mentioned above Host Typhoon Typhoon 255.255.255.255 127.0.0.1 MD5 # For network access, the database "Typhoon" is "type" "type", if the access is This machine uses "MD5" encryption password certification host type 0.0.0.0 0.0.0.0 reject # For access to the network, the database "Typhoon" is not mentioned above, no matter which machine proposed, no matter how Which subnet is it from?
Unconditional Denial Certified Local All All MD5 # For access from the local, the database that did not mention on the above adopted "MD5" encryption password certification host all all 0.0.0.0 0.0.0.0 md5 # for the network Access, the database did not mention the database on the above users, no matter which machine proposed, no matter which subnet it comes from, use "MD5" encryption password certification ######### ############################################################################################################################################################################################################### 0.0 0.0.0.0 TEJECT ########################## ######################## ######################################################################################################################################################################################################################################################################################################### Not safe, I was banned, only as a reference #local all all trust #host all all, 0.0.0.0 0.0.0.0 Trust ################################################################################################################################################################################################################################################################# ################## [/ code] These authentication rules are loaded from top to the next one, pay attention to, "all" inside is not true "All", just the part not mentioned in the previous specified. Personally feel more appropriate to use "other". In this way, the final result is that all users can access databases other than "Typhoon" through the encryption password, but only the user "Typhoon" can access the database "Typhoon" with the encryption port.
Operating article [Client Basic Connection Operation] ======================================================================================================================= Host Name / IP] -D [Database Name] -u [User Name] * Connect to another Database: / C [Database Name] * Disconnect Terminal: / Q ============= =========================== [basic user management] =================== ======== * Add User: CREATE User [User Name]; * Modify User Password: ALTER USER [User Name] with Password [Password]; * Delete Users: Drop User [User Name]; * View User Information: (Drain / Find) ========================================】 Database operation] ======================== * Create a database: CREATE DATABASE [Database Name]; * View Database List: / D * Remove Database: Drop: Drop Database [Database Name]; * Modify the owner of the database: (in the exploitation / lookup) =============================== ========= [Basic operation in the database] =============================================================================================================================================================================================================================================================================== Talking / Finding) * Remove the authorization of a user creation table in a database: (in the exploitation / lookup) Create a table: CREATE TABLE ([Field Name 1] [Type 1]
/ d [table name] * Rename a table: ALTER TABLE [Name A] Rename to [Table Name B]; * Modify the owner of the table: (explore / lookup) * Delete a table: Drop Table [Name ]; ================================================================================================================================================================================================= ======================== * Add fields to existing tables: alter table [Table name] Add column [field name] [type]; * Remove the fields in the table: ALTER TABLE [Table] DROP Column [Field Name]; Rename a Field: Alter Table [Name] Rename Column [Field Name A] To [Field Name B]; * Give a field Setting the default: ALTER TABLE [Name] Alter Column [Field Name] Set Default [New Default]; * Removal Default: ALTER TABLE [Table Name] ALTER Column [Field Name] DROP DEFAULT; * will have There is a list of existing tables to the primary code: (explore / lookup) * Set a few columns in the existing table to the primary code: (explore / look up) * Cancel a column of principled code qualification: (exploit / Finding) Insert data in the table: INSERT INTO table name ([Field Name M], [Field Name N], ...) VALUES (value of [column M], [Value N value] ,. .....); Modify the data of a column in the table: Update [Table Name] set [Target Field Name] = [Target Value] Where [Line Features]; Delete A line of data in the table: delete from [Table name] WHER [Bill "; delete from [table]; - Delete the entire table ========================== ============== [backup] ================================================================= = Backup a database: pg_dump Database Name> Backup file Guide backup file to the original database or import new Database: CAT Backup file | PSQL database name is best to change this database to "trust".