Pages

Thursday, 14 June 2012

如果你的基于nginx的站点出现Unable to connect的提示

ym     21:46:58        
    hi.i rebooted the first vps,but my site http://mydomain.com shows "Unable to connect".i reloaded nginx,still no use.why?
        Martin     21:47:21        
    is nginx actually running ?    
        ym     21:49:12        
   
-bash-3.2# ps aux | grep nginx
root 4230 0.0 0.1 4008 664 pts/0 R+ 09:48 0:00 grep nginx
-bash-3.2#
this means it's not running?
        Martin     21:49:25        
    correct    
        ym     21:55:06        
    -bash-3.2# /usr/local/nginx/sbin/nginx
[emerg]: unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:142
   
    but i checked the 142nd line of nginx.conf,it seems no problem,why appear such hint?    
   
   
        Martin     21:56:10        
    | 13.04.2012 09:01:30 | Martin: Hi
| 13.04.2012 09:05:03 | ym: hi.i restarted my first vps,then my site http://mydomain.com shows "Unable to connect",i think this is caused by nginx,so i run "/usr/local/nginx/sbin/nginx -s reload",but it shows "[emerg]: unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:140",i checked nginx.conf,the 140th line is "ssl on;",this is normal setting,why it give me such hint?
| 13.04.2012 09:05:37 | Martin: maybe an ssl module needs loading?
| 13.04.2012 09:06:59 | ym: possible,
| 13.04.2012 09:08:01 | ym: but i remember when i compiled nginx ,i added ssl module option
| 13.04.2012 09:09:09 | Martin: I don't know, but maybe it needs loading still?
| 13.04.2012 09:19:29 | ym: now it's ok.i rerun ./configure and make,make install
| 13.04.2012 09:19:45 | Martin: Ok, that's good.    
   
    same problem.    
   
   
        ym     22:00:48        
    now i need to enter the unzipped folder of nginx,but where is it?linux needs too much brain's memory
        Martin     22:01:23        
    I don't know where you unzipped it to, maybe /root ?    
        ym     22:02:09        
    sigh,my brain rusted
   
    yes,it's in /root    
   
    headache,.i rerun ./configure and make,make install,still not ok    
   
        Martin     22:08:38        
    is the SSL module being compiled?    
        ym     22:22:53        
    now it's ok.
#cd nginx-0.8.46
#./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module
#make && make install
然后
# /usr/local/nginx/sbin/nginx