肖恩D++
Not Equal C && !=C && 不等于西
-
Setting up virtualhost in Apache on Windows XP
Posted on April 27th, 2010 Add comments1.Configuring Apache
The first file need to edit is the Apache httpd.conf file. Usually, it’s under the root folder where the Apache was installed.
If IIS is also used on Windows, IIS will use 80 port first, so need to change the port number of Apache server, e.g. change port 80 to 808012345#Listen 0.0.0.0:80#Listen [::]:80Listen 8080#after several linesServerName localhost:8080Then, add new virtualhost
1234567891011NameVirtualHost *:8080<VirtualHost *:8080>DocumentRoot "C:/www"ServerName localhost</VirtualHost><VirtualHost *:8080>DocumentRoot "C:\sub_www"ServerName sub.localhost</VirtualHost>In the end, need to define the permissions of the virtualhost directory:
123456<Directory "C:\sub_www">Options Indexes FollowSymLinks Includes ExecCGIAllowOverride AllOrder allow,denyAllow from all</Directory>
2.Resolving the DNS issue
Obviously, if typed “http://sub.localhost” in your browser, it would not be found by your Internet provider’s DNS server, and still need modify the files called “hosts”. It’s under “C:\Windows\system32\drivers\etc\”, and just add the new sub domain to the file:12127.0.0.1 localhost127.0.0.1 sub.localhost
Leave a Reply
Be the First to Comment!