Apache on Windows
The document translated automatically
Creating virtual hosts on Windows using apache server.
Creating a website often want to test how it works. Sometimes we need to make a few test pages, and after putting one hand we take to be doing next. The simplest solution is to buy a domain address eg. Testowadomena.pl and then creating folders in the domain on which we put the page will look as follows: H ttp: \\ tesowadomena.pl \ stronawww1 \ H ttp: \\ testowadomena.pl \ stronawww2 \
It looks unprofessional.
How to make multiple domains on one server. We use Virtua hosts. The easiest way to bring based virtual host is to make it on your own computer. On our host will be able to get in several ways:
The name http: // localhost>
After the IP address
http://127.0.0.1
After the computer name http: // naszkomputer>
How to create a virtual host in windows. First, enter on page
http://httpd.apache.org/download.cgi#apache24
and download the latest installation package designed for windows systems - httpd-2.2.22-win32-x86-openssl-0.9.8t.msi. Install the package enter the server name at this point we have created your web server.
Properly installed icon appears in the lower right corner of Apache ikonaPanel manage a windows apache as follows.
In this menu you can stop off and restart Apache server after making configuration changes.
The configuration file located in the root directory bin / apache / apache2.2.8 / conf and is called httpd.conf. The changes made in this file will be responsible for the operation of our server.
Let's create the two virtual addresses in order to demonstrate the operation of virtual domains.
Let's say we have a structure on drive E: \ www \ nod \ updates.
in the directory E: \ www \ will be placed first domain
in the directory E: \ www \ nod \ updates will be placed second domain.
It will be a server on the WAN comprising corporate intranet site staked in the folder E: \ www
and server anti-virus update NOD - distribution server located in the folder E: \ www \ nod \ Updates
We go into the apache configuration - edit the httpd.conf file and make the following entries:
NameVirtualHost *: 80
<VirtualHost *: 80>
ServerAdmin This email address is being protected from spambots. You need JavaScript enabled to view it.
DocumentRoot "e: / www"
ServerName intranet.wan
ErrorLog "logs / error.log intranet.wan-"
CustomLog "logs / access.log intranet.wan-" common
</ VirtualHost>
<VirtualHost *: 80>
ServerAdmin This email address is being protected from spambots. You need JavaScript enabled to view it.
DocumentRoot "e: / www / nod / updates /"
ServerName nod.wan
ErrorLog "logs / error.log nod.wan-"
CustomLog "logs / access.log nod.wan-" common
</ VirtualHost>
Now we have created two virtual hosts, of course, they start to function when you save the file and restart apache server.
We created the virtual server intranet.wan located in the directory e: / Website
and created the virtual server is located in the directory e: / www / nod / updates / - which clienci NOD antivirus software will be downloaded update.
Note important is the order of entries in the httpd.conf file - in this case, running the server with the command http: // enter localhost to fodleru e: / www. and giving, we can enter the upgrade path giving the nod / updates /
If we change the order by typing http: // localhost go into the folder E: / www / nod / updates / and we will not have the possibility to enter into our intranet site, located in the folder E: / www
, of course, input the name http: //intranet.wan take us to the correct location.