Installing Apache2, PHP5, MySQL5, and resin with windows on the integration of multiple systems _linux

Source: Internet
Author: User
Tags anonymous character set install php php script win32 phpmyadmin root access
Behold bumpy many, so feel the need to record down, one for the memo, and secondly hope to help later, avoid unnecessary detours. My installation procedures also refer to the experience of many predecessors, in this together to express our gratitude.

In addition, before going to the point, say a few more digression. The following installation integration in the Apache2.2, PHP5, MySQL5, resin-3.1.10 test through, but given the different operating environment of each PC itself, and can not guarantee that according to the author of the process will be able to successfully install the operation on each computer. So in accordance with this process to install friends encounter problems, please go through Google, Baidu solution. Because someone else's article in the successful completion of the installation, in the author's computer is unable to run, the problem is also bizarre, there is no reason to say. The following process of the author walked less than 10, during which bumps, repeated, loading and unloading unloading, repair modification, not by exclamation of the programmer work tedious trivial, thinking that if the programmer can be persistent spirit, tenacious will, perseverance to do other things, everything!

OK, let's get down to business.

First, install Apache 2.2.14

1, run the installation program, all the way "next" to "Server information", the first two have domain name fill domain name, no domain name can fill localhost (also can fill in), the rest accept the default option, press "Next" to continue.

2, choose the installation type, if you need to change the default program installation directory, select Custom installation, or choose typical for default installation. Here I choose Custom, press "Next" to continue.

3, the selection of installation options interface, click the "Change ..." to specify the installation directory, press "Next" to continue.

4, confirm the installation option is correct, press "Install" to start installation. When the Setup Wizard completes successfully, a new small icon appears in the lower-right corner of the status bar, which is set to "start" to indicate that the Apache service has started running and is finished by "finish".

5, in the browser input http://localhost/, if display "It works!", indicating that Apache has been able to work properly. If it is not displayed, or prompts for errors, or the green light of the Apache small icon is not lit, the system 80 port may be occupied. Then you need to find the cause of the error, the general situation may be IIS, thunder and other software occupies 80 ports, the software can be closed.

Second, install php-5.2.5

1, the compression of the PHP package to the designated folder, the author will extract it to D:\dev\php.

2. Rename the php.ini-recommended file to php.ini and modify its contents at the same time:
(1);d efault_charset = "Iso-8859-1" instead: Default_charset = "Utf-8";
(2) Extension_dir = "./" instead: Extension_dir = "D:/dev/php/ext";
(3) Find Memory_limit = 128M, modify the value of the PHP script to limit the maximum memory size occupied;
(4) Select the module to load according to the requirement, by removing the preceding number, which can usually be loaded with the following modules:
Extension=php_gd2.dll
Extension=php_mbstring.dll
Extension=php_mhash.dll
Extension=php_mime_magic.dll
Extension=php_ming.dll
Extension=php_mysql.dll
Extension=php_xmlrpc.dll

3, add the PHP installation path to the Windows system path, in the "My Computer" right click to select "Properties", in the System Properties window by the "Advanced" tab, click "Environment Variables", under "system variables" to find the "Path" variable, ";D: \dev\ Php;d:\dev\php\ext "added to the last side of the original value (the specific path is modified according to the actual installation path), and the restart is effective after the modification.

4, the Apache configuration file httpd.conf make the following modifications:
(1) Find DocumentRoot "X:/xxx/htdocs" and <directory "X:/xxx/htdocs" > (the address in quotation marks is filled out according to the personal installation path), change "X:/xxx/htdocs" to the folder that the website holds , I hereby change it to DocumentRoot "d:/www" and <directory "D:/www" >
(2) Find LoadModule, add below
LoadModule php5_module "D:/dev/php/php5apache2_2.dll"
Phpinidir "d:/dev/php"
(3) to locate <ifmodule dir_module> DirectoryIndex index.html </ifmodule&gt, and change it to:
<ifmodule dir_module>
DirectoryIndex index.php index.phtml index.html index.jsp
</IfModule>
(4) Find "AddType application/x-gzip. gz. tgz", added below:
AddType application/x-httpd-php. php. phtml
AddType application/x-httpd-php. html

5, create the index.php file in D:\www, the contents are as follows:
<?php
Phpinfo ();
?>
Restart Apache, enter http://localhost/in the browser, and if the information about PHP is displayed, Apache already supports PHP.

Iii. installation of mysql-5.0.41

1, run the installer, select "Custom" mode, the MySQL installation path to D:\dev\MySQL, and then the way "Next".

