logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Every path is forbidden after enabling wildcard vhost
Author
crantok



Joined: 03 Aug 2014
Posts: 4
Location: Manchester, UK

PostPosted: Sun 03 Aug '14 14:01    Post subject: Every path is forbidden after enabling wildcard vhost Reply with quote

I've been developing websites using Apache on various Ubuntu laptops over the years. I just set up a new laptop with Apache and it worked fine. If I went to localhost in my browser then it showed the default page. So far, so good.

I then added a file to sites-available to add wildcard virtual hosts. This lets me use convenient urls while developing sites on my laptop. Once I enabled this site, every url that resolved to localhost became 403 Forbidden, including urls that should return 404. Here is an example entry from other_vhosts_access.log...

Code:

127.0.1.1:80 127.0.0.1 - - [03/Aug/2014:12:49:09 +0100] "GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0"


...and the corresponding entry from error.log...

Code:
[Sun Aug 03 12:49:09 2014] [crit] [client 127.0.0.1] (13)Permission denied: /home/justin/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


...which is looking for .htaccess (I don't have one) in my home directory, which I don't understand at all. And here is the site I added which I've successfully used on previous installations but which seems to be messing things up this time...

Code:

<VirtualHost *:80>
  ServerAlias localhost *.l #wildcard catch all
  VirtualDocumentRoot /home/justin/www/%1
  UseCanonicalName Off
  <Directory "/home/justin/www">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>


Thanks in advance for any advice about this. Here is my Apache version info in case that helps:

Code:
Server version: Apache/2.2.22 (Ubuntu)
Server built:   Jul 22 2014 14:35:25
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.6, APR-Util 1.3.12
Compiled using: APR 1.4.6, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Back to top
crantok



Joined: 03 Aug 2014
Posts: 4
Location: Manchester, UK

PostPosted: Tue 05 Aug '14 11:30    Post subject: Reply with quote

It's been about two days since I posted my original message and I've not heard anything yet. I'm guessing that this is because either:

- I've not supplied enough information to define the problem properly, or
- this is not a problem that other people have experienced, or
- this is such an obvious problem that everyone thinks someone else will answer.

I'd be grateful for any insight in to which of these it is. Thanks in advance for any help.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Tue 05 Aug '14 12:04    Post subject: Reply with quote

This forum is a user-to-user community forum. So it depends all if an other user understands/has time/have experienced the issue/willing to help/.

Please note that the forum is primarily for Windows environments. But it is also about Apache in general, so your Apache on Ubuntu issue fits, although our experience is that it prevents other to respond. Our talented moderator James Blond mostly responds on Linux questions. So wait when he comes along.

When you are an "commercial user", see then also the note at the bottom of the forum rules.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 05 Aug '14 12:12    Post subject: Reply with quote

Did you take a look at http://httpd.apache.org/docs/2.2/vhosts/mass.html ?
Back to top
crantok



Joined: 03 Aug 2014
Posts: 4
Location: Manchester, UK

PostPosted: Tue 05 Aug '14 12:20    Post subject: Reply with quote

Thanks for both the responses.

I read some forum rules on registering but the notes on commercial users look like they're from a longer document. I shall seek it out.

James, I had not seen the Apache docs on Dynamically configured mass virtual hosting. I shall read that and see if solves my problem.

Thanks again.
Back to top
crantok



Joined: 03 Aug 2014
Posts: 4
Location: Manchester, UK

PostPosted: Sun 10 Aug '14 18:55    Post subject: [Solved] Every path forbidden after enabling wildcard vhost Reply with quote

I did 3 things before the problem stopped:

1) Upgraded my OS distro, which also upgraded Apache from 2.2.22 to 2.4.7

2) Changed my home directory permissions and Apache's group membership as per
http://shiplu.mokadd.im/161/permission-denied-homeusername-htaccess-pcfg_openfile-unable-check-htaccess-file-ensure-readable/

3) Made config changes (in my catchall virtual host file) that are required when moving from Apache 2.2 to 2.4, i.e. I changed
Code:
Order allow,deny
Allow from all

to
Code:
Require all granted

I suspect that I only needed to carry out step 2 originally, but upgrading my OS (and therefore Apache) meant that I had to do step 3 as well.
Back to top


Reply to topic   Topic: Every path is forbidden after enabling wildcard vhost View previous topic :: View next topic
Post new topic   Forum Index -> Apache