Apache+php+mysql

Source: Internet
Author: User
Tags configuration settings

Installation of 2.Apache Httpserver
Apache Httpserver software downloaded from the Internet generally has two forms: MSI and zip.
For the MSI format installation package, the installation will install itself, the Apache HTTP Server service (service name is Apache) and Apache HTTP server monitoring software Apachemoniter. The installed services and monitoring software are automatically started by default.
For the ZIP format installation package, first unzip the package to the location you want to unzip. Before you manually install the Apache HTTP Server service, configure the Apache HTTP server to use the httpd.conf file under the Conf folder of the Apache HTTP Server software, where the path is split in the configuration file. “/”:
ServerRoot "D:/myapps/apache", set the root directory of the Apache HTTP server server Software, which is the current directory containing the folder bin,logs,conf
Listen 80 Set the port number to be monitored by the Apache httpserver server
DocumentRoot "D:/www"
<directory "D:/www" >
...
</Directory>
Set the Web root directory of the Apache HTTP server server and set the root directory permissions for the Web page, DocumentRoot set the path of the Apache HTTP Server Web page root to "d:/www", <directory "d:/ www "> Set the Apache HTTP Server server to read and write permissions to the directory d:/www. The directories in these two lines are set to the same.
After the configuration is complete, you can install the Apachehttp Server service, open a command prompt, switch to the directory where the Httpd.exe file is located, and enter:
Httpd.exe–k Install–n Apache
The Apache Httpserver Service is installed on the computer and the service name is Apache. -k Install, installation service,-K Uninstall uninstall service,-N, service name.
Turn on Apachemoniter.exe to monitor the Apachehttp Server service, and to enable it to boot automatically, You can create a shortcut to the Apachemoniter.exe, and then copy the shortcut to the startup directory of the Start menu to enable the boot to start automatically.
Create a new index.html file in the root directory of the Web site you just configured, and write:
<body>
</body>
Here, the basic configuration of APACHE Httpserver is complete, open the browser, input: localhost, enter, Hello world! should be displayed in front of you.
Configuration of PHP
1. Download of PHP
can go to www.php.net download php,php nts and TS Two, that is, non-thread-safe and thread-safe.
NTS version of PHP single-threaded run, without thread security check, running high efficiency, mainly for debugging development, if you configure the production environment, do not use this version. And in the Apache HTTP server environment, only CGI mode can be used.
The TS version can be run in multiple threads, stable and secure, and can be used in production environments. In the Apache HTTP server environment, it can be loaded as Apache HTTP Server block, or it can be run in CGI mode.
Note PHP also has versions compiled with different VC + + release libraries, preferably with Apache HTTP server using the same compiled version of the library.
2. Configure PHP
The PHP configuration file is php.ini. If you configure the development environment, rename the php.ini-development to PHP.ini, and if you configure the production environment, rename the php.ini-production to php.ini.

; Extension_dir = "ext" Removes the semicolon in front of the statement and modifies the absolute path to the PHP extension, such as
PHP Root is D:\PHP, this statement is: extension_dir= "D:/php/ext"
Extension=php.xxx.dll the comments before the statement to load the corresponding modules according to their own needs.
PHP can be run in the Apache HTTP Server module and CGI mode, the following two cases of the Apache HTTP server configuration is described.
(1). PHP runs in Apache HTTP server module mode
Modify Apache HTTP Server configuration file httpd.conf
LoadModule php5_module "D:\PHP\php5apache2_4.dll" loads PHP's Apache support module, which is selected according to the version of the Apachehttp server,
Phpinidir "D:\PHP\php.ini" to set the path of the PHP configuration file php.ini
DirectoryIndex index.phpindex.html Web site default load file, add index.php
AddType application/x-httpd-php. PHP Add PHP Format file support

(2). PHP runs in CGI mode
Modify Apache HTTP Server configuration file httpd.conf
DirectoryIndex index.phpindex.html Web site default load file, add index.php
AddType application/x-httpd-php. PHP Add PHP Format file support
scriptalias/cgi-bin/"d:/myapps/php/" sets the alias of the Cgi-bin, which is the directory where php-cgi.exe resides
<directory "d:/myapps/php" >
Allowoverridenone
Options None
Require allgranted
</Directory> set the Read and write permissions for the PHP root directory
Action application/x-httpd-php "/cgi-bin/php-cgi.exe" to parse files in PHP format by php-cgi


mysql:http://dev.mysql.com/downloads/installer/
1, the first entry is the installation of the boot interface

2, then enter the type selection interface, there are 3 types: typical (typical), complete (full), custom (customized). It is recommended to choose "Custom" installation, so that you can customize the installation directory to select MySQL, and then click "Next" Next, there is a custom installation interface, for data security purposes, it is not recommended to install MySQL system disk C directory.

3. Ready to install

4, the installation will appear after the MySQL configuration of the boot interface

5. There is a boot configuration mysql option (luanch the MySQL Instance configuration Wizard), it is recommended to tick configure your MySQL now

6. Here is the type of MySQL configuration configured for MySQL, you can choose between two configuration types: detailed configuration (verbose) and standard configuration.
The standard configuration option is suitable for new users who want to start MySQL quickly without having to consider the server configuration. Detailed configuration options are suitable for advanced users who want finer granularity in controlling server configuration.
If you're new to MySQL and need a server configured as a single-user developer, standard configuration should suit your needs. With the standard configuration option selected, the MySQL Configuration Wizard automatically sets all configuration options, but does not include service options and security options.
The standard configuration settings option may not be compatible with the system on which MySQL is installed. If MySQL and the installation you want to configure are already installed on your system, it is recommended that you choose a detailed configuration.
Here I choose is detailed Configuration, want to better complete the customization.


