Where is the web server root directory in WAMP?

后端 未结 7 1962
萌比男神i
萌比男神i 2020-12-05 07:39

Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser?

相关标签:
7条回答
  • 2020-12-05 07:59

    Everything suggested by user "mins" is correct, and excellent information.

    WAMP 2.5 provides a default Server Configuration display when you enter localhost into your browser. This maps to c:\wamp\www, as described in previous posts. Creating subdirectories under www will cause Projects to appear on this display. A click and you're in your project.

    I have various projects under different directory structures, sometimes on shared drives which makes this centralized location of files inconvenient. Luckily, there is a second feature of WAMP 2.5, an Alias, which makes specifying the location of one (or more) disparate web directories quite easy. No editing of configuration files. Using the WAMP menu, choose Apache > Alias directories > Add an Alias.

    WAMP has evolved nicely to provide support for a variety of developer preferences.

    0 讨论(0)
  • 2020-12-05 08:01

    To check what is your root directory go to httpd.conf file of apache and search for "DocumentRoot".The location following it is your root directory

    0 讨论(0)
  • 2020-12-05 08:06

    In WAMP the files are served by the Apache component (the A in WAMP).

    In Apache, by default the files served are located in the subdirectory htdocs of the installation directory. But this can be changed, and is actually changed when WAMP installs Apache.

    The location from where the files are served is named the DocumentRoot, and is defined using a variable in Apache configuration file. The default value is the subdirectory htdocs relative to what is named the ServerRoot directory.

    By default the ServerRoot is the installation directory of Apache. However this can also be redefined into the configuration file, or using the -d option of the command httpd which is used to launch Apache. The value in the configuration file overrides the -d option.

    The configuration file is by default conf/httpd.conf relative to ServerRoot. But this can be changed using the -f option of command httpd.

    When WAMP installs itself, it modify the default configuration file with DocumentRoot c:/wamp/www/. The files to be served need to be located here and not in the htdocs default directory.

    You may change this location set by WAMP, either by modifying DocumentRoot in the default configuration file, or by using one of the two command line options -f or -d which point explicitly or implicity to a new configuration file which may hold a different value for DocumentRoot (in that case the new file needs to contain this definition, but also the rest of the configuration found in the default configuration file).

    0 讨论(0)
  • 2020-12-05 08:08

    If you use Bitnami installer for wampstack, go to:

    c:/Bitnami/wampstack-5.6.24-0/apache/conf (of course your version number may be different)

    Open the file: httpd.conf in a text editor like Visual Studio code or Notepad ++

    Do a search for "DocumentRoot". See image.

    You will be able to change the directory in this file.

    0 讨论(0)
  • 2020-12-05 08:10

    If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www, however this might vary depending on version.

    Yes, this is where you would put your site files to access them through a browser.

    0 讨论(0)
  • 2020-12-05 08:18

    Here's how I get there using Version 3.0.6 on Windows

    0 讨论(0)
提交回复
热议问题