我login到我的EC2控制台创build了一个新的实例,并附上一个Elastice IP到它。 然后我login到服务器并安装了Nginx:
$ sudo apt-get install nginx $ sudo /etc/init.d/nginx start $ Starting nginx: nginx.
当我导航到弹性IP(或公用DNS)时,我什么也得不到。 默认设置应该足以让我看到默认的Nginx欢迎页面吗? 我撞墙了,不知道下一步该怎么做。 我们欢迎所有的build议?
我没有碰它,但这是我的默认nginx.conf:
user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ## #include /etc/nginx/naxsi_core.rules; ## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } #mail { # # See sample authentication script at: # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript # # # auth_http localhost/auth.php; # # pop3_capabilities "TOP" "USER"; # # imap_capabilities "IMAP4rev1" "UIDPLUS"; # # server { # listen localhost:110; # protocol pop3; # proxy on; # } # # server { # listen localhost:143; # protocol imap; # proxy on; # } #}
没有任何访问或错误日志,我也确保nginx正在运行:
ps -ax | grep nginx Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html 4305 ? Ss 0:00 nginx: master process /usr/sbin/nginx 4306 ? S 0:00 nginx: worker process 4307 ? S 0:00 nginx: worker process 4308 ? S 0:00 nginx: worker process 4309 ? S 0:00 nginx: worker process
这里最可能的问题是,您需要在EC2安全组设置中打开端口80,以便实例可以接受到Web服务器的入站stream量。