Because of a long time did not configure Apache, although said know how to configure Nginx, but it took some time to write down the next time directly with
On the other options File menu, open configuration file, select Vhosts-conf
Nginx words use
server { listen ; server_name the name of your virtual directory; Root "directory path you want to manipulate"; Location/{ index index.html index.htm index.php; #autoindex on ; if ($request _filename!~ (static|robots/.txt|index/.php.*)) { rewrite ^/(. *) $/index.php?$1 last; break; } } Location ~ \.php (. *) $ { fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_split_path_info ^ (? U). +\.php) (/?. +)$; Fastcgi_param script_filename $document _root$fastcgi_script_name; Fastcgi_param path_info $fastcgi _path_info; Fastcgi_param path_translated $document _root$fastcgi_path_info; Include fastcgi_params; }}
The most important thing after that is DNS resolution: Open the hosts under C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Add the domain name that you configured to resolve to local code such as
127.0.0.1 localhost This is the default 127.0.0.1 www.mycomment.com
Apache Virtual host code can refer to the
<virtualhost *:80>serveradmin [Email protected]documentroot "F:\WORKSPACE\VIM\YNOTE\SRC" ServerName editor.fuyg.cn serveralias editor.fuyg.cn errorlog "Logs/dummy-host.localhost-error.log" customlog " Logs/dummy-host.localhost-access.log "combined <directory" F:\WORKSPACE\VIM\YNOTE\SRC "> options Indexes followsymlinks allowoverride all Order allow,deny to </Directory>< /virtualhost>
Nginx Configuration Virtual Host under Window Phpstudy