Apache how make “localhost/” map to “ C:/Apache/htdocs/” multiple document root?Apache 2.2.14: SSLCARevocation locationhow to define multiple document roots in apacheapache2 configuration for blog.example.com not workingLocal Host and Virtual Host point to same locationApache Virtual Hosts Not WorkingCan't access apache by port 80 from externalConditionally serving files from a directory outside of the document root with Apache2Prevent apache user from viewing server root directoryDefault documentroot served from url localhostHow to configure multiple laravel projects on local server (Apache, Ubuntu 16.04)

Make the `diff` command look only for differences from a specified range of lines

nginx conf: http2 module not working in Chrome in ubuntu 18.04

AD: Unable to perform remote desktop logon

Johnson-Nyquist noise for a lossy inductor?

Download app bundles from App Store to run on iOS Emulator on Mac

VHDL: Why is it hard to desgin a floating point unit in hardware?

How to become an Editorial board member?

How to make Flex Markers appear in Logic Pro X?

csname in newenviroment

What defines a person who is circumcised "of the heart"?

Singular Integration

Managing heat dissipation in a magic wand

Results relying on higher derived algebraic geometry

Can someone get a spouse off a deed that never lived together and was incarcerated?

Why do testers need root cause analysis?

why "American-born", not "America-born"?

If a character has cast the Fly spell on themselves, can they "hand off" to the Levitate spell without interruption?

Is the default 512 byte physical sector size appropriate for SSD disks under Linux?

Does science define life as "beginning at conception"?

Split into three!

Existence of a model of ZFC in which the natural numbers are really the natural numbers

Ribbon Cable Cross Talk - Is there a fix after the fact?

Proto-Indo-European (PIE) words with IPA

Island Perimeter



Apache how make “localhost/” map to “ C:/Apache/htdocs/” multiple document root?


Apache 2.2.14: SSLCARevocation locationhow to define multiple document roots in apacheapache2 configuration for blog.example.com not workingLocal Host and Virtual Host point to same locationApache Virtual Hosts Not WorkingCan't access apache by port 80 from externalConditionally serving files from a directory outside of the document root with Apache2Prevent apache user from viewing server root directoryDefault documentroot served from url localhostHow to configure multiple laravel projects on local server (Apache, Ubuntu 16.04)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















How can i make a directory inside htdocs act as the root directory?



Example:



Going to "localhost/<directory>"



Serves "C:/Apache/htdocs/<directory>" as the "$_SERVER['DOCUMENT_ROOT']"



I tried this, it did not change the "$_SERVER['DOCUMENT_ROOT']"



<VirtualHost localhost/<directory>:80>
DocumentRoot C:Apachehtdocs<directory>
ServerName localhost/<directory>
ServerAlias localhost/<directory>
<Directory "C:Apachehtdocs<directory>">
AllowOverride All
Require local
</Directory>
</VirtualHost>









share|improve this question






























    2















    How can i make a directory inside htdocs act as the root directory?



    Example:



    Going to "localhost/<directory>"



    Serves "C:/Apache/htdocs/<directory>" as the "$_SERVER['DOCUMENT_ROOT']"



    I tried this, it did not change the "$_SERVER['DOCUMENT_ROOT']"



    <VirtualHost localhost/<directory>:80>
    DocumentRoot C:Apachehtdocs<directory>
    ServerName localhost/<directory>
    ServerAlias localhost/<directory>
    <Directory "C:Apachehtdocs<directory>">
    AllowOverride All
    Require local
    </Directory>
    </VirtualHost>









    share|improve this question


























      2












      2








      2








      How can i make a directory inside htdocs act as the root directory?



      Example:



      Going to "localhost/<directory>"



      Serves "C:/Apache/htdocs/<directory>" as the "$_SERVER['DOCUMENT_ROOT']"



      I tried this, it did not change the "$_SERVER['DOCUMENT_ROOT']"



      <VirtualHost localhost/<directory>:80>
      DocumentRoot C:Apachehtdocs<directory>
      ServerName localhost/<directory>
      ServerAlias localhost/<directory>
      <Directory "C:Apachehtdocs<directory>">
      AllowOverride All
      Require local
      </Directory>
      </VirtualHost>









      share|improve this question
















      How can i make a directory inside htdocs act as the root directory?



      Example:



      Going to "localhost/<directory>"



      Serves "C:/Apache/htdocs/<directory>" as the "$_SERVER['DOCUMENT_ROOT']"



      I tried this, it did not change the "$_SERVER['DOCUMENT_ROOT']"



      <VirtualHost localhost/<directory>:80>
      DocumentRoot C:Apachehtdocs<directory>
      ServerName localhost/<directory>
      ServerAlias localhost/<directory>
      <Directory "C:Apachehtdocs<directory>">
      AllowOverride All
      Require local
      </Directory>
      </VirtualHost>






      apache-2.2 apache-2.4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 8 at 11:20







      amt

















      asked May 8 at 10:55









      amtamt

      132




      132




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Don't mixup apache virtual directories (like http://servername/directory) and the physical path (like c:folder)



          <VirtualHost localhost:80> <-- this is where the apache
          process listens (just
          servernames/ips/ports)
          DocumentRoot C:Apachehtdocs<directory>
          <-- This path is served in the virtual directory "/"
          (and what you are searching for)

          ServerName localhost
          <-- This is the server's name on which this directive is active

          ServerAlias localhost
          <-- Theese are alternate server's names. NAMEs, no path at all.
          </VirtualHost>


          The directive doesn't to do anything here, regarding the virtual path; it contains stuff on how apache should act in this directory, not where it is.






          share|improve this answer


















          • 1





            But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

            – amt
            May 8 at 12:47











          • The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

            – bjoster
            May 8 at 14:37











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966353%2fapache-how-make-localhost-directory-map-to-c-apache-htdocs-directory-m%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Don't mixup apache virtual directories (like http://servername/directory) and the physical path (like c:folder)



          <VirtualHost localhost:80> <-- this is where the apache
          process listens (just
          servernames/ips/ports)
          DocumentRoot C:Apachehtdocs<directory>
          <-- This path is served in the virtual directory "/"
          (and what you are searching for)

          ServerName localhost
          <-- This is the server's name on which this directive is active

          ServerAlias localhost
          <-- Theese are alternate server's names. NAMEs, no path at all.
          </VirtualHost>


          The directive doesn't to do anything here, regarding the virtual path; it contains stuff on how apache should act in this directory, not where it is.






          share|improve this answer


















          • 1





            But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

            – amt
            May 8 at 12:47











          • The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

            – bjoster
            May 8 at 14:37















          0














          Don't mixup apache virtual directories (like http://servername/directory) and the physical path (like c:folder)



          <VirtualHost localhost:80> <-- this is where the apache
          process listens (just
          servernames/ips/ports)
          DocumentRoot C:Apachehtdocs<directory>
          <-- This path is served in the virtual directory "/"
          (and what you are searching for)

          ServerName localhost
          <-- This is the server's name on which this directive is active

          ServerAlias localhost
          <-- Theese are alternate server's names. NAMEs, no path at all.
          </VirtualHost>


          The directive doesn't to do anything here, regarding the virtual path; it contains stuff on how apache should act in this directory, not where it is.






          share|improve this answer


















          • 1





            But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

            – amt
            May 8 at 12:47











          • The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

            – bjoster
            May 8 at 14:37













          0












          0








          0







          Don't mixup apache virtual directories (like http://servername/directory) and the physical path (like c:folder)



          <VirtualHost localhost:80> <-- this is where the apache
          process listens (just
          servernames/ips/ports)
          DocumentRoot C:Apachehtdocs<directory>
          <-- This path is served in the virtual directory "/"
          (and what you are searching for)

          ServerName localhost
          <-- This is the server's name on which this directive is active

          ServerAlias localhost
          <-- Theese are alternate server's names. NAMEs, no path at all.
          </VirtualHost>


          The directive doesn't to do anything here, regarding the virtual path; it contains stuff on how apache should act in this directory, not where it is.






          share|improve this answer













          Don't mixup apache virtual directories (like http://servername/directory) and the physical path (like c:folder)



          <VirtualHost localhost:80> <-- this is where the apache
          process listens (just
          servernames/ips/ports)
          DocumentRoot C:Apachehtdocs<directory>
          <-- This path is served in the virtual directory "/"
          (and what you are searching for)

          ServerName localhost
          <-- This is the server's name on which this directive is active

          ServerAlias localhost
          <-- Theese are alternate server's names. NAMEs, no path at all.
          </VirtualHost>


          The directive doesn't to do anything here, regarding the virtual path; it contains stuff on how apache should act in this directory, not where it is.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 8 at 12:27









          bjosterbjoster

          1,9901919




          1,9901919







          • 1





            But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

            – amt
            May 8 at 12:47











          • The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

            – bjoster
            May 8 at 14:37












          • 1





            But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

            – amt
            May 8 at 12:47











          • The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

            – bjoster
            May 8 at 14:37







          1




          1





          But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

          – amt
          May 8 at 12:47





          But i am still having to remove the <directory> part after localhost via .htaccess, the localhost/<directory> still does not act as the root like localhost/ does.

          – amt
          May 8 at 12:47













          The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

          – bjoster
          May 8 at 14:37





          The <directory> directive can either be in your conf (as above), or placed as a .htaccess file in the path itself. Both would be correct - so you can leave your <Directory> in your <VirtualHost> element.

          – bjoster
          May 8 at 14:37

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966353%2fapache-how-make-localhost-directory-map-to-c-apache-htdocs-directory-m%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

          Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos