public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] apache - virtual host not working
@ 2011-12-12  6:23 Joseph
  2011-12-12  7:01 ` J. Roeleveld
  2011-12-12  7:03 ` Matthew Finkel
  0 siblings, 2 replies; 8+ messages in thread
From: Joseph @ 2011-12-12  6:23 UTC (permalink / raw
  To: gentoo-user

Any any body provide me with hint why my "virtual host" is not working in apache?

I've copied server config files from one computer to another.
I used "meld" to be sure most changes are accurate but when try to access virtual host:
I get: 
Forbidden
You don't have permission to access / on this server.

I don't know where else to look.

In /etc/hosts I have:
127.0.0.1 localhost.localdomain localhost mydomain.ca syscon5
10.0.0.100 www.mydomain.ca

If I comment out: #10.0.0.100 www.mydomain.ca
I can access this domain.

in: modules.d/00_default_settings.conf
# We configure the "default" to be a very restrictive set of features.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# added below
<Directory "/var/www/localhost/htdocs">
         AllowOverride All
         Order allow,deny
         Allow from all
</Directory>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch> 

I don't know where else to look. I can not access virtual domain on port 80 nor on 443
The server is working perfectly on my other computer running the same version of apache. As stated earlier I've compare configuration file with meld so I'm 
sure there are no mistakes.

-- 
Joseph



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] apache - virtual host not working
  2011-12-12  6:23 [gentoo-user] apache - virtual host not working Joseph
@ 2011-12-12  7:01 ` J. Roeleveld
  2011-12-12  7:03 ` Matthew Finkel
  1 sibling, 0 replies; 8+ messages in thread
From: J. Roeleveld @ 2011-12-12  7:01 UTC (permalink / raw
  To: gentoo-user

On Mon, December 12, 2011 7:23 am, Joseph wrote:
> Any any body provide me with hint why my "virtual host" is not working in
> apache?

We'll try :)

> I've copied server config files from one computer to another.

Which config-files?
I think apache uses the following:
/etc/conf.d/apache
/etc/apache/*

And is apache compiled with the same USE-flags on both machines?

> I used "meld" to be sure most changes are accurate but when try to access
> virtual host:
> I get:
> Forbidden
> You don't have permission to access / on this server.

This is either a missing/wrong configuration, or Apache does not have
access to the directory (filesystem permissions)

> I don't know where else to look.
>
> In /etc/hosts I have:
> 127.0.0.1 localhost.localdomain localhost mydomain.ca syscon5
> 10.0.0.100 www.mydomain.ca
>
> If I comment out: #10.0.0.100 www.mydomain.ca
> I can access this domain.

Does it work properly when you comment out this line?
Is the IP-adres correct?

> in: modules.d/00_default_settings.conf
> # We configure the "default" to be a very restrictive set of features.
> <Directory />
>     Options FollowSymLinks
>     AllowOverride None
>     Order deny,allow
>     Deny from all
> </Directory>
>
> # added below
> <Directory "/var/www/localhost/htdocs">
>          AllowOverride All
>          Order allow,deny
>          Allow from all
> </Directory>
>
> <FilesMatch "^\.ht">
>     Order allow,deny
>     Deny from all
> </FilesMatch>
>
> I don't know where else to look. I can not access virtual domain on port
> 80 nor on 443

There is a different directory where the actual websites are configured:
/etc/apache/vhosts

I am missing this in your email.

> The server is working perfectly on my other computer running the same
> version of apache. As stated earlier I've compare configuration file with
> meld so I'm sure there are no mistakes.

What does apache report in the logs?
/var/log/apache/*

--
Joost




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] apache - virtual host not working
  2011-12-12  6:23 [gentoo-user] apache - virtual host not working Joseph
  2011-12-12  7:01 ` J. Roeleveld
@ 2011-12-12  7:03 ` Matthew Finkel
  2011-12-12  7:12   ` J. Roeleveld
  2011-12-12  7:21   ` [gentoo-user] [SOLVED] " Joseph
  1 sibling, 2 replies; 8+ messages in thread
From: Matthew Finkel @ 2011-12-12  7:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

On Mon, Dec 12, 2011 at 1:23 AM, Joseph <syscon780@gmail.com> wrote:

>
> In /etc/hosts I have:
> 127.0.0.1 localhost.localdomain localhost mydomain.ca syscon5
> 10.0.0.100 www.mydomain.ca
>
> If I comment out: #10.0.0.100 www.mydomain.ca
> I can access this domain.
>

By "access", do you mean the website loads without the access restriction?


>

in: modules.d/00_default_settings.**conf
> # We configure the "default" to be a very restrictive set of features.
> <Directory />
>   Options FollowSymLinks
>   AllowOverride None
>   Order deny,allow
>   Deny from all
> </Directory>
>

Is there a reason you're giving access to / ?


>
> # added below
> <Directory "/var/www/localhost/htdocs">
>        AllowOverride All
>        Order allow,deny
>        Allow from all
> </Directory>
>
> <FilesMatch "^\.ht">
>   Order allow,deny
>   Deny from all
> </FilesMatch>
>

Do you set the DocumentRoot within the file to a location to which the
apache user has read access?


> I don't know where else to look. I can not access virtual domain on port
> 80 nor on 443
> The server is working perfectly on my other computer running the same
> version of apache. As stated earlier I've compare configuration file with
> meld so I'm sure there are no mistakes.
>
> --
> Joseph
>
>
Hope we can get this resolved.
- Matt

-- 
Matthew Finkel

[-- Attachment #2: Type: text/html, Size: 2600 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] apache - virtual host not working
  2011-12-12  7:03 ` Matthew Finkel
@ 2011-12-12  7:12   ` J. Roeleveld
  2011-12-12  7:21   ` [gentoo-user] [SOLVED] " Joseph
  1 sibling, 0 replies; 8+ messages in thread
From: J. Roeleveld @ 2011-12-12  7:12 UTC (permalink / raw
  To: gentoo-user

On Mon, December 12, 2011 8:03 am, Matthew Finkel wrote:
> On Mon, Dec 12, 2011 at 1:23 AM, Joseph <syscon780@gmail.com> wrote:
>> in: modules.d/00_default_settings.**conf
>> # We configure the "default" to be a very restrictive set of features.
>> <Directory />
>>   Options FollowSymLinks
>>   AllowOverride None
>>   Order deny,allow
>>   Deny from all
>> </Directory>
>
> Is there a reason you're giving access to / ?

This is a default setting in that file.
It actually prevents access to "/" (Which is should do)

The correct access should be configured in a file in:
/etc/apache/vhosts.d/...

--
Joost




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [SOLVED] apache - virtual host not working
  2011-12-12  7:03 ` Matthew Finkel
  2011-12-12  7:12   ` J. Roeleveld
@ 2011-12-12  7:21   ` Joseph
  2011-12-12  7:26     ` J. Roeleveld
  1 sibling, 1 reply; 8+ messages in thread
From: Joseph @ 2011-12-12  7:21 UTC (permalink / raw
  To: gentoo-user

On 12/12/11 02:03, Matthew Finkel wrote:
>   On Mon, Dec 12, 2011 at 1:23 AM, Joseph <syscon780@gmail.com> wrote:
>
>     In /etc/hosts I have:
>     127.0.0.1 localhost.localdomain localhost mydomain.ca syscon5
>     10.0.0.100 www.mydomain.ca
>
>     If I comment out: #10.0.0.100 www.mydomain.ca
>     I can access this domain.
>
>    
>   By "access", do you mean the website loads without the access restriction?
>    
>
>      
>
>     in: modules.d/00_default_settings.conf
>     # We configure the "default" to be a very restrictive set of features.
>     <Directory />
>       Options FollowSymLinks
>       AllowOverride None
>       Order deny,allow
>       Deny from all
>     </Directory>
>
>    
>   Is there a reason you're giving access to / ?

No the above statement actually prevent access, am I correct?

Thanks folks, SOLVED!

Another lesson learned.
I went for easy way out, tar.gz /var/* directory copy it to another machine.

Mistake #1
Extracted the file on the other machine as user (mistake #1) all the owner ship of file got changed to joseph:joseph

Mistake #2 
I use "meld" to compare the directors and copy missing files and directories to the destination machine. Meld - does not preserve owner-ship either.

The reason it didn't work as .htaccess file were changed to owner ship root:root and it should be apache:apache.
So the solution was to use "rsync -av" it preserver owner ship and permission :-/

Another lessor learned!

-- 
Joseph



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [SOLVED] apache - virtual host not working
  2011-12-12  7:21   ` [gentoo-user] [SOLVED] " Joseph
@ 2011-12-12  7:26     ` J. Roeleveld
  2011-12-12  7:56       ` Matthew Finkel
  2011-12-12  9:22       ` Neil Bothwick
  0 siblings, 2 replies; 8+ messages in thread
From: J. Roeleveld @ 2011-12-12  7:26 UTC (permalink / raw
  To: gentoo-user

On Mon, December 12, 2011 8:21 am, Joseph wrote:
> On 12/12/11 02:03, Matthew Finkel wrote:
>>   On Mon, Dec 12, 2011 at 1:23 AM, Joseph <syscon780@gmail.com> wrote:
>>
>>     In /etc/hosts I have:
>>     127.0.0.1 localhost.localdomain localhost mydomain.ca syscon5
>>     10.0.0.100 www.mydomain.ca
>>
>>     If I comment out: #10.0.0.100 www.mydomain.ca
>>     I can access this domain.
>>
>>
>>   By "access", do you mean the website loads without the access
>> restriction?
>>
>>
>>
>>
>>     in: modules.d/00_default_settings.conf
>>     # We configure the "default" to be a very restrictive set of
>> features.
>>     <Directory />
>>       Options FollowSymLinks
>>       AllowOverride None
>>       Order deny,allow
>>       Deny from all
>>     </Directory>
>>
>>
>>   Is there a reason you're giving access to / ?
>
> No the above statement actually prevent access, am I correct?

Yes, you are correct. It prevents access.
Configuration in the vhosts-config will add access to the required
directories.

> Thanks folks, SOLVED!

That's good to hear.

> Another lesson learned.
> I went for easy way out, tar.gz /var/* directory copy it to another
> machine.

The "-p" option will preserve ownership and permissions. You need to add
it to both compressing and extracting.

> Mistake #1
> Extracted the file on the other machine as user (mistake #1) all the owner
> ship of file got changed to joseph:joseph
>
> Mistake #2
> I use "meld" to compare the directors and copy missing files and
> directories to the destination machine. Meld - does not preserve
> owner-ship either.
>
> The reason it didn't work as .htaccess file were changed to owner ship
> root:root and it should be apache:apache.
> So the solution was to use "rsync -av" it preserver owner ship and
> permission :-/
>
> Another lessor learned!

We always learn new things.

--
Joost




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [SOLVED] apache - virtual host not working
  2011-12-12  7:26     ` J. Roeleveld
@ 2011-12-12  7:56       ` Matthew Finkel
  2011-12-12  9:22       ` Neil Bothwick
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Finkel @ 2011-12-12  7:56 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

On Mon, Dec 12, 2011 at 2:26 AM, J. Roeleveld <joost@antarean.org> wrote:

> On Mon, December 12, 2011 8:21 am, Joseph wrote:
> > On 12/12/11 02:03, Matthew Finkel wrote:
> >>   On Mon, Dec 12, 2011 at 1:23 AM, Joseph <syscon780@gmail.com> wrote
> >>
> >>     in: modules.d/00_default_settings.conf
> >>     # We configure the "default" to be a very restrictive set of
> >> features.
> >>     <Directory />
> >>       Options FollowSymLinks
> >>       AllowOverride None
> >>       Order deny,allow
> >>       Deny from all
> >>     </Directory>
> >>
> >>
> >>   Is there a reason you're giving access to / ?
> >
> > No the above statement actually prevent access, am I correct?
>
> Yes, you are correct. It prevents access.
> Configuration in the vhosts-config will add access to the required
> directories.
>

I'm sorry, I skimmed over it and misread it. It's much better the way you
have it! :)


>
> > Thanks folks, SOLVED!
>
> That's good to hear.
>
> > Another lesson learned!
>

 Awesome! Live and learn

- Matt

[-- Attachment #2: Type: text/html, Size: 1752 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [SOLVED] apache - virtual host not working
  2011-12-12  7:26     ` J. Roeleveld
  2011-12-12  7:56       ` Matthew Finkel
@ 2011-12-12  9:22       ` Neil Bothwick
  1 sibling, 0 replies; 8+ messages in thread
From: Neil Bothwick @ 2011-12-12  9:22 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

On Mon, 12 Dec 2011 08:26:55 +0100, J. Roeleveld wrote:

> > Another lesson learned.
> > I went for easy way out, tar.gz /var/* directory copy it to another
> > machine.  
> 
> The "-p" option will preserve ownership and permissions. You need to add
> it to both compressing and extracting.

That's the default anyway, but it only works if you extract as root or
the user that owns the files.


-- 
Neil Bothwick

WinErr 042: Virus error - A virus has been activated in a dos-box. The
virus, however, requires Windows. All tasks will automatically be closed
            and the virus will be activated again.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-12  9:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12  6:23 [gentoo-user] apache - virtual host not working Joseph
2011-12-12  7:01 ` J. Roeleveld
2011-12-12  7:03 ` Matthew Finkel
2011-12-12  7:12   ` J. Roeleveld
2011-12-12  7:21   ` [gentoo-user] [SOLVED] " Joseph
2011-12-12  7:26     ` J. Roeleveld
2011-12-12  7:56       ` Matthew Finkel
2011-12-12  9:22       ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox