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;
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
add a comment |
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
add a comment |
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
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
apache-2.2 apache-2.4
edited May 8 at 11:20
amt
asked May 8 at 10:55
amtamt
132
132
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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