Home > Backend Development > PHP Tutorial > apache configure virtual host

apache configure virtual host

PHP中文网
Release: 2016-08-08 09:27:06
Original
864 people have browsed it

apache configuration virtual host

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

#在httpd.conf 开启 Virtual hosts Include conf/extra/httpd-vhosts.conf

#然后在httpd-vhosts.conf 里面配置

#根据ip来匹配

# <VirtualHost 127.0.0.1:80>

#    DocumentRoot "E:/htdocs"

#    DirectoryIndex index.html index.htm index.php

#    <Directory E:/htdocs>

#      Options FollowSymLinks

#      AllowOverride None

#      Order allow,deny

#      Allow from all

#    </Directory>

# </VirtualHost>

  

#根据端口号来匹配

# <VirtualHost 127.0.0.1:82>

#    DocumentRoot "E:/htdocs"

#    DirectoryIndex index.html index.htm index.php

#    <Directory E:/htdocs>

#      Options FollowSymLinks

#      AllowOverride None

#      Order allow,deny

#      Allow from all

#    </Directory>

# </VirtualHost>

  

#根据主机名匹配

<VirtualHost *:80>

    DocumentRoot "E:/htdocs"

    ServerName localhost

    DirectoryIndex index.html index.htm index.php

    <Directory E:/htdocs>

      Options FollowSymLinks

      AllowOverride None

      Order allow,deny

      Allow from all

    </Directory>

</VirtualHost>

  

<VirtualHost *:80>

    DocumentRoot "E:/htdocs/dedecms"

    ServerName dedecms.com

    DirectoryIndex index.html index.htm index.php

    <Directory E:/htdocs>

      Options FollowSymLinks

      AllowOverride None

      Order allow,deny

      Allow from all

    </Directory>

</VirtualHost>

  

<VirtualHost *:80>

    DocumentRoot "E:/htdocs/discuz"

    ServerName discuz.com

    DirectoryIndex index.html index.htm index.php

    <Directory E:/htdocs>

      Options FollowSymLinks

      AllowOverride None

      Order allow,deny

      Allow from all

    </Directory>

</VirtualHost>

Copy after login

1

#在window 配置host文件

Copy after login

The above is the content of apache configuration and virtual host. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template