2, the installation is completed after the prompt "Configure the MySQL Server now", the check and click "Finish".

3, in the start of the MySQL Configuration Wizard, select the "Detailed Configuration" configuration, press "Next" to continue.

4, select the server type, "Developer Machine (development test type, MySQL takes very little resources)", "Server Machine (servers type, MySQL occupies more resources)", "dedicated MySQL server Machine (dedicated database server, MySQL consumes all available resources) ", choose according to your own needs. The author is mainly to test the program, here Select "Developer Machine", press "Next" to continue.

5, choose the use of MySQL database, "Multifunctional db (Universal multi-function Type)", "Transactional database only (focus on transaction processing type)", "non-transactional Database only (non-transactional) ", according to their own use to choose. The author chooses "Multifunctional Database", press "Next" to continue.

6, the InnoDB tablespace configuration, is to InnoDB database files to choose storage space. I use the default location here, press "Next" to continue.

7, the MySQL approximate number of connections to configure, "Decision Support (DSS)/olap (20)", "Online Transaction Processing (OLTP) (500 or so)", "Manual Setting (set number Manually) ". The author chooses "Decision Support (DSS)/olap" for the debugger only, press "Next" to continue.

8, check enable TCP/IP connection, default port 3306, press "Next" to continue.

9, the MySQL database default encoding settings, the first is the western code, the second is UTF8 encoding, the third is manual configuration. The author chooses the third one, and selects "GBK" at the character set, press "Next" to continue.

10. Set MySQL as a Windows service, specify service name (the name of the services identity), and add the MySQL bin directory to Windows path (you will be able to use the commands in the bin directory directly in the DOS window when you join). You no longer need to enter the full address. I check all of this here, Service name is not changed by default, press "Next" to continue.

