Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nginx + PHP-FPM Error: This Page is Temporarily Unavailble
#1
Bug 
Hi Guys,

I am trying to setup a Nginx/PHP-FPM + SimpleCMS server on my raspberry Pi (Raspian) and I am running into some trouble.

When I try to load my site all I get is : This Page is Temporarily Unavailble

I have checked the error logs but there are no errors listed in the nginx log or the php5-fpm log, so I am having a bit of trouble tracking down the issue.

My server is on port 1080 and the content directory is /var/ww/cms

I do not have much experience with Nginx config files so maybe someone could take a look, I believe it is all Ok though:

Code:
#   Pi Nginx Config v0.1 10:53 30/01/2014
#   NOTE: fastcgi is NOT php5-fpm

server {
    listen 1080;
    #       server_name mysite.org;
    charset utf-8;
    access_log off;
    root /var/www/cms;
    index index.php;

    location / {
        try_files       $uri $uri/ /index.php?id=$uri&$args;
    }

   location ~* /admin/.*\.php$ {
        try_files $uri /admin/index.php?id=$uri&$args;      # Try the admin index page
        include /etc/nginx/fastcgi_params;
        fastcgi_index index.php;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
   }        



    location ~* \.php$ {
        try_files $uri =404;        # Try any .php files in root or throw a 404
        include /etc/nginx/fastcgi_params;
        fastcgi_index index.php;
        # NOTE: You should have "cgi.fix_pathinfo = 0;" in /etc/php5/fpm/php.ini
        # With php5-fpm:
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        expires 2h;
    }

    location ~* \.(?:ico|js|gif|jpg|png)$ {
        expires 14d;
    }

    location ~* \.(htm|css|html)$ {
        expires 2d;
    }

# this blocks direct access to the XML files (but sitemap.xml) - that hold all the data
    location ~* \.xml$           { deny all; }
location ~* \.xml\.bak$     { deny all; }
    location = /sitemap.xml { allow all; }

# this prevents hidden files (beginning with a period) from being served
    location ~ /\.          { deny all; }
    location ^~ /uploads/ {
    if ($request_uri ~* \.php$) {return 403;}
    }
}


Any help or advice on the Issue would be great, I would love to get this up and running.

Thanks,
Dan
Reply
#2
Read the release notes or the installation instructions from the readme
goto /admin
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Ok, so I have had a look through the docs and the readme.

The error that I am getting when I try to access /admin is now:
create_pagesxml: unable to open /var/www/cms/data/pages/

I thought this may have been a permissions issue so I set the permissions using:

sudo chmod -R 0775 /var/www/cms

I am still getting the same error however.
Reply
#4
What is the entire error ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
Apologies,

This is displayed on the page:
create_pagesxml: unable to open /var/www/cms/data/pages/

I have tailed the log and refreshed the page but there are no errors coming through.
Reply
#6
There should be more, like the filename and line number
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
ahhh this is not an error, this is output by gs
turn debug mode on and see if you get any php errors.

$path = GSDATAPAGESPATH;
$dir_handle = @opendir($path) or die("getPageXmlValues: Unable to open $path");
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
I am assuming you still have not been able to install ?
So you cannot check health check ?

you can rename the temp gsconfig and uncomment debug

Check that data/pages exists and check its permissions and owner
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Just a quick look and I can see that data/pages does not exist.

Ill debug this further at home later and update you on progress.
Reply
#10
Ok, Im getting a little bit further.

The issue was to do with permissions, I ran chmod 775 on the cms dir and it has gotten me further into the instillation process.

I am currently stuck at the install screen asking for Website Name, Username, email.

I fill in these details but I am shown an Error in the browser:

"Error: There was a problem with your website URL"

Any ideas as to what would be causing this ?

EDIT* No errors in the logs again.
Reply
#11
I dont know, I would start over and chmod everything to 777 before trying to install.

If I had to guess your owner of your files are not in the same group as php and php is not having any success creating necessary files, maybe you can chown them instead also.

sitename, comes from a hidden field in setup which guesses it from
all kinds of stuff

I have never seen setup fail at this stage before.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
Ok, I have done a format and a clean install.

Still no luck, Everything went smoothly up until entering the website name.

here is install.php:
[Image: Vbhv9p8.png][/align]

And the error I get on setup.php:
[Image: bkIwmgl.png]


The whole directory has 777 permissions so that Is no longer an issue.

I believe this may be to do with the nginx rewrites or something in the config. Has anyone managed to get this working on Nginx ?
Reply
#13
What is up with your php version?

Can you check the source code and see what the sitename hidden input says ?

Is your domain something wierd, or alternate port, or utf-8 ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#14
Hi, Thats the PHP version used for the Raspbian, Im running this on a Raspberry Pi.

Domain name should be fine.

I just had a look at the sourcecode:

<form action="/admin/setup.php" method="post" accept-charset="utf-8" >
<input name="siteurl" type="hidden" value="http:///" />
<input name="lang" type="hidden" value="en_US" />

It seems like siteurl is not getting passed anything. This must be the issue, and idea as to how to sort it ?
Reply
#15
We use server super global server_name to get it, perhaps your config is not setting it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#16
Ah,

I needed to specify a server_name in my site nginx config. I have it installed finally Smile.

I will post up the nginx config when I get a chance later.

Thanks for all your help Shawn.
Reply
#17
Also see documentation on use canonical, I know apache uses this also and it can be a security hole if left off on depending on vhost configuration.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)