Plone 4.1.4 Site Error: Resource not found - plone

A little stuck :(Thanks in advance
Expected Outcome:
atitlanorganics.com should render my new plone site.
Actual Outcome:
Site Error: Rource not found
Stack:
Ubuntu sqeeze/sid
Apache 2.2.14
Python 2.6.7 (r267:88850, Mar 12 2012, 20:57:20) [GCC 4.4.3]
Plone 4.1.4 recently upgrade from 4.1.3
CMF 2.2.5 Zope 2.13.12
PIL 1.1.6
PloneFormgen 1.7.0
Products.Carousel 2.1
Buildout Here: http://pastebin.com/YLBxiTLp
Troubleshooting:
Receiving website "Site Error: Resource not found" when i go to: atitlanorganics.com
But works fine when i connect directly to plone: http://72.14.188.28:40000/AtitlanOrganics
When i try to connect directly to atitlanorganics.com I get this error in my browser::
> <h2>Site Error</h2> <p>An error was encountered while publishing this
> resource. </p> <p><strong>Resource not found</strong></p> Sorry, the
> requested resource does not exist.<p>Check the URL and try
> again.</p><p><b>Resource:</b> atitlanorganics.com GET</p> <hr
> noshade="noshade"/> <p>Troubleshooting Suggestions</p> <ul> <li>The
> URL may be incorrect.</li> <li>The parameters passed to this resource
> may be incorrect.</li> <li>A resource that this resource relies on may
> be encountering an error.</li> </ul> <p>For more detailed information
> about the error, please refer to the error log. </p> <p>If the error
> persists please contact the site maintainer. Thank you for your
> patience. </p>
Apache Access Log::
> root#li54-28:/var/log/apache2# tail -n 0 -f access.log
>
> > 190.148.214.174 - - [16/Mar/2012:21:54:10 -0600] "GET / HTTP/1.1" 404 792 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0)
> Gecko/20100101
> > Firefox/11.0"
> > 190.148.214.174 - - [16/Mar/2012:21:54:12 -0600] "GET / HTTP/1.1" 404 791 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0)
> Gecko/20100101
> > Firefox/11.0"
> > 190.148.214.174 - - [16/Mar/2012:21:54:13 -0600] "GET / HTTP/1.1" 404 791 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0)
> Gecko/20100101
> > Firefox/11.0"
Apache Error Log::
> root#li54-28:/var/log/apache2# tail -n 0 -f error.log
> ***No errors
Plone Console Log:: when directing browser to atitlanorganics.com
> shadqudsi#li54-28:~/atitlanorganics.com$ bin/instance fg 2012-03-16
> 21:25:32 INFO ZServer HTTP server started at Fri Mar 16 21:25:32 2012
> Hostname: 0.0.0.0
> Port: 40000 2012-03-16 21:25:35 WARNING SecurityInfo Conflicting security declarations for "setText" 2012-03-16 21:25:35
> WARNING SecurityInfo Class "ATTopic" had conflicting security
> declarations
> /home/shadqudsi/buildout-cache/eggs/zope.configuration-3.7.4-py2.6.egg/zope/configuration/config.py:706:
> UserWarning: The set_schema option of the <requ ire /> directive is
> not supported in Zope 2. Ignored for <class
> 'Products.Carousel.content.carouselbanner.CarouselBanner'> actions =
> self.handler(context, **args) 2012-03-16 21:25:52 INFO PloneFormGen
> Patching plone.app.portlets ColumnPortletManagerRenderer to not catch
> Retry exceptions 2012-03-16 21:25:53 INFO Zope Ready to handle
> requests
> ***Notice the requests show in the apaches access.log but never in apaches error.log or plones bin/plone fg output
Apache site-enabled config for atitlanorganics.com::
> root#li54-28:/etc/apache2/sites-enabled# ll atitlanorganics.com
> lrwxrwxrwx 1 root root 38 2012-02-13 07:04 atitlanorganics.com ->
> ../sites-available/atitlanorganics.com
> root#li54-28:/etc/apache2/sites-enabled#
> root#li54-28:/etc/apache2/sites-enabled# tail atitlanorganics.com
> <Proxy *>
> Allow from all
> </Proxy> RewriteEngine On
> RewriteRule ^(.*) http://127.0.0.1:40000/VirtualHostBase/http/%{HTTP_HOST}:80/atitlanorganics.com/VirtualHostRoot/$1
> [P,L]
> ErrorDocument 503 "<!DOCTYPE html><head><title>Site down</title></head><h1>Our webmaster isnt very good. Get a rope!</h1>"
> </VirtualHost>
Plone Console Log:: when directing browser to http//72.14.188.28:40000/AtitlanOrganics
> shadqudsi#li54-28:~/atitlanorganics.com$ bin/instance fg 2012-03-16
> 21:25:32 INFO ZServer HTTP server started at Fri Mar 16 21:25:32 2012
> Hostname: 0.0.0.0
> Port: 40000 2012-03-16 21:25:35 WARNING SecurityInfo Conflicting security declarations for "setText" 2012-03-16 21:25:35
> WARNING SecurityInfo Class "ATTopic" had conflicting security
> declarations
> /home/shadqudsi/buildout-cache/eggs/zope.configuration-3.7.4-py2.6.egg/zope/configuration/config.py:706:
> UserWarning: The set_schema option of the <requ ire /> directive is
> not supported in Zope 2. Ignored for <class
> 'Products.Carousel.content.carouselbanner.CarouselBanner'> actions =
> self.handler(context, **args) 2012-03-16 21:25:52 INFO PloneFormGen
> Patching plone.app.portlets ColumnPortletManagerRenderer to not catch
> Retry exceptions 2012-03-16 21:25:53 INFO Zope Ready to handle
> requests 2012-03-16 22:18:04 INFO CMFFormController
> /home/shadqudsi/buildout-cache/eggs/Products.PloneFormGen-1.7.0-py2.6.egg/Products/PloneFormGen/skins/PloneFormfg_base_view_p3.cpt:
> No default action specified for status success, content type ANY.
> Users of IE can submit pages using the return key, resulting in noton
> in the REQUEST. Please specify a default action for this case.
>
> 2012-03-16 22:18:04 INFO CMFFormController
> /home/shadqudsi/buildout-cache/eggs/Products.PloneFormGen-1.7.0-py2.6.egg/Products/PloneFormGen/skins/PloneFormfg_base_view_p3.cpt:
> No default action specified for status success, content type ANY.
> Users of IE can submit pages using the return key, resulting in noton
> in the REQUEST. Please specify a default action for this case.
I diffed my apache sites-enabled atitlanorganics.com config with a know good config of jaibalito.org. The only differences are the directory/domain/port references.
> root#li54-28:/etc/apache2/sites-available# diff atitlanorganics.com
> jaibalito.org
>
> > 2,4c2,4 < ServerAdmin webmaster#atitlanorganics.com <
> > ServerName atitlanorganics.com < ServerAlias
> > www.atitlanorganics.com
> > ---
> > > ServerAdmin webmaster#jaibalito.org
> > > ServerName jaibalito.org
> > > ServerAlias www.jaibalito.org 6c6 < DocumentRoot /home/shadqudsi/atitlanorganics.com/www
> > ---
> > > DocumentRoot /home/naderehnilforoushan/jaibalito.org/www 11c11 < <Directory /home/shadqudsi/atitlanorganics.com/www/>
> > ---
> > > <Directory /home/naderehnilforoushan/jaibalito.org/www/> 48c48 < RewriteRule ^(.*)
> > http://127.0.0.1:40000/VirtualHostBase/http/%{HTTP_HOST}:80/atitlanorganics.com/VirtualHostRoot/$1
> > [P,L]
> > ---
> > > RewriteRule ^(.*) http://127.0.0.1:29000/VirtualHostBase/http/%{HTTP_HOST}:80/jaibalito.org/VirtualHostRoot/$1
> > [P,L] 50c50 < ErrorDocument 503 "<!DOCTYPE html><head><title>Site
> > down</title></head><h1>Our webmaster isnt very good. Get a rope!</h1>"
> > ---
> > > ErrorDocument 503 "<!DOCTYPE html><head><title>Jaibalito.org Under Repair</title></head><h1>Jaibalito.org under going site
> > maintenance: </h1>"

Issue Solved.
We get by with a little help from our friends ;=)
Resolution:
I had a conflict between my Apache "Rewrite rule" and my Plone "Site Name".
Specifically:
> RewriteRule ^(.*)
> http://127.0.0.1:40000/VirtualHostBase/http/%{HTTP_HOST}:80/atitlanorganics.com/VirtualHostRoot/$1
http://72.14.188.28:40000/AtitlanOrganics
Notice the atitlanorganics.com doesn´t match AtitlanOrganics!! Ah Hah!! I changed my apache config to:
> RewriteRule ^(.*)
> http://127.0.0.1:40000/VirtualHostBase/http/%{HTTP_HOST}:80/AtitlanOrganics/VirtualHostRoot/$1
Working brilliantly! Peace reigns in Ploniverse once again.

And does your zope have a VirtualHostMonster?

Related

Content length limitation in http requests to pod ip and port

Env:
# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
km12-01 Ready master 26d v1.13.0 10.42.140.154 <none> Ubuntu 16.04.5 LTS 4.17.0-041700-generic docker://17.6.2
km12-02 Ready master 26d v1.13.0 10.42.104.113 <none> Ubuntu 16.04.5 LTS 4.17.0-041700-generic docker://17.6.2
km12-03 Ready master 26d v1.13.0 10.42.177.142 <none> Ubuntu 16.04.5 LTS 4.17.0-041700-generic docker://17.6.2
prod-k8s-node002 Ready node 25d v1.13.0 10.42.78.21 <none> Ubuntu 16.04.5 LTS 4.17.0-041700-generic docker://17.3.2
prod-k8s-tmpnode005 Ready node 24d v1.13.0 10.42.177.75 <none> Ubuntu 16.04.5 LTS 4.17.0-041700-generic docker://17.3.2
calico v3.3.1
What Happen:
I have a deployment, with 2 pods scheduled on prod-k8s-node002 and prod-k8s-tmpnode005. Just like this:
# kubectl -n gitlab-prod get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
api-monkey-76489bd8c9-7gbkt 1/1 Running 0 35m 192.244.199.37 prod-k8s-node002 <none> <none>
api-monkey-76489bd8c9-w2zrs 1/1 Running 0 55m 192.244.124.240 prod-k8s-tmpnode005 <none> <none>
Now I curl each pod from a master node, say it is km12-01:
# # wait 0ms, response a json string, which has a property named 'data', it is a string, which is '1' repeated by 1000 times
# curl -v '192.244.124.240:3000/health/test?ms=0&content=1&repeat=1000'
* Trying 192.244.124.240...
* Connected to 192.244.124.240 (192.244.124.240) port 3000 (#0)
> GET /health/test?ms=0&content=1&repeat=1000 HTTP/1.1
> Host: 192.244.124.240:3000
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Content-Length: 1011
< ETag: W/"3f3-oUOV2TWikka+Y8l16Cqo/Q"
< Date: Sat, 08 Dec 2018 20:12:26 GMT
< Connection: keep-alive
<
* Connection #0 to host 192.244.124.240 left intact
{"data":"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}
# curl -v '192.244.199.37:3000/health/test?ms=0&content=1&repeat=1000'
* Trying 192.244.199.37...
* Connected to 192.244.199.37 (192.244.199.37) port 3000 (#0)
> GET /health/test?ms=0&content=1&repeat=1000 HTTP/1.1
> Host: 192.244.199.37:3000
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Content-Length: 1011
< ETag: W/"3f3-oUOV2TWikka+Y8l16Cqo/Q"
< Date: Sat, 08 Dec 2018 20:15:16 GMT
< Connection: keep-alive
<
* Connection #0 to host 192.244.199.37 left intact
{"data":"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}
Good, both work.
So if I make a longer response body (2000 bytes), what will happen?
# curl -v '192.244.124.240:3000/health/test?ms=0&content=1&repeat=2000'
* Trying 192.244.124.240...
* Connected to 192.244.124.240 (192.244.124.240) port 3000 (#0)
> GET /health/test?ms=0&content=1&repeat=2000 HTTP/1.1
> Host: 192.244.124.240:3000
> User-Agent: curl/7.47.0
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Unfortunately, the connection was hanging on and then reset by peer after couple minutes. But it works on the host of the requested pod.
Curl a pod from its host:
# curl -v '192.244.124.240:3000/health/test?ms=0&content=1&repeat=2000'
* Trying 192.244.124.240...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.244.124.240 (192.244.124.240) port 3000 (#0)
> GET /health/test?ms=0&content=1&repeat=2000 HTTP/1.1
> Host: 192.244.124.240:3000
> User-Agent: curl/7.47.0
> Accept: */*
>
{"data":"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}< HTTP/1.1 200 OK
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Content-Length: 2011
< ETag: W/"7db-ViIL+fXpsfh/YwmlqDHSsQ"
< Date: Sat, 08 Dec 2018 20:22:55 GMT
< Connection: keep-alive
<
{ [2011 bytes data]
100 2011 100 2011 0 0 440k 0 --:--:-- --:--:-- --:--:-- 490k
* Connection #0 to host 192.244.124.240 left intact
The other one is in the same situation.
Summary:
I tried many times, and found a interesting and strange thing: If I request a pod from any other node (except the host of the pod), the response body cannot be longer than 1140 bytes. Otherwise, the connection will hang on.
My problem:
How it happen? And how can I break this limitation?
This is the kubeadm-1.12.0 initialization file:
# cat kubeadm-init.yaml
apiVersion: kubeadm.k8s.io/v1alpha3
controlPlaneEndpoint: 10.42.79.210:6443
kind: ClusterConfiguration
kubernetesVersion: v1.12.0
networking:
podSubnet: 192.244.0.0/16
serviceSubnet: 192.96.0.0/16
apiServerCertSANs:
- 10.42.140.154
- 10.42.104.113
- 10.42.177.142
- km12-01
- km12-02
- km12-03
- 127.0.0.1
- localhost
- 10.42.79.210
etcd:
external:
endpoints:
- https://10.42.140.154:2379
- https://10.42.104.113:2379
- https://10.42.177.142:2379
caFile: /etc/kubernetes/ssl/ca.pem
certFile: /etc/etcd/ssl/etcd.pem
keyFile: /etc/etcd/ssl/etcd-key.pem
dataDir: /var/lib/etcd
clusterDNS:
- 192.96.0.2
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
We use an external etcd cluster, and the underlying network uses IPVS rather than iptables. We did an upgrade from 1.12.0 to 1.13.0.
# kubeadm upgrade apply 1.13.0
You can use this to test, and we're the ones that came up after the upgrade. #Adam Otto
There are some IPVS errors as follows:
kube-proxy logs
Seems like to be an MTU issue.

Redirected to compute.amazonaws.com

I'm running nginx on a basic AWS EC2 instance.
My nginx http server block looks like this:
server {
listen 80 default_server;
listen [::]:80;
# TLS redirect
server_name ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com;
return 301 https://$host$request_uri;
}
My https server block works fine, so when I enter:
https://ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com
In my browser, everything works, but when I enter:
http://ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com (http, not https)
I get redirected to
https://compute.amazonaws.com
Is there any obvious reason for this? Thanks in advance.
Edit with curl
[ec2-user#ip-xxx-xx-xx-xxx ~]$ curl -v http://ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com
* Rebuilt URL to: http://ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com/
* Trying 172.31.14.246...
* TCP_NODELAY set
* Connected to ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com (xxx.xx.xx.xxx) port 80 (#0)
> GET / HTTP/1.1
> Host: ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.10.2
< Date: Mon, 24 Apr 2017 22:09:39 GMT
< Content-Type: text/html
< Content-Length: 185
< Connection: keep-alive
< Location: https://ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.2</center>
</body>
</html>
* Curl_http_done: called premature == 0
* Connection #0 to host ec2-xx-xx-xxx-xxx.rr-rrrr-r.compute.amazonaws.com left intact

Riak Server Returning Error 404

I've installeld Riak 2 on a Centos 6 box and I've managed to boot Riak but now get this error when I try to test it:
curl -v http://<hostname>:8098/types/default/props
* About to connect() to <hostname> port 8098 (#0)
* Trying <hostname>... connected
* Connected to <hostname> (<hostname>) port 8098 (#0)
> GET /types/default/props HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: <hostname>:8098
> Accept: */*
>
< HTTP/1.1 404 Object Not Found
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Fri, 21 Aug 2015 01:02:48 GMT
< Content-Type: text/html
< Content-Length: 193
<
* Connection #0 to host <hostname> left intact
* Closing connection #0
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>[root#riak1 ~]#
Also I did modify my apps.config and vm like so:
{pb, [ {"", 8087 } ]}
{http, [ {"", 8098 } ]},
-name riak#
What does this mean and how do I fix it?

nginx = / location pattern not working

I am trying to configure nginx to serve a static html page on the root domain, and proxy everything else to uwsgi. As a quick test I tried to divert to two different static pages:
server {
server_name *.example.dev;
index index.html index.htm;
listen 80;
charset utf-8;
location = / {
root /www/src/;
}
location / {
root /www/test/;
}
}
This seems to be what http://nginx.org/en/docs/http/ngx_http_core_module.html#location says you can do. But I'm always getting sent to the test site, even on the / request by visiting http://www.example.dev in my browser.
Curl output:
$ curl http://www.example.dev -v
* Rebuilt URL to: http://www.example.dev/
* Hostname was NOT found in DNS cache
* Trying 192.168.50.51...
* Connected to www.example.dev (192.168.50.51) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.1
> Host: www.example.dev
> Accept: */*
>
< HTTP/1.1 200 OK
* Server nginx/1.8.0 is not blacklisted
< Server: nginx/1.8.0
< Date: Tue, 19 May 2015 01:11:10 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 415
< Last-Modified: Wed, 15 Apr 2015 02:53:27 GMT
< Connection: keep-alive
< ETag: "552dd2a7-19f"
< Accept-Ranges: bytes
<
<!DOCTYPE html>
<html>
...
And the output from the nginx access log:
192.168.50.1 - - [19/May/2015:01:17:05 +0000] "GET / HTTP/1.1" 200 415 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36" "-"
So I decided to comment out the test location. So I have only the location = / { ... block. Nginx now 404s and logs the following error:
2015/05/19 01:24:12 [error] 3116#0: *6 open() "/etc/nginx/html/index.html" failed (2: No such file or directory), client: 192.168.50.1, server: *.example.dev, request: "GET / HTTP/1.1", host: "www.example.dev"
Which is the default root in the original nginx conf file? I guess this confirms my location = / pattern is not matching.
I added $uri to the access log and see that it is showing /index.html which I guess means the first location pattern is matching, but then it goes into the second location block? So now I just need to figure out how to serve my index.html from the / block, or just add another block like: location =/index.html
according to #Alexey Ten commented, in ngx_http_index doc:
It should be noted that using an index file causes an internal redirect, and the request can be processed in a different location. For example, with the following configuration:
location = / {
index index.html;
}
location / {
...
}
a “/” request will actually be processed in the second location as “/index.html”.
In your case, request to "/" will not get /www/src/index.html, but /www/test/index.html.

Asterisk ARI / phpari - Bridge recording: "Recording not found"

I'm using phpari with Asterisk 13 and trying to record a bridge (mixing type).
In my code:
$this->phpariObject->bridges()->bridge_start_recording($bridgeID, "debug", "wav");
It returns:
array(4) {
["name"]=>
string(5) "debug"
["format"]=>
string(3) "wav"
["state"]=>
string(6) "queued"
["target_uri"]=>
string(15) "bridge:5:1:503"
}
When and I stop and save with
$this->phpariObject->recordings()->recordings_live_stop_n_store("debug");
It returns FALSE.
I debug with
curl -v -u xxxx:xxxx -X POST "http://localhost:8088/ari/recordings/live/debug/stop"
Result:
* About to connect() to localhost port 8088 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8088 (#0)
* Server auth using Basic with user 'xxxxx'
> POST /ari/recordings/live/debug/stop HTTP/1.1
> Authorization: Basic xxxxxxx
> User-Agent: curl/7.19.7 (xxxxx) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8088
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: Asterisk/13.2.0
< Date: Thu, 19 Feb 2015 11:58:18 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 38
<
{
"message": "Recording not found"
* Connection #0 to host localhost left intact
* Closing connection #0
}
Asterisk CLI verbose 5 trace: http://pastebin.com/QZXnpXVA
So, I've solved the problem.
It was a simple write permission problem.
Asterisk user couldn't write on /var/spool/asterisk/recording because it was owned by root.
Changing the ownership to the asterisk user solved it.
I detected this problem by looking at the Asterisk CLI trace again:
-- x=0, open writing: /var/spool/asterisk/recording/debug format: sln, (nil)
This (nil) indicates that the file could not be written, so I checked the folder and saw where the problem was.

Resources