7. Here is the MySQL server type to configure MySQL, you can choose 3 kinds of server type, choose which kind of server will affect the memory, hard disk and process or use decision of MySQL Configuration Wizard.
Developer machine: This option represents a typical personal desktop workstation. Assume that there are multiple desktop applications running on the machine. Configure the MySQL server to use minimal system resources.
Server machine: This option represents a server that the MySQL server can run with other applications, such as FTP, email, and Web servers. The MySQL server is configured to use the appropriate scale of system resources.
Dedicated MySQL server machine (dedicated MySQL servers): This option represents a server that only runs the MySQL service. Assume that the run is not running other applications. The MySQL server is configured to use all available system resources.
Here I choose is developer machine, mainly for the usual development of the need.

8, here is the configuration of MySQL database usage, you can indicate the table processor used when creating the MySQL table. With this option, you can choose whether to use the InnoDB storage engine, and how much of the server resources the InnoDB occupies.
Multifunctional database: Select this option to use both the InnoDB and MyISAM storage engines and distribute resources evenly between the two engines. This option is recommended for users who frequently use two storage engines.
Transactional database only (transactional databases only): This option uses both the INNODB and MyISAM storage engines, but most server resources are assigned to the InnoDB storage engine. It is recommended that you select this option primarily using InnoDB only occasionally with MyISAM users.
Non-transactional database only (non-transactional databases only): This option completely disables the InnoDB storage engine and assigns all server resources to the MyISAM storage engine. It is recommended that you do not use InnoDB to select this option.
I chose the multifunctional Database.

9. Here is the InnoDB table space for MySQL, some users may want to put the InnoDB tablespace file in a different location instead of the MySQL server data directory. If your system has a larger space or a higher-performance storage device (such as a RAID storage system), it is a good idea to put the tablespace file in one place alone. To change the default location for the InnoDB tablespace file, select a new drive from the drive drop-down list and select a new path from the Path drop-down list. To create a path, click ... Button. If you want to change the configuration of an existing server, you must click the Modify button before changing the path. Before starting the server, you must move the existing Tablespace file to the new location. I choose the default configuration.

10. Here is the concurrent connection to configure MySQL, it is important to limit the number of concurrent connections created to the MySQL server in order to prevent the server from running out of resources. You can select how the server is used and limit the number of parallel connections as appropriate. You can also manually set restrictions for parallel connections.
Decision Support (DSS)/olap: This option can be selected if the server does not require a large number of parallel connections. Assume that the maximum number of connections is set to 100, and the average number of parallel connections is 20.
Online Transaction processing (on-line transaction processing) (OLTP): Select this option if your server requires a large number of parallel connections. The maximum number of connections is set to 500.
Manual Setting (Manual setting): Select this option to manually set the maximum number of server parallel connections. Select the number of parallel connections from the previous drop-down box, and if the number you expect is not in the list, enter the maximum number of connections in the drop-down box.
Here according to individual needs, I choose is manual Setting.


11, here is the network option to configure MySQL, you can enable or disable the TCP/IP network and configure the port number used to connect to the MySQL server. TCP/IP networking is enabled by default. To disable TCP/IP networking, deselect the check box next to the Enable TCP/IP networking option. 3306 ports are used by default. To get more access to the port used by MySQL, select a new port number from the drop-down box or enter the new port number directly from the drop-down box. If the port number you selected is already occupied, you will be prompted to confirm the selected port number, and if other machines need access to the database, it is recommended to tick add firewall exception for this port (added to the firewall exception).

12, here is the configuration of MySQL character set, MySQL server supports a variety of character sets, you can set the default server character set for all tables, columns and databases. You can change the default character set of the MySQL server by character set (character Set dialog box).
Standard Character set (normal character Set): Select this option if you want to use Latin1 as the default server character set. Latin1 is used in English and many Western European languages.
Best supports for multilingualism (multiple languages): Select this option if you want to use UTF8 as the default server character set. UTF8 can store characters in different languages as a single character set.
Manual Selected default Character set/collation (manually selected defaults/proofing rules): Select the default character set for the server if you want to manually select it. Select the desired character set from the drop-down list.

13. Here is the service option to configure MySQL, you can install the MySQL server as a service. Installed as a service, the system can start automatically when the MySQL server, or even in the event of a service failure can be automatically started with Windows.
By default, the MySQL configuration Wizard installs the MySQL server as a service and the service name is MySQL. If you do not want to install the service, cancel the Select box next to the Install as Windows service option. You can change the service name by selecting a new service name from the drop-down box or by entering a new service name in the drop-down box. To install the MySQL server as a service, but do not start automatically, uncheck the check box next to launch the MySQL server automatically option.

14. Here is the security option to configure MySQL, it is strongly recommended that you set a root password for your MySQL server, and by default the MySQL Configuration Wizard requires you to set a root password. If you do not want to set the root password, uncheck the box next to the Modify security Settings (Modify safe setting) option. To set the root password, enter the desired password in the new root password (enter a password) and confirm (confirm) two boxes. If you reconfigure an existing server, you will also need to enter the existing root password in the current root password (root password) box. To prevent logging on through the network as root, check the box next to the option root for connect from localhost (allow only native login connection root). This will improve the security of the root account. To create an anonymous user account, check the box next to the Create a Anonymous account (creating anonymous Accounts) option. Creating an anonymous account can reduce the security of the server and cause difficulties in login and licensing. It is therefore not recommended.

15, confirm, click Excute to complete the installation

Apache+php+mysql

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.