Set the local virtual domain name Windows+apache

Source: Internet
Author: User

C:\WINDOWS\system32\drivers\etc\hosts

At the bottom of this file, add the following.

[HTML]View PlainCopy
    1. 127.0.0.1 localhost.com
    2. 127.0.0.1 cho.com
    3. 127.0.0.1 devwo.com
    4. 127.0.0.1 phpmyadmin.com



Info from: http://blog.sina.com.cn/s/blog_7347580d0100w88d.html

D:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf

To add a mapping corresponding to the hosts [HTML]View PlainCopy
  1. #
  2. # Virtual Hosts
  3. #
  4. # If you want to maintain multiple domains/hostnames on your
  5. # machine your can setup VirtualHost containers for them. Mostconfigurations
  6. # Use of name-based virtual hosts so the server doesn ' t need toworry about
  7. # IP addresses. This was indicated by the asterisks in thedirectives below.
  8. #
  9. # documentation at
  10. #<url:http://httpd.apache.org/docs/2.2/vhosts/>
  11. # for further details before your try to setup virtual hosts.
  12. #
  13. # The command line option '-s ' to verify your virtualhost
  14. # configuration.
  15. #
  16. # use name-based virtual hosting.
  17. #
  18. Namevirtualhost *:80
  19. #
  20. # VirtualHost Example:
  21. # Almost any Apache directive could go into a virtualhostcontainer.
  22. # The first VirtualHost section was used for all requests that donot
  23. # match a ServerName or serveralias in any<VirtualHost> block.
  24. #
  25. <VirtualHost *:80>
  26. [Email protected]
  27. DocumentRoot "c:/dev/projets/wampserver2-64b/install_files_wampserver2/bin/apache/apache2.2.17/docs/ Dummy-host.hleclerc-pc.ingenidev "
  28. Servernamedummy-host.hleclerc-pc.ingenidev
  29. Serveraliaswww.dummy-host.hleclerc-pc.ingenidev
  30. Errorlog "Logs/dummy-host.hleclerc-pc.ingenidev-error.log"
  31. Customlog "Logs/dummy-host.hleclerc-pc.ingenidev-access.log" common
  32. </VirtualHost>
  33. <VirtualHost *:80>
  34. [Email protected]
  35. DocumentRoot "c:/dev/projets/wampserver2-64b/install_files_wampserver2/bin/apache/apache2.2.17/docs/ Dummy-host2.hleclerc-pc.ingenidev "
  36. Servernamedummy-host2.hleclerc-pc.ingenidev
  37. Errorlog "Logs/dummy-host2.hleclerc-pc.ingenidev-error.log"
  38. Customlog "Logs/dummy-host2.hleclerc-pc.ingenidev-access.log" common
  39. </VirtualHost>
  40. /*-----------------------------*/
  41. <VirtualHost *:80>
  42. Options None
  43. ServerAdmin cho.com
  44. DocumentRoot E:\PHP\PHPProject\inpiao
  45. ServerName cho.com
  46. Errorlog Logs/phpmyadmin.com-error_log
  47. Customlog Logs/phpmyadmin.com-access_log Common
  48. Php_admin_value Open_basedir "E:\PHP\PHPProject\inpiao"
  49. </VirtualHost>
  50. <VirtualHost *:80>
  51. Options None
  52. ServerAdmin devwo.com
  53. DocumentRoot E:\PHP\PHPPROJECT\DEVWO
  54. ServerName devwo.com
  55. Errorlog Logs/phpmyadmin.com-error_log
  56. Customlog Logs/phpmyadmin.com-access_log Common
  57. Php_admin_value Open_basedir "E:\PHP\PHPProject\devwo"
  58. </VirtualHost>
  59. <VirtualHost *:80>
  60. Options None
  61. ServerAdmin localhost.com
  62. DocumentRoot E:\PHP\PHPProject
  63. ServerName localhost.com
  64. Errorlog Logs/phpmyadmin.com-error_log
  65. Customlog Logs/phpmyadmin.com-access_log Common
  66. Php_admin_value Open_basedir "E:\PHP\PHPProject"
  67. </VirtualHost>
  68. <VirtualHost *:80>
  69. Options None
  70. ServerAdmin phpmyadmin.com
  71. DocumentRoot D:\wamp\apps\phpmyadmin3.3.9
  72. ServerName phpmyadmin.com
  73. Errorlog Logs/phpmyadmin.com-error_log
  74. Customlog Logs/phpmyadmin.com-access_log Common
  75. Php_admin_value Open_basedir "D:\wamp\apps\phpmyadmin3.3.9"
  76. </VirtualHost>

Finally open in the \conf\httpd.conf
# Virtual Hosts
Include conf/extra/httpd-vhosts.conf

Set the local virtual domain name Windows+apache

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.