You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Johnson <ti...@johnsons-web.com> on 2007/05/21 19:40:03 UTC

[users@httpd] DocumentRoot - Apache2 - Ubuntu

Hello:
Using apache2 on kubuntu 7.04 (amd_64)

On my older machine, which is slack 10.0, and (I think) apache 1.3.32, 
httpd.conf contains a DocumentRoot variable which can "override" the apache 
default document path.

I don't see a `DocumentRoot' variable in the apache2 httpd.conf.
Can I add that variable and will it have the same effect .

Thanks
Tim
-- 
Tim Johnson <ti...@johnsons-web.com>
Palmer, Alaska, USA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Tim Johnson <ti...@johnsons-web.com>.
On Wednesday 23 May 2007 12:03, Krist van Besien wrote:
<....>
>
> What I did is put every <virtualhost> block in its own config file. In
> these config files I configured for every virtual host where the
> docroot is, where it has to log etc...
> All these config files are under sites_available, and sites_enabled
> contains links to these files.
   Hi Krist:
   Thank you for the explanation - here's what I did - paths obfuscated:
   in /etc/apache2/sites-available/default, 
   which is symlinked as you describe - I have the following:
  DocumentRoot /mydoc/root/ 
   ScriptAlias /cgi-bin/ "/mydoc/root/cgipath/" ## quoted and trailing '/'
    <Directory "/mydoc/root/cgipath">
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

I'm much obliged for the help.
tim
-- 
Tim Johnson <ti...@johnsons-web.com>
Palmer, Alaska, USA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Krist van Besien <kr...@gmail.com>.
On 5/22/07, Tim Johnson <ti...@johnsons-web.com> wrote:
> On Tuesday 22 May 2007 11:06, Krist van Besien wrote:
> > What I've done on my personal server (which also runs Ubuntu Linux) is
> > to have a seperate config file for each virtual server in
> > sites-available. In sites-enabled I've then made links to "activate"
> > those virtual hosts that I want to be active.
>    Hi Krist:
>    To make sure that I follow you - as an example, I would put symlink
>    called @cgi-bin under sites-enabled and then by able to access it as
>    http://localhost/cgi-bin/script.extension ?

No no, that is not what I mean.

What Ubuntu does is split the httpd.conf in pieces, in seperate config
files. The config by default includes all config files in
sites_enabled. If you look in that directory you will see that it
contains links to files in sites_available.

You can add config files to sites_available, and then link them to
sites_enabled to make sure apache includes them. This way you can
extend and change the config without editing existing files, which
helps preserving the changes when you upgrade.
You don't have to do this, but the way choosen by the creators of
Ubuntu is to have it this way.

What I did is put every <virtualhost> block in its own config file. In
these config files I configured for every virtual host where the
docroot is, where it has to log etc...
All these config files are under sites_available, and sites_enabled
contains links to these files.

Krist

-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Tim Johnson <ti...@johnsons-web.com>.
On Tuesday 22 May 2007 11:06, Krist van Besien wrote:
> > > Line 5 of /etc/apache2/sites-enabled/000-default.
> > > looks like this:
> > > DocumentRoot /var/www/
> > >
> > > Is that what you are referring to?
>
> Ubuntu stores website config ins /etc/apache2/sites-available. To
> change the default host edit /etc/apache2/sites-available/000-default.
> In /etc/apache2/sites-enabled you will find only links to
> sites-available.
>
> What I've done on my personal server (which also runs Ubuntu Linux) is
> to have a seperate config file for each virtual server in
> sites-available. In sites-enabled I've then made links to "activate"
> those virtual hosts that I want to be active.
   Hi Krist:
   To make sure that I follow you - as an example, I would put symlink
   called @cgi-bin under sites-enabled and then by able to access it as
   http://localhost/cgi-bin/script.extension ?

   I don't necessarily have to change the document root, I can handle symlinks
   being overwritten by an upgrade....
   apache doesn't seem recognize /var/www/cgi-bin (where cgi-bin is a symlink)
   thanks
   tim 

-- 
Tim Johnson <ti...@johnsons-web.com>
Palmer, Alaska, USA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Krist van Besien <kr...@gmail.com>.
> > Line 5 of /etc/apache2/sites-enabled/000-default.
> > looks like this:
> > DocumentRoot /var/www/
> >
> > Is that what you are referring to?

Ubuntu stores website config ins /etc/apache2/sites-available. To
change the default host edit /etc/apache2/sites-available/000-default.
In /etc/apache2/sites-enabled you will find only links to
sites-available.

What I've done on my personal server (which also runs Ubuntu Linux) is
to have a seperate config file for each virtual server in
sites-available. In sites-enabled I've then made links to "activate"
those virtual hosts that I want to be active.

Krist

-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Norman Peelman <np...@cfl.rr.com>.
Tim Johnson wrote:
> On Tuesday 22 May 2007 02:05, Stephen wrote:
>  <snip>
>   
>>> I don't see a `DocumentRoot' variable in the apache2 httpd.conf.
>>> Can I add that variable and will it have the same effect .
>>>       
>
>  Hi Stephen:
>
>   
>> Look at some of the nested/included *.conf files.
>>     
>  
>   There is no path called `included'.
>   the directories below /etc/apache2 are:
>
> conf.d, mods-available, mods-enabled, sites-available, sites-enabled
>
> Line 5 of /etc/apache2/sites-enabled/000-default
> looks like this:
> DocumentRoot /var/www/
>
> Is that what you are referring to?
>
>   
>> The idea is that changes are made to them, and not http.conf.
>>     
>  
>  Pointer/URLs to documentation on this subject are invited too.
> thanks
> tim
>
>   
  As far as I know it can go into the main 'apache2.conf' file as well 
as <VirtualHost> containers (as found in 000-default). You should'nt see 
anything in 'httpd.conf' unless you've added it. Mine has a brief 
description about backwards compat. and 1 line commented out as an example.

Norm

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Tim Johnson <ti...@johnsons-web.com>.
On Tuesday 22 May 2007 02:05, Stephen wrote:
 <snip>
> > I don't see a `DocumentRoot' variable in the apache2 httpd.conf.
> > Can I add that variable and will it have the same effect .

 Hi Stephen:

> Look at some of the nested/included *.conf files.
 
  There is no path called `included'.
  the directories below /etc/apache2 are:

conf.d, mods-available, mods-enabled, sites-available, sites-enabled

Line 5 of /etc/apache2/sites-enabled/000-default
looks like this:
DocumentRoot /var/www/

Is that what you are referring to?

> The idea is that changes are made to them, and not http.conf.
 
 Pointer/URLs to documentation on this subject are invited too.
thanks
tim

-- 
Tim Johnson <ti...@johnsons-web.com>
Palmer, Alaska, USA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DocumentRoot - Apache2 - Ubuntu

Posted by Stephen <st...@rogers.com>.
Tim Johnson wrote:
> Hello:
> Using apache2 on kubuntu 7.04 (amd_64)
>
> On my older machine, which is slack 10.0, and (I think) apache 1.3.32, 
> httpd.conf contains a DocumentRoot variable which can "override" the apache 
> default document path.
>
> I don't see a `DocumentRoot' variable in the apache2 httpd.conf.
> Can I add that variable and will it have the same effect .
>   
Look at some of the nested/included *.conf files.

The idea is that changes are made to them, and not http.conf.

Stephen

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org