#1  
Old 23rd November 2011, 21:13
dclardy dclardy is offline
Senior Member
 
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 49 Times in 28 Posts
Default Switch to NginX

Is it possible to switch from Apache to NginX? It seems like this should be able to be done without having to reinstall the entire system.
Reply With Quote
Sponsored Links
  #2  
Old 24th November 2011, 09:46
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,788
Thanks: 840
Thanked 5,612 Times in 4,423 Posts
Default

If none of your websites uses apache rewrite rules or .htaccess files or any other apache specific features, then it might be possible to migrate a system.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 24th November 2011, 18:33
dclardy dclardy is offline
Senior Member
 
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 49 Times in 28 Posts
Default

I have switched over to NginX the hard way at this point, but there is an issue with the PHP setup. I am using the DotDeb packages for Debain.

Here is the error in the log for the site:

Code:
2011/11/24 08:26:12 [error] 8099#0: *11 connect() to unix:/var/lib/php5-fpm/web1.sock failed (111: Connection refused) while connecting to upstream, client: 96.226.233.87, server: drewclardy.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/web1.sock:", host: "drewclardy.com"
Any ideas on how to fix this issue? What is the fastcgi:// part that is there?
Reply With Quote
  #4  
Old 25th November 2011, 03:54
dclardy dclardy is offline
Senior Member
 
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 49 Times in 28 Posts
Default

Any other ideas on this guys? I have been messing with it all day. From what I can see nginx can't connect to the socket. I have tried not using the socket, but that fails as well.
Reply With Quote
  #5  
Old 25th November 2011, 18:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Are permissions of /var/lib/php5-fpm/web1.sock ok?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 25th November 2011, 18:57
dclardy dclardy is offline
Senior Member
 
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 49 Times in 28 Posts
Default

They are set to the website iser and group.

web1 client1
Reply With Quote
  #7  
Old 25th November 2011, 20:14
dclardy dclardy is offline
Senior Member
 
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 49 Times in 28 Posts
Default

I am almost certain that there is an error with the way that the configuration files are being written for the NginX vhost. If you look at a vhost file that is written by the system, you find something like this:

Code:
server {
        listen *:80;


        server_name minecraftarea.com www.minecraftarea.com;

        root   /var/www/minecraftarea.com/web;



        index index.html index.htm index.php index.cgi index.pl index.xhtml;



        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;

        error_log /var/log/ispconfig/httpd/minecraftarea.com/error.log;
        access_log /var/log/ispconfig/httpd/minecraftarea.com/access.log combined;

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web3/.htpasswd_stats;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9012;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }




}
This does not allow the site to load from what I can tell. I was able to get the site to work properly by changing some of the configuration.

I had to remove the error document lines, and I had to put the different type of index lines into a location.

Code:
server {
        listen *:80;


        server_name drewclardy.com www.drewclardy.com;

        root   /var/www/drewclardy.com/web;

        error_log /var/log/ispconfig/httpd/drewclardy.com/error.log;
        access_log /var/log/ispconfig/httpd/drewclardy.com/access.log combined;


        location / {

        index index.html index.htm index.php index.cgi index.pl index.xhtml;
        try_files $uri $uri/ /index.php;

        }

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web1/.htpasswd_stats;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }


}
These changes allowed NginX to load the site that it was giving the connection error to before hand.

I am pretty sure that this is a critical bug!
Reply With Quote
  #8  
Old 26th November 2011, 13:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
 
Default

It is working with the ISPConfig configuration with the nginx versions that come with Ubuntu 11.04 and 11.10. If you take a look at http://wiki.nginx.org/NginxHttpIndexModule#index , you'll see that there's nothing wrong with it.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx doesn´t restart after installation of ISPConfig 3 cyprus Installation/Configuration 2 6th November 2011 19:48
A Working Nginx Catchall with ISPConfig 3. renders Tips/Tricks/Mods 4 15th April 2011 22:53
Nginx and PHP and Fastcgi Paladinemishakal Installation/Configuration 1 4th January 2011 14:45
Nginx on Fedora 11 Nammut HOWTO-Related Questions 1 3rd October 2009 17:35
Nginx + Apache on Ubuntu 8.04 AdamBoyle HOWTO-Related Questions 3 10th December 2008 23:54


All times are GMT +2. The time now is 22:24.


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