Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 16th April 2012, 00:22
madven madven is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Installing Nginx With PHP5 (And PHP-FPM) On CentOS 6.0 problem

i followed your guide at http://www.howtoforge.com/installing...-on-centos-6.0
i put my info.php file at /usr/share/nginx/html .
my nginx.conf file configuration is: (inside http block)

"server {
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}"

i run it on a virtual machine.

my /etc/hosts file is:

"127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6"

my "inet addr:192.168.0.17" .

and when i try localhost/info.php , firefox says:

"You have chosen to open
info.php
which is a: BIN file (20 bytes)
from: http://localhost
Would you like to save this file?"

how to solve this?
thanks a lot..
Reply With Quote
Sponsored Links
  #2  
Old 16th April 2012, 10:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

What's the output of
Code:
netstat -tap
?

Can you post the contents of your info.php file?
__________________
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
  #3  
Old 16th April 2012, 18:27
madven madven is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

output of netstat -tap

Code:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1217/rpcbind        
tcp        0      0 *:http                      *:*                         LISTEN      5433/nginx          
tcp        0      0 *:x11                       *:*                         LISTEN      1828/X              
tcp        0      0 *:59638                     *:*                         LISTEN      1322/rpc.statd      
tcp        0      0 localhost.localdomain:ipp   *:*                         LISTEN      1419/cupsd          
tcp        0      0 localhost.localdomain:smtp  *:*                         LISTEN      1609/master         
tcp        0      0 localhost.locald:cslistener *:*                         LISTEN      5415/php-fpm        
tcp        0      0 192.168.0.21:58155          ee-in-f132.1e100.net:https  ESTABLISHED 5090/chrome --user- 
tcp        0      0 192.168.0.21:57197          fra07s07-in-f17.1e100:https ESTABLISHED 5090/chrome --user- 
tcp        0      0 192.168.0.21:43560          www-11-03-frc1.faceboo:http TIME_WAIT   -                   
tcp        0      0 192.168.0.21:58741          muc03s01-in-f19.1e100:https ESTABLISHED 5090/chrome --user- 
tcp        0      0 192.168.0.21:54099          fra07s07-in-f102.1e10:https ESTABLISHED 5090/chrome --user- 
tcp        0      0 192.168.0.20:48970          195.175.68.121.static.:http ESTABLISHED 1988/clock-applet   
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1217/rpcbind        
tcp        0      0 *:x11                       *:*                         LISTEN      1828/X              
tcp        0      0 localhost6.localdomain6:ipp *:*                         LISTEN      1419/cupsd          
tcp        0      0 *:38887                     *:*                         LISTEN      1322/rpc.statd
contents of /usr/share/nginx/html/info.php file

Code:
<?php
phpinfo();
?>
thanks
Reply With Quote
  #4  
Old 16th April 2012, 19:43
madven madven is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default i think i solved

i tried to add
Code:
server_name localhost;
to my nginx.conf file's server block
Code:
server {
	server_name localhost;
        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm index.php;
        }
	location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
and it works.

actually i dont know much about nginx configuration. and dont understand why it didnt work and when i add it why it works?

when i add
Code:
server_name  _;
and restart nginx, it says:

Code:
/etc/init.d/nginx restart
nginx: [warn] conflicting server name "_" on 0.0.0.0:80, ignored
Stopping nginx:                                            [  OK  ]
Starting nginx: nginx: [warn] conflicting server name "_" on 0.0.0.0:80, ignored
                                                           [  OK  ]
and localhost/info.php doesnt work..
why it says so?

thanks..
Reply With Quote
  #5  
Old 17th April 2012, 12:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

Quote:
Originally Posted by madven View Post
when i add
Code:
server_name  _;
and restart nginx, it says:

Code:
/etc/init.d/nginx restart
nginx: [warn] conflicting server name "_" on 0.0.0.0:80, ignored
Stopping nginx:                                            [  OK  ]
Starting nginx: nginx: [warn] conflicting server name "_" on 0.0.0.0:80, ignored
                                                           [  OK  ]
and localhost/info.php doesnt work..
why it says so?

thanks..
You probably have another vhost that uses
Code:
server_name  _;
already.

You always need a server_name directive if you want to run multiple vhosts on the same IP because otherwise name-based vhosts don't work (nginx cannot know which vhost to display if there's no server_name directive).
__________________
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
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
Newly Installed ISPConfig3 on Ubuntu 8.04 : login redirect fail ? cripperz Installation/Configuration 5 22nd March 2009 12:15
Upgrade to php 5.2 in suse 10.1 gimhan90 Installation/Configuration 3 1st January 2009 20:32
Problem installing ISPconfig - PHP Binary error Danielss89 Installation/Configuration 3 10th January 2007 15:10
ubuntu ispconfig joomla .htaccess steve1084 General 8 6th January 2007 15:55


All times are GMT +2. The time now is 21:15.


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