Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running an apache web server on ubuntu server 12.04 LTS.

If I try to

/usr/bin/curl http://mysite.com/script.php 

I get the error message

Access denied: follow redirect to /public/

What can cause this, and where should I start looking?

I'm so lost:)

One thing that bugs me and I don't understand is, where does /public/ come from? The script has no redirect.

The server is behind a firewall that I unfortunately don't have any control over. But everything else seems to be working so I don't think it's the firewall either, but that's just me guessing basically. On the web server itself, mod-security is installed. But disabeling mod-security doesn't do any difference.

This is output I got from a opencart developer when trying to figure out why the extension didn't work.

array(4) {
  ["header"]=>
  string(341) "HTTP/1.1 302 Found
Date: Thu, 22 Nov 2012 15:21:06 GMT
Server: Apache
Set-Cookie: PHPSESSID=151001bac8acee29f43a3bd6dd33c59c; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: /public/
Content-Length: 42
Content-Type: text/html

"
   ["response"]=>
   string(42) "Access denied: follow redirect to /public/"
   ["status"]=>
   int(302)
   ["info"]=>
   array(22) {
   ["url"]=>
   string(58) "http://www.example.com/index.php?route=ne/template/json"
   ["content_type"]=>
   string(9) "text/html"
   ["http_code"]=>
   int(302)
   ["header_size"]=>
   int(341)
   ["request_size"]=>
   int(342)
   ["filetime"]=>
   int(-1)
   ["ssl_verify_result"]=>
   int(0)
   ["redirect_count"]=>
   int(0)
   ["total_time"]=>
   float(0.081065)
   ["namelookup_time"]=>
   float(0.059011)
   ["connect_time"]=>
   float(0.05941)
   ["pretransfer_time"]=>
   float(0.059416)
   ["size_upload"]=>
   float(99)
   ["size_download"]=>
   float(42)
   ["speed_download"]=>
   float(518)
   ["speed_upload"]=>
   float(1221)
   ["download_content_length"]=>
   float(42)
   ["upload_content_length"]=>
   float(99)
   ["starttransfer_time"]=>
   float(0.081004)
   ["redirect_time"]=>
   float(0)
   ["certinfo"]=>
   array(0) {
   }
   ["redirect_url"]=>
   string(33) "http://www.example.com/public/"
 }
}
share|improve this question

1 Answer 1

Isn't the script.php located in /public/?

Could it be that your user running the Apache does not have read access to /public/ folder?

It's hard to say what might forward you to /public/ without knowing what script.php do, and how the apache server is configured.

share|improve this answer
    
That's what's so strange (to me), there is no /public/ folder anywhere, at all. I have gotten this exact error before, when installing a module for opencart. First I thought it was mod-security blocking something. But it turned out it wasn't. –  Henko Nov 16 '12 at 22:43
    
Maybe you could try to create a public folder in your web root and see if that makes it happy. If that is indeed the problem it could help you forward in your quest. As you see i am more or less guessing here. :-) –  Qben Nov 17 '12 at 8:50
    
I created a public folder, but that did not help. Where would these events be logged? I can't find anything in apache logs - or any other logs for that matter. –  Henko Nov 22 '12 at 14:59
    
Do you have a .htaccess file? If so it might configure the redirect via mod_rewrite or mod_alias. –  Qben Nov 23 '12 at 8:24
    
There is a .htaccess present, but there is no such rewrite. The problem is still present after disabling .htaccess –  Henko Nov 23 '12 at 10:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.