cuber / ngx_http_google_filter_module

Nginx Module for Google Mirror
BSD 2-Clause "Simplified" License
3.35k stars 779 forks source link

严格按照步骤来,左后打开的网页却是“Welcome to nginx!” #50

Closed ghost closed 9 years ago

ghost commented 9 years ago

提示:


Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.

Thank you for using nginx.


这是为什么?

cuber commented 9 years ago

是不是 nginx 进程没重启?

ghost commented 9 years ago

才发邮件给你,还以为你没看到,如何启动?

ghost commented 9 years ago

@cuber 发给你的邮件附件里边有Nginx配置文件,你看看有没有问题。

cuber commented 9 years ago

看你的配置,应该是装了某个发行版,一般来说这样子就可以重启了

sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx start
ghost commented 9 years ago

login as: root root@45.62.103.101's password: Last login: Tue Aug 11 10:58:34 2015 from 117.95.165.65 [root@default ~]# sudo /etc/init.d/nginx stop sudo: /etc/init.d/nginx: command not found [root@default ~]# sudo /etc/init.d/nginx start sudo: /etc/init.d/nginx: command not found [root@default ~]#

怎么提示找不到?

不可能是发行版,下载的地址都是说明里上边一部分的过程

ghost commented 9 years ago

@cuber

xavierskip commented 9 years ago

你还是把你的环境,是编译安装的nginx还是其他,说清楚吧

ghost commented 9 years ago

@xavierskip 用的是这个页面的最简安装那个步骤的内容,没用下边的发行版:https://github.com/cuber/ngx_http_google_filter_module/blob/master/README.zh-CN.md

你怎么看?

wenson commented 9 years ago

建议使用 which nginx ,确认下 nginx 在哪里,然后在使用 重启命令呗。

ghost commented 9 years ago

@wenson 让你见笑了,Linux命令我一点都不了解,都是按照别人的步骤来的,这些真的不懂。


[root@default ~]# which nginx /usr/bin/which: no nginx in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)


难道要我交出端口和密码?!

wenson commented 9 years ago

第一步: 查看 nginx是否正常启动? 命令:ps axu| grep nginx 如果没有启动建议可是使用find 命令 找下 nginx 在哪里 命令:find / -name nginx 然后尝试重启看看? 第二步: 查看配置文件是否正常? 建议贴出来 瞧瞧

ghost commented 9 years ago

@wenson 下边是运行命令的结果:


[root@default ~]# ps axu| grep nginx root 18564 0.0 0.5 5108 644 ? Ss 10:05 0:00 nginx: master process /opt/nginx-1.7.8/sbin/nginx nobody 18565 0.0 1.1 5244 1288 ? S 10:05 0:00 nginx: worker process root 18790 0.0 0.4 2280 556 pts/0 S+ 23:25 0:00 grep nginx [root@default ~]# find / -name nginx /root/nginx-1.7.8/objs/nginx /opt/nginx-1.7.8/sbin/nginx


配置文件待会邮给你,麻烦看一下。

ghost commented 9 years ago

@wenson 额,你的主页好像没你的邮箱,我发出来吧


user nobody;

worker_processes 1;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

pid logs/nginx.pid;

events { worker_connections 1024; }

http { include mime.types; default_type application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

server {
    listen       80;
    server_name  jingwei.pub;
    resolver 8.8.8.8;
    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        google on;
        google_scholar on;
        google_language "zh-CN";
       google_robots_allow on;
        google_ssl_off "www.google.com";

    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}


wenson commented 9 years ago

@zhongjingwei 1、 /opt/nginx-1.7.8/sbin/nginx stop 2、 /opt/nginx-1.7.8/sbin/nginx start 重启下web server 呗。

ghost commented 9 years ago

@wenson

[root@default ~]# /opt/nginx-1.7.8/sbin/nginx stop nginx: invalid option: "stop" [root@default ~]# /opt/nginx-1.7.8/sbin/nginx start nginx: invalid option: "start"

貌似还是不行

wenson commented 9 years ago

试试 这个 /opt/nginx-1.7.8/sbin/nginx -s reload

ghost commented 9 years ago

@wenson 哈哈OK了,不知道是那一步产生了效果,你知道吗?好像就是这条命令/opt/nginx-1.7.8/sbin/nginx -s reload ,这是什么意思,顺便学习一下

wenson commented 9 years ago

done. 改密码吧

wenson commented 9 years ago

重启 nginx 而已 参考资料: http://blog.chinaunix.net/uid-29791971-id-4702007.html

ghost commented 9 years ago

@wenson 我觉得这个速度不够快,显然没我的shadowsocks快,有没有什么办法优化一下?

ghost commented 9 years ago

@wenson 这是网址:jingwei.pub

你来体验一下速度,看看还能不能优化

ghost commented 9 years ago

@wenson 我又重做了一边,现在貌似又不行了,我输入/opt/nginx-1.7.8/sbin/nginx -s reload ,返回的结果是:

[root@default ~]# /opt/nginx-1.7.8/sbin/nginx -s reload nginx: [emerg] directive "resolver" is not terminated by ";" in /opt/nginx-1.7.8/conf/nginx.conf:43

这样正确吗?

ghost commented 9 years ago

@wenson 好吧,我看懂了,是我太大意,少了一个;

wenson commented 9 years ago

小小意见,这样写 配置文件不太干净,有空研究下 vhosts吧。 参考资料:http://tabalt.net/blog/nginx-virtual-host/

ghost commented 9 years ago

@wenson 好像是我的vps太渣了,后来我又在DigitalOcean上搭建了一下,几乎搜索结果都是秒开,就是心疼钱

cuber commented 9 years ago

很高兴你的问题解决了。 btw. 自从出了国际氮气瓶,上海电信根本无法愉快的玩耍了...