Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got up and running a reverse proxy on apache2 under Linux (Ubuntu). Now i see that there is a different folder-structure under Windows. My linux-conf - files don't work under windows or am i wrong?

Please show me the way

share|improve this question

migrated from Nov 1 '09 at 17:47

This question came from our site for professional and enthusiast programmers.

Hi tinkertim, What Client configuration? i assumed the apache2 server-configuration under a windows2008-server which seems to be different to a linux-server. The Question has nothing to do with 'server' it's a issue of configuration and the difference between these two OS. Am i wrong? – Ice Oct 31 '09 at 17:09
To be more precise: My linux configuration on looks like that: /etc/apache2/sites-availbale/backuppc - this file holds the definition of a <VirtualHost *> To activate this i run: sudo a2ensite backuppc and sudo /etc/init.d/apache2 reload and everything is fine Apache under windows looks something different: - no folder sites-available - no folder sites-enabled and so on... Please show me the way, thx. Ice – Ice Oct 31 '09 at 17:21
up vote 1 down vote accepted

As John has alluded to, the default configuration for Apache installed on Windows is at Program Files\Apache2.2\httpd.conf in a flat file. The path may be somewhat different, as I don't have a Windows machine handy at the moment. Most Linux distributions have their own custom hierarchical structure which looks something like the following. This example is from Debian and may vary with other distributions.

  • /etc/apache2/
    • apache2.conf Package provided configuration
    • conf.d/
      • Individual configuration files, usually from other packages, but could also be local configuration files
    • httpd.conf Local configuration file. Overrides contents of apache2.conf
    • mods-available/
      • Individual module configuration files, provided by the package and any support packages
    • mods-enabled/
      • Links to files in mods-available. Links are created/removed with a2enmod and a2dismod. Creating a link enables the given module.
    • ports.conf Enabled ports
    • sites-available/
      • Individual VirtualHost-style configuration files
    • sites-enabled
      • Links to files in sites-available. Links are created/removed with a2ensite and a2dissite. Creating a link enables the given site.

I've described all this to hopefully make it easier to understand how to replicate it under Windows. With the exception that links are not well supported under Windows (has this changed in Vista/Server 2008/Windows 7?) it's relatively easy to set this structure up. But you will have to do it manually, since the default configuration doesn't do it for you. Make sure you adjust the following to match the Linux distribution you're migrating from.

  1. Assuming the original configuration file on Windows is at \Program Files\Apache2.2\httpd.conf (again, this may not be the correct location, I'll need to check a Windows machine to be sure), create the following directories:

    • \Program Files\Apache2.2\conf.d\
    • \Program Files\Apache2.2\sites-enabled\

    You don't need the sites-available directories since links aren't supported under Windows. You can add them if you want, but things won't work the same. Also, I'd recommend putting the module configurations into the httpd.conf file. Since they aren't managed by the package manager, it will be easier to just keep them in one spot.

  2. Make any modifications from the Linux httpd.conf file to the Windows file. If you have an apache2.conf file under Linux, this is easy, since httpd.conf will only have overrides for apache2.conf.

  3. Add a ports.conf file, if desired. The contents of this can also exist in the httpd.conf file.

  4. Copy files that exist in the Linux conf.d directory into the Windows directory. Make sure the filenames end with .conf, adding it if it wasn't there before. This is done to help make directory parsing (set up below) less error prone.

  5. Copy files that exist in the Linux sites-enabled directory into the Windows directory. As in step 4, make sure the filenames end with .conf, adding it if it didn't exist under Linux.

  6. Add the following to the end of the httpd.conf file:

    # If you added a ports.conf file, add the following
    Include ports.conf
    # Include the conf.d files
    Include conf.d/*.conf
    # Include the enabled sites
    Include sites-enabled/*.conf
  7. Restart Apache. Make sure you check for and correct any configuration errors.

This might not get you there 100%, but it should get you close.

share|improve this answer
This is an answer! thx Michael Johnson i soone will give it a try. you will get feedback. Ice – Ice Nov 3 '09 at 20:55

Is there any reason you can't create the same folder structure under Windows as you have under Linux? You can't expect to just install Apache and have it magically create a tree of folders that aren't part of it's default configuration. Create the same structure, copy the configs and edit as and where appropriate.

share|improve this answer
Hi John, i don't understand your question. I install apache 2 under linux and the folder struktur is given and so is it when i install a apache2 under windwos... The struktur is given in both cases and it is not the same? I don't have invented the folder-struktur wheter under linux nor under windows. This post is somewhat unpopular pushed from stackoverflow to serverfault - i could understand that... Please help. – Ice Nov 2 '09 at 20:23
The folder structure you described is not standard under Windows. What's the problem? Just copy the structure, as I've already explained. – John Gardeniers Nov 2 '09 at 22:22
Ok and you are shure that the apache service will find it's files? – Ice Nov 19 '09 at 22:07

now i have found the Solution with the following :

NameVirtualHost *:80
<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
 # der Adresse http://>servername</crm wird hier wie folgt umgeleitet
    ProxyPass /crm http://localhost:8080/crm
    ProxyPassReverse /crm http://localhost:8080/crm
  # der Adresse http://>servername</trac wird hier wie folgt umgeleitet
    ProxyPass /trac http://localhost:8000/trac
    ProxyPassReverse /trac http://localhost:8000/trac

and this goes to C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf

It is realy simple if you know where to put the parameters because the standard folder structure after standard-setup is different for apache2.2 on ubuntu 8.04 and windows2008.



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.