11, set the root user password (the default is empty), in the "New root password" fill in the password (if it is a reload and has previously set the password, where the password may be changed, please leave blank and the "Modify security Settings" in front of the hook removed, Change Password After installation configuration is complete. Alternatively, "Enable root access from remote machines (allow root remote login)", and "Create a Anonymous account (create a new anonymous user)", generally do not check. Set up and press "Next" to continue.

12, confirm the setting is correct. Press ' Execute ' to make the settings effective. Set complete and press Finish to finish.

13. Create testconn.php files in D:\www, as follows: (* * for root user password):
<?php
mysql_connect ("localhost", "root", "* *") or Die (Mysql_error ());
echo "Connected to mysql<br/>";
?>
Enter http://localhost/testconn.php in the browser and if connected to MySQL is displayed, the connection to MySQL is successful.

Iv. installation of phpMyAdmin-3.2.5

1, the phpMyAdmin compression package decompression in the designated folder, the author will extract it to D:\www\phpmyadmin, The config.default.php in the libraries directory is copied to the phpMyAdmin directory and renamed to config.inc.php.

2, the config.inc.php document to make the following modifications:
(1) The $cfg [' Servers '] [$i] [' auth_type '] = ' config '; To
$cfg [' Servers '] [$i] [' auth_type ']= ' http ';
(2) Replace the $cfg [' Servers '] [$i] [' password '] = ' to:
$cfg [' Servers '] [$i] [' password '] = ' * * ' (* * password for MySQL)

3, open the Apache configuration file httpd.conf, find # Alias/webpath/full/filesystem/path, add the following code (specific path according to the circumstances modified):
Alias/phpmyadmin "D:/www/phpmyadmin"
Copy Code code as follows:

<directory "D:/www/phpmyadmin" >
AllowOverride None
Options None
Order Allow,deny
Allow from all
</Directory>

Restart Apache and open http://localhost/phpmyadmin in the browser. Enter the Administrator account (root) and the corresponding password in the dialog box that appears, and if you successfully log on and open the phpMyAdmin interface, the installation is complete.

V. Installation of ZendOptimizer-3.3.3

Zendoptimizer installation is simpler, just follow the prompts to select the installation path, tick the apache2.x, and set the root of the project. When the installation is complete, enter http://localhost/in the browser to see the Zend information.

Vi. integrating Apache with resin and configuring virtual Hosts

The author of the computer in resin already exist two projects, assuming that one named Tieba, another named Zhidao, now need to consolidate the Phpwind forum system, and realize the following Web site can be used to access the corresponding system: tieba.aaa.com, Zhidao.aaa.com, bbs.aaa.com.

1. Modify the Hosts file in the C:\WINDOWS\system32\drivers\etc directory to add:
127.0.0.1 tieba.aaa.com
127.0.0.1 zhidao.aaa.com
127.0.0.1 bbs.aaa.com

2, into the resin installation directory Win32 subdirectory, run Setup.exe. Check the Apache checkbox in the Resin Setup window and fill in the Apache installation directory in the following input box, and press OK to confirm.
3, the Apache configuration file httpd.conf make the following modifications:
(1) LoadModule caucho_module "D:/dev/resin-3.1.10/win32/apache-2.0/mod_caucho.dll"
Modify it to:
LoadModule caucho_module "D:/dev/resin-3.1.10/win32/apache-2.2/mod_caucho.dll"

(2) Remove the # number in front of the #servername localhost:80.

(3) The <directory "D:/www" > Modified to <directory/>.

(4) Remove the Indexes from the options Indexes followsymlinks and do not display the list of directories.

(5) Remove the # #include conf/extra/httpd-vhosts.conf before opening the virtual host configuration.

4. The following modifications are made to the httpd-vhosts.conf documents in D:\dev\Apache2.2\conf\extra:
(1) Change the namevirtualhost *:80 to Namevirtualhost localhost:80, if the Internet service is officially enabled, the localhost can be replaced with the IP address of the server.

(2) Start to configure the virtual host, a domain name corresponding to a <virtualhost>
Copy Code code as follows:

<virtualhost bbs.aaa.com:80>
ServerName bbs.aaa.com
DocumentRoot D:/www/phpwind
</VirtualHost>

<virtualhost tieba.aaa.com:80>
ServerName tieba.aaa.com
DocumentRoot D:/dev/resin-3.1.10/webapps/tieba
Resinconfigserver 127.0.0.1 6800
</VirtualHost>

<virtualhost zhidao.aaa.com:80>
ServerName zhidao.aaa.com
DocumentRoot D:/dev/resin-3.1.10/webapps/zhidao
Resinconfigserver 127.0.0.1 6800
</VirtualHost>

5, the Resin configuration file resin.conf make the following modifications:

(1) The
(2) Configure the host as follows:
Copy Code code as follows:

<web-app id= "/" root-directory= "D:/dev/resin-3.1.10/webapps/tieba"/>
<stderr-log path= ' d:/dev/resin-3.1.10/logs/stderr.log ' rollover-period= ' 1W '/>
<stdout-log path= ' d:/dev/resin-3.1.10/logs/stdout.log ' rollover-period= ' 1W '/>
<web-app id= "/" root-directory= "D:/dev/resin-3.1.10/webapps/zhidao"/>
<stderr-log path= ' d:/dev/resin-3.1.10/logs/stderr.log ' rollover-period= ' 1W '/>
<stdout-log path= ' d:/dev/resin-3.1.10/logs/stdout.log ' rollover-period= ' 1W '/>

Restart Apache and resin, now you can directly use tieba.aaa.com, zhidao.aaa.com, bbs.aaa.com these three domain names to access the corresponding project.

Using Apache rewrite rules to implement URL pseudo-static

In the implementation of the integration of Apache and resin, because the Apache URL with HTML priority to intercept, it may lead to the original to optimize the site URL in the resin system in the pseudo static settings, and then need to pass the Apache Rewrite rules are reset. Here is an example of the URL in the Tieba project, which is described in the following steps:

1, in the httpd.conf, find #loadmodule rewrite_module modules/mod_rewrite.so, the front of the # removed.

2. In the httpd-vhosts.conf, find the <virtualhost tieba.aaa.com:80&gt, modify it to:
Copy Code code as follows:

<virtualhost tieba.aaa.com:80>
ServerName tieba.aaa.com
DocumentRoot D:/dev/resin-3.1.10/webapps/tieba
Resinconfigserver 127.0.0.1 6800
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewriterule ^/tie/(\d+). html$/do/viewthread?id=$1 [l,pt]
</IfModule>
</VirtualHost>

In this way, it is possible to implement the URL pseudo static http://tieba.aaa.com/tie/77.html similar to http://tieba.aaa.com/do/viewthread?id=77. It is important to note here that [l,pt] must be written after the rule, otherwise the/do/viewthread?id=$1 will be treated as a directory structure without being parsed by resin. I have been entangled here for a long time, and I remember it later.

Well, from top to bottom such a process came, completed in Windows for Apache2, PHP5, MySQL5, phpMyAdmin, Zendoptimizer installation and configuration, and the implementation of Apache and resin integration, Virtual host configuration and URL pseudo static processing. Next, I will be free to summarize how the data in Oracle is quickly and conveniently imported into MySQL, and how to integrate the existing JSP Web site with the Phpwind forum to achieve synchronous login and synchronous Exit function.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.