Stuck with Perusio config

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
EdPhillis's picture

I have installed nginx and php5-fpm and using perusio's D7, tcp configs but the best I can get is the default index.html page in /usr/share/nginx/html. Even with the 000-default virtual host disabled i still get that html page. If I comment out example to the best of my understanding i get a loopback issue. So i disable 'return' line and then I get back to index.html.

I would be very grateful for some pointers. Here is my virtual hosts file. Ive got dns pointing to nginx.*.org.uk

server {
    listen 80; # IPv4
    server_name nginx..org.uk;
##    return 301 $scheme://nginx.
.org.uk$request_uri;
}
server {
  limit_conn arbeit 32;
    access_log /var/log/nginx/nginx_access.log;
    error_log /var/log/nginx/nginx_error.log;
    if ($bad_bot) {
        return 444;
        ## Deny access based on the Referer header.
    if ($bad_referer) {
        return 444;
    }
    if ($not_allowed_method) {
        return 405;
    }
    root /var/www/sites/drupal;
    index index.php;

    fastcgi_keep_conn on;

    include apps/drupal/drupal.conf;

    include apps/drupal/drupal_install.conf;

    include apps/drupal/drupal_upload_progress.conf;

    include nginx_status_vhost.conf;

}

Comments

What about your nginx.conf

FanisTsiros's picture

What about your nginx.conf file?
Does it contain the line:
include /etc/nginx/sites-enabled/*;
Have you made the necessary symbolic link from /sites-available/your-site.conf to /sites-enabled/your-site.conf ?

Thanks but

EdPhillis's picture

yes I have made the symbolic link. I will check that nginx.conf includes that line.

Seems that you must have only

flocondetoile's picture

Seems that you must have only one server block for your site nginx..org.uk.

have you tried running nginx

Kristina Katalinic's picture

have you tried running nginx -t and see what sort of errors it shows? Also why is there 2 server blocks when they are both misconfigured? Also

listen 80; # IPv4
    server_name nginx..org.uk;
should go before
server {
  limit_conn arbeit 32;
    access_log /var/log/nginx/nginx_access.log;

as that server block is pointing to the root folder for your site...
1st server block needs to be commented out or deleted since you are not using the redirect anyway.

The reason why you are still seeing default index.html is either that you haven't reloaded or restarted nginx service after having 000-default virtual host disabled ..... or, perhaps that would still show up as default page since your 1st server block isn't pointing to any root folders and your second server block where root folder variables are configured does not contain server_name variable so nginx may be looking into its own root folder and displaying default index.html page but in a nutshell your .conf is invalid with 2 server blocks that dont lead anywhere and you only need one unless you want to be redirecting from www. to yoursite to yoursite without www

Drupal web developer and Search Engine Optimisation consultant at Webmar Design & Development Brisbane, Australia
Google+

Good day! You need to define

sergey-serov's picture

Good day!

You need to define server name in the server block:

# just redirect here
server {
  listen *:80;
  server_name example.com;
  return 301 $scheme://www.example.com$request_uri;
}

# main config
server {
  listen *:80; # don't forget this line
  server_name www.example.com; # don't forget this line
  root /path/to/dir; # don't forget this line too

  # all your others things
}

Good luck!

That nails it! Pretty much my

Kristina Katalinic's picture

That nails it!
Pretty much my own answer but short and sweet :)

Drupal web developer and Search Engine Optimisation consultant at Webmar Design & Development Brisbane, Australia
Google+

maybe :) With time became

sergey-serov's picture

maybe :)
With time became clear that the right way is shorter - just reading official documentation and writing configs from first line to end on one's own.

Thanks everyone

EdPhillis's picture

I am pretty sure I have tried that config. I think that was where I was getting a loop. I will have another go though. Besides the config problems I think that there is just something going wrong here between nginx and php5-fpm. If I can serve myfile.html ok from usr/share/nginx/html then I should be able to serve myfile.php from that location. But I can't.

If I netstat -tclp then I can see php5-fpm using tcp on 4 ports (9000, 9001, 9002, 9003) so nginx is running, php5-fpm is running.
nginx -t doesn't complain of anything. When i reload nginx everything passes ok.

Im sure its something very simple but then so is the needle that lies in the proverbial haystack!

You definitely need to define

mesch's picture

You definitely need to define the server_name in the block.

Is there anything in your server or php5-fpm logs that could help identify the problem?

pool.d

EdPhillis's picture

I am just wondering whether i need to do anything with the pool.d files. I have just left them as per perusio's configs.

back to where i was

EdPhillis's picture

As I thought, I put in that config. nginx reload. All looked good.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

nginx -t doesnt complain about anything.

Could it be because this is a sub-domain? Or conflicting with my fqdn on the server which is the same domain.

Website: nginx.123.org.uk
FQDN server 123.org.uk
Website elsewhere: www.123.org.uk

Progress..

EdPhillis's picture

I just used one server block. And now I almost get through to install.php. But I require authentication!

### Installation handling. This should be commented out after
### installation if on an already installed site there's no need
### to touch it. If on a yet to be installed site. Uncomment the
### line below and comment out after installation. Note that
### there's a basic auth in front as secondary ligne of defense

So I have no idea what the auth details are.

Perusio's config requires

mesch's picture

Perusio's config requires http auth to access the install page. You can disable it by commenting out the following block at /path/to/nginx/apps/drupal/drupal_install.conf:

location = /install.php {
    auth_basic "Restricted Access"; # auth realm
    auth_basic_user_file .htpasswd-users; # htpasswd file
    fastcgi_pass phpcgi;
}

Or you can create a set of http auth credentials for yourself (lots of existing tutorials out there).

Dear derek smalls. I open

sergey-serov's picture

Dear derek smalls.

I open www.123.org.uk and I see:
" GET http://www.123.org.uk/ net::ERR_ADDRESS_UNREACHABLE"
It seems loop redirect.

In any way. May be your config too huge for understanding and finding error.
I recommend You to start with simple several lines, which necessary - and check.
If all right - add new lines - and check again.
Move from simple (necessary minimum) to more complicated.

wooooohoooo

EdPhillis's picture

Im in. Thanks everyone for your feedback.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: