HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   question regarding the Nginx Catch-All Host As Front End To Apache For ISPConfig3 tut (http://www.howtoforge.com/forums/showthread.php?t=49443)

Ovidiu 15th October 2010 02:25

question regarding the Nginx Catch-All Host As Front End To Apache For ISPConfig3 tut
 
Just for references, I am talking about this tutorial: http://www.howtoforge.com/nginx-catc...n-debian-lenny

The issue is this: I have reached the limits of my current server config.
I remember I didn't want to have any such installation of nginx or lighttpd a couple of years ago as traffic and logging were still an issue back than. It seems having nginx as a front-end web server works for traffic counting and logging now? Even if it doesn't I'd still love to implement this.

Now onto my questions:

Does anyone actually have this running according to the tutorial I linked to? Any other configuration changes I'd need if running the latest ispcfg3 and the latest Debian installation according to the perfect debian server setup from howtoforge?

I don't fully understand this configuration file:

Code:

server {
    listen  80 default;
        server_name  _;
        server_name_in_redirect  off;
    resolver  127.0.0.1;
#### www. redirect    - all domains starting with www will be redirected to http://domain. ####
    if ($host ~* ^(www\.)(.+)) {
        set $rawdomain $2;
        rewrite ^/(.*)$  http://$rawdomain/$1 permanent;
    }
    access_log  /var/log/ispconfig/httpd/$host/access.log;
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|html|htm|mp3)$ {
    root  /var/www/$host/web;
    access_log off;
    expires 30d;
    }
location / {
    root  /var/www/$host/web;
    index  index.html index.htm index.php;
        access_log      off;
        proxy_pass http://$host:82;
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

Does this configuration automatically redirect any request from www. to the non-www version? I can't have that, I have to let my clients decide that for themselves.
Can I remove that by commenting the code like this:
Code:

#### www. redirect    - all domains starting with www will be redirected to http://domain. ####
###    if ($host ~* ^(www\.)(.+)) {
###        set $rawdomain $2;
###        rewrite ^/(.*)$  http://$rawdomain/$1 permanent;
###    }

what exactly does this code do?
Quote:

access_log /var/log/ispconfig/httpd/$host/access.log;
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|d oc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js |swf|flv|html|htm|mp3)$ {
root /var/www/$host/web;
access_log off;
expires 30d;
To me it looks like it integrates into the existing logging system?
Does it log errors too?
Can someone add that code?
Why does it say access_log off; is it disabled?

anything else I need to know before heading out and implementing this tutorial? Any issues I should be aware off? Any incompatibilities involved?
Can I continue updating ISPCFG3 as before without breaking anything?

Ovidiu 15th October 2010 17:21

Anyone? Please, I#d be very glad even for partial answers - maybe you know hte answer to one of my questions at least?

Ovidiu 18th October 2010 16:49

really nobody can add anything to my questions?
I promise I won't bump it again!

oh and is this tutorial compatible with this nginx version: nginx (0.7.67-3~bpo50+1 Debian Backports:lenny-backports) ?

falko 19th October 2010 17:26

I'd love to help, but I didn't try the tutorial. :(

Ovidiu 19th October 2010 20:53

the problem is I don't have a testing server :-( that is the reason I was asking for people who have used/tried this plugin.

Tried contacting the author of the howto but no response yet.

Ovidiu 20th October 2010 11:27

@falko:

is the part about ispcfg3 at least correct?
I mean the part with the custom templates and can I continue updating ispcfg3 without breaking anything?

I guess I will have ot give it a try one of these nights and would liek to at least know that if I get it to work I won't be sacrificing my future updates of ispcfg3...

damir 20th October 2010 11:51

Tenaka, install VM Player and install virtual machine that simulates your environment. Test it and than deploy it to your production server.

Why try something that you are not familiar with on your live server and risk breaking the installation.

falko 21st October 2010 15:56

Quote:

Originally Posted by damir (Post 242351)
Tenaka, install VM Player and install virtual machine that simulates your environment. Test it and than deploy it to your production server.

That's what I'd recommend as well.

Ovidiu 22nd October 2010 04:06

:-) I know its good practice but I live in a country where the average internet connection is 384kbps. and I have 4 flatmates which gives each of us about 56k => modem speed I had 15 years ago when I lived in Europe :-(

Will try and duplicate a test environment at home though but i.e. the upgrading I can't simulate I'd have to wait for a new ispcfg version to test...

Ovidiu 23rd October 2010 05:32

ran into some trouble, here is the error log:

Quote:

tail -f /var/log/nginx/error.log
2010/10/23 04:20:02 [error] 28148#0: *4 pacura.ru could not be resolved (5: Operation refused), client: 196.210.184.235, server: _, request: "GET /wp-admin/index.php HTTP/1.1", host: "pacura.ru", referrer: "http://pacura.ru/wp-admin/index.php?w3tc_note=flush_pgcache"
2010/10/23 04:20:02 [error] 28148#0: *5 testing "/usr/local/nginx/html" existence failed (2: No such file or directory) while logging request, client: 127.0.0.1, server: _
2010/10/23 04:20:03 [error] 28148#0: *6 testing "/usr/local/nginx/html" existence failed (2: No such file or directory) while logging request, client: 89.28.21.131, server: _
2010/10/23 04:20:05 [error] 28148#0: *7 localhost could not be resolved (5: Operation refused), client: 127.0.0.1, server: _, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2010/10/23 04:20:53 [error] 28148#0: *70 open() "/var/www/dany.zice.ro/web/robots.txt" failed (2: No such file or directory), client: 142.166.170.100, server: _, request: "GET /robots.txt HTTP/1.1", host: "dany.zice.ro"
as far as I can see there are problems with the apache2 module server-status and subdirectories: /var/www/dany.zice.ro/web/robots.txt zice.ro is a wpmu installation where all subdomaisn are added dynamically. :-(

Anyone has any ideas?


All times are GMT +2. The time now is 19:17.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.