[Original] Web Server Configuration

xiaoxiao2021-03-06  70

The basic application of various web servers and the basic applications of the three web languages ​​(ASP, PHP, JSP) must be clear, and I have three kinds of ASP (IIS) PHP (Apache) JSP (Tomcat) on a single machine. Environment, and Oracle9i, SQL2000, MySQL three databases for three languages!

System default 2000 Server IIS, IP: 192.168.0.1

1. Install SQLServer2000 (remember to set a mixed identification method, and set your password for SA)

2. Install Oracle9i (Novice Please refer to the installation of Oracle on the Internet)

3. Install mysql to c: / mysql

I have installed mysql-3.23.56-win.zip and myodbc-3.51.06.exe, just in the fool installation, don't forget to set your password for the root!

4. Install Apache to debug PHP

To avoid conflicts with Apache, change the IIS port to 81 (or stop IIS first), install apache2.0.43 for Win32

Then modify httpd.conf

1) DocumentRoot change to its own website

2) Add support for PHP

At the end of httpd.conf, the statement is added

#Php configure ## begin ##

Scriptalias / PHP / "C: / PHP4 /"

AddType Application / X-httpd-php .php

Action Application / X-httpd-php "/ php/Php.exe"

#Php configure ## End ##

3) Find Alias, add

Alias ​​/ CXL34 "D: / Web / Apache"

Options Indexes Followsymlinks MultiViews Includesnoexec

AddOutputFilter Includes HTML

ALLOWOVERRIDE NONE

ORDER ALOW, DENY

ALLOW FROM ALL

To build a virtual directory

4) Modify DirectoryIndex INDEX.PHP

DirectoryIndex Index.html

DirectoryIndex Index.htm

DirectoryIndex default.php

DirectoryIndex default.htm

5) Find adddefaultcharset ISO-8859-1 changed to #adddefaultcharset ISO-8859-1

AddDefaultCharset GB2312 can support Chinese coding by default!

6) Establish a simple HTML web page test in the website directory!

5. Install PHP-4.3.1-Win32.zip

1) Unzip into C: / PHP4, copy all DLL to System32

2) Copy php.ini and php.exe to C: / WinNT

3) Modify PHP.INI:

EXTENSION_DIR = C: / PHP4 / EXTENSIONS /

INCLUDE_PATH = "C: / PHP4 / Includes"

Register_globals = on

EXTENSION = php_exif.dll

EXTENSION = php_zlib.dll

EXTENSION = php_gd.dll

Extension = php_calendar.dll

EXTENSION = php_imap.dll

EXTENSION = php_ldap.dll

Extension = php_mssql.dll

If there is no DLL, it is not set. 4) In the directory of Apache, establish Index.php with phpinfo (); test! ! !

6. Install JDK1.43 and Tomcat4.1

1) Suppose JDK is installed in D: / Webs / JDK, then install Tomcat to D: / Tomcat 4.1, Tomcat is best set to Windows start service!

2) Right-click "My Computer", select "Properties" -> "Advanced" -> Environment Variables "-> System Variables, add ClassPath, value D: /Webs/jdk/lib/tools.jar; D: /Webs/jdk/lib/dt.jar; D: / Webs / Tomcat 4.1 / Common / Lib, add PATH, value D: / Webs / JDK; D: / Webs / JDK / BIN, OK!

3) Modify the server.xml file under Tomcat4.1 / conf, add and saved, set your own virtual directory! Restart the modification take effect!

4) Built Index.jsp under D: / Test

<% @ Page ContentType = "Text / HTML; Charset = GBK"%> <% INT i; for (i = 1; i <= 10; i ) {Out.Println (" " i "
");}%>

Test the Chinese display here!

In the browser, you will see INDEX.JSP!

To this end, the required software has been installed, which is the case of debugging three languages ​​and accessing the database! Establish the three directories of ASPWeb, PHPWeb, JSPWeb first, then set IIS, Apache and Tomcat, point to these three directories, then build ASPWEB, PHPWEB, JSPWEB three databases, respectively, and build several tables, As for how to operate these three databases, please check the relevant information yourself!

1. Debug IIS ASP About IIS is relatively simple, it is no longer cumbersome, built index.asp in the directory, and then tests 192.168.0.1:81 (requires ASP knowledge); 2. Access SQL2000 with ASP is established in SQL2000 aspweb a database table and user1 to establish a common database file conn.asp <% strSQLServerName = "localhost" strSQLDBUserName = "sa" strSQLDBPassword = "******" strSQLDBName = "aspweb" Set conn = Server.CreateObject ( "ADODB .Connection ") strCon =" Provider = SQLOLEDB.1; Persist Security Info = False; Server = "& strSQLServerName &"; User ID = "& strSQLDBUserName &"; Password = "& strSQLDBPassword &"; Database = "& strSQLDBName & ";" Conn.open strconfunction closedatabaseConn.closeset conn = nothingend function%> In debugging page <% set = server.createObject ("AdoDb.Recordset ") RS.Open" User1 ", CONN, 1, 3 ....%> 3.asp Access Mysql (no need, test) first log in to Mysql, establish an ASPWEB database and user1 table <% strConnection =" defaultdir =; Driver = {myodbc driver}; database = aspweb "Set adoDataConn = Server.CreateObject (" ADODB.Connection ") adoDataConn.Open strConnection strQuery =" SELECT * FROM user1 "Set rs = adoDataConn.Execute (strQuery) If Not rs.BOF Then .... rs.closeadodataconn.close set adodataconn = Nothing set rsemails = Nothing%> 4.asp Access Oracle {} 5. Debug Apache PHP has been talked, in the Apache directory, build index.php, Use phpinfo (); test (requires php knowledge), 192.168.0.1! 6.php Access Mysql creates a phpWeb database and user1 table in PHP

Unable to connect to the database server! "); $ query =" select * from user1 "; $ results = mysql_db_query (" phpweb ", $ query, $ ID); echo ($ result);?> 6.php Access SQL2000 created a phpWeb database in SQL2000 and USER1 Table 7.php Access Oracle {} 8. Debug JSP Tomcat has already mentioned 9.jsp Access SQL200010.JSP Access MySQL11.jsp Access Oracle12. Admission: 1) ASP and JSP Combination Access databases are also excellent for some small applications, but the connection between the two is relatively simple, installing Access is simpler, please check the information yourself! 2) PHP can also be configured under IIS. And debugging, but familiar with apache is very helpful to Hack activities, so introducing the apache debug php.3) can be installed in the phpweb directory, and the operation of the MySQL database is simple; 4) Configuring CGI under IIS now Less than you, so no longer introduce! 13. Summary: The above focuses on the configuration of the three environments and three languages ​​to three databases, but actual applications ASP / JSP Access (suitable for small applications) These combinations of ASP SQL2000, PHP MYSQL, JSP Oracle. 14. Finally introduce the configuration of the ASP.NET environment! 1) ASP.NET can only run on XP Pro, 2000 Server, Server.NET Here, only the debugging of 2000 Server is introduced here.

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

New Post(0)