Server core + IIS7 + PHP FastCGI + mysql + eAccelerator

Source: Internet
Author: User

1. Activate server core
 
Slmgr. vbs # view all parameters
Slmgr. vbs-ipk <Product Key> # does not include <>. The Product Key can be applied online.
Slmgr. vbs-ato # activate
 
Ii. Change the computer name
 
Netdom renamecomputer./newname: www.jxxx.edu.cn
Shutdown-r-t 0
 
Iii. Network Settings
 
Netsh interface ipv4 show interfaces # view network settings
Netsh interface ipv4 set address name = 2 source = static address = 10.10.10.2 mask = 255.255.255.0 gateway = 10.10.10.1 # set the IP address of the first Nic
 
Netsh interface ipv4 set dnserver name = 2 source = static address = 222.16.80.34 primary # preferred DNS
Netsh interface ipv4 add dnsserver name = 2 address = 202.102.227.68 index = 2 # secondary DNS
 
4. Enable Remote Desktop
 
Cscript. c: \ windowssystem32 \ scregedit. wsf/ar 0 # new version supported
Cscript. c: \ windowssystem32 \ scregedit. wsf/cs 0 # old versions supported
Netsh advfirewall firewall set rule group = "Remote Desktop" new enable = yes # enable remote desktop through firewall
 
5. Set Automatic Updates
 
Cscript. c: \ windowssystem32 \ scregedit. wsf/au 4
Cscript. c: \ windowssystem32 \ scregedit. wsf/au/v
 
6. Install IIS7
 
(1) pkgmgr installation:
Start/w pkgmgr/iu: IIS-WebServerRole; IIS-WebServer; IIS-CommonHttpFeatures; IIS-StaticContent; IIS-DefaultDocument document; IIS-HttpErrors; IIS-ApplicationDevelopment; IIS-CGI; IIS-HealthAndDiagnostics; IIS-HttpLogging; IIS-Performance; IIS-HttpCompressionStatic; WAS-WindowsActivationService; WAS-ProcessModel
(2) ocsetup installation:
Start/w ocsetup IIS-WebServerRole
Start/w ocsetup WAS-WindowsActivationService
Start/w ocsetup IIS-CGI
 
7. install PHP
 
(1) download the PHP noinstall installation package and decompress it to the corresponding location, for example, c: \ php.
Select php. ini-dist as the default php configuration file and run copy c: \ php. ini-dist c: \ Windows \ php. ini.
(2) Modify php. ini
Notepad c: \ Windows \ php. ini # open it in notepad and modify it.
1. fastcgi. impersonate = 1
2. cgi. fix_pathinfo = 1
3. cgi. force_redirect = 0
4. extension_dir = "c: \ php \ ext"
Search:
; Extension = php_gd2.dll
; Extension = php_mcrypt.dll
...... ...... (Open as needed and remove the semicolon to enable PHP to support these extensions)
 
 
8. Integrate PHP into FastCGI
 
Appcmd set config-section: system. webServer/fastcgi/+ [fullpath = 'C: \ php \ php-cgi.exe ']
Check whether write verification is correct:
Appcmd list config-section: system. webserver/fastcgi
 
Add extension to execute explanation PHP File
Appcmd set config-section: system. webServer/handlers/+ [name = 'php-FastCGI ', path = '*. php ', verb =' * ', modules = 'fastcgimodule', scriptprocessor = 'C: \ php \ php-cgi.exe']
Check whether write verification is correct:
Appcmd list config-section: system. webserver/handlers
 
Add "index. php" to the default document
Appcmd set config/section: defaultDocument/+ files. [value = 'index. php']
 
Go to the site directory. The default value is c: \ inetpub \ wwwroot.
Notepad phpinfo. php # create a phpinfo. php file
Write <? Phpinfo ();?>
 
9. Install mysql
Mysql: http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-noinstall-5.1.30-win32.zip/from/http://mysql.ntu.edu.tw/
 
Copy my-medium.ini c: \ Windows \ my. ini,
Notepad my. ini
Add "basedir = D:/mysql" and "datadir = D:/mysql/data" in the first line of the "[mysqld]" section, save and exit.
 
Cd d: \ mysql \ bin
Start cmd & mysqld # because after the MySQL service is manually started, the window is temporarily frozen in the MySQL running status and other commands cannot be executed. Therefore, before starting MySQL, now I open a CMD window. In the new form, Type
Mysqladmin-u root status & mysqladmin-u root shutdown # Check the running status of MySQL and then manually stop the MySQL service.
Mysqld -- install & net start mysql # Add MySQL as a system service and start the service. Modify the root user password
Mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root ';
Mysql> flush privileges;
Mysql> quit
 
10. Install eAccelerator
 
Download the corresponding dll file for your php version. for PHP 5.2.5, download eAccelerator 0952 for PHP 5.2.5 eLoader 0952 for PHP 5.2.5.
Http://www.sitebuddy.com/files/eAccelerator0952_5.2.5.dll
Http://www.sitebuddy.com/files/eLoader0952_5.2.5.dll
Or: http://www.zzchn.com/08/eAccelerator_for_win_php5.x.rar
 
Mkdir d: \ tmp \ eAccelerator # create a directory on disk d
Edit php. ini and add the following content after extension = php_zip.dll:
 
[Eaccelerator]
Zend_extension_ts = "C: \ php \ ext \ eAccelerator0952_5.2.5.dll"
Zend_extension = "C: \ php \ ext \ eAccelerator0952_5.2.4.dll"
Eaccelerator. cache_dir = "D: \ tmp \ eaccelerator"
Eaccelerator. shm_size = "64"
Eaccelerator. enable = "1"
Eaccelerator. optimizer = "1"
Eaccelerator. debug = "0"
Eaccelerator. check_mtime = "1"
Eaccelerator. filter = ""
Eaccelerator. shm_max = "0"
Eaccelerator. shm_ttl = "0"
Eaccelerator. shm_prune_period = "0"
Eaccelerator. shm_only = "0"
Eaccelerator. compress = "1"
Eaccelerator. compress_level = "9"
Eaccelerator. keys = "shm"
Eaccelerator. sessions = "shm"
Eaccelerator. content = "shm"
Zend_extension = "C: \ php \ ext \ eLoader0952_5.2.5.dll"
 
Restart IIS7
 
After using webbench for stress testing, I personally feel that IIS7 has greatly improved the performance of running php, similar to Apache. However, there is a big gap with LNMP.
 

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.