Home  >  Article  >  Backend Development  >  wamp virtual host configuration

wamp virtual host configuration

巴扎黑
巴扎黑Original
2016-11-10 11:07:421415browse

1. First open the apache configuration file httpd.conf, and remove the # in front of #Include conf/extra/httpd-vhosts.conf to enable the virtual host function
2. Configure localhost first to avoid problems when accessing localhost later. The root directory of my wamp project is D:wampwww. Add the following information to the end of the configuration file httpd-vhosts.conf under apache's apache/conf/extra;

        DocumentRoot "D:/wamp/www"
       ServerName localhost                                                                                                                                            AllowOverride None
Order allow , deny
                                                                                                  Allow from all
                 3. Configure virtual hosts for other projects: For example, configure www.zf.com, open the link to directly access the D:/wamp/www/zf/public directory. "DirectoryIndex Index.php" means that accessing the directory to open the "Index.php" file

documentroot "D:/WAMP/WWW/ZF/PUBLIC"
Servername www.zf.com
directoryINDEX INDEX. pHP d "D :/wamp/www/zf/public ">
Options Indexes FollowSymlinks
Allowoverride None
Order Allow, DENY



4, modify C: WindowsSystem32Driver Host file under SETC, open it with a notepad, add 127.0.0.1 www .zf.com , just restart apache.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP date operationsNext article:PHP date operations