Apach configure virtual hosts to Laravel

Find httpd.conf file in the conf directory under the Apache directory

(1) Open file found #Include conf / extra / httpd-vhosts.conf, remove the #
(2) find #LoadModule rewrite_module modules / mod_rewrite.so, remove the #

httpd-vhosts.conf in extra under the conf directory to find the apache virtual host configuration file

<VirtualHost *:80>
    ServerAdmin www.mushi.com
    DocumentRoot "F:\PHP soft\php\www\blog\public"
    ServerName www.mushi.com
    ErrorLog "logs/www.mushi.com-error.log"
    CustomLog "logs/www.mushi.com-access.log" common
</VirtualHost>

Open 80 listens httpd.conf file

# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8081
Listen 80

Modify the Windows host file C drive:
directory is: C: \ Windows \ System32 \ drivers \ etc \ host
below to add a line (just set up a virtual domain name):

127.0.0.1  www.mushi.com

When more than one item to configure multiple port numbers,
in addition to port 80, other ports are required to enter the port number to access the domain name
, such as
www.mushi-blog.com 80 corresponding to the port
www.mushi-cms.com port corresponding to 8888

The access time:

// can not enter port 80
www.mushi-blog.com
www.mushi-cms.com:8888

View port occupied by
the cmd

netstat -ano
Published 40 original articles · won praise 0 · Views 793

Guess you like

Origin blog.csdn.net/qj4865/article/details/104072998