Hello Nginx!

原创 2018年04月17日 21:00:14

So far, I configured the apache+tomcat, IIS+apusic, but have never configured Nginx before.

Today, the interesting strongly push me to start this trip of Nginx, I cannot reject this.

Nginx has a quick response for static resources, it can HOLD 500 thousands request per second. It costs only  1/5 CPU and 1/10 memory of apache.

My server is ubuntu16, user is root, as I met the error below when I used a normal user even added to /etc/sudoer.

Fatal error: can't create objs/src/core/nginx.o: 权限不够
make[1]: *** [objs/src/core/nginx.o] 错误 2
make[1]: 离开目录“/usr/local/nginx-1.9.0”
make: *** [build] 错误 2

1st step: installation and configuration

1.1  install components which Nginx relies on.

yum -y install gcc gcc-c++ autoconf automake

yum -y install pcre pcre-devel

yum -y install zlib zlib-devel

yum -y install openssl openssl-devel 

1.2 install nginx

cd /usr/local

sudo wget http://nginx.org/download/nginx-1.9.0.tar.gz

sudo tar -xzvf nginx-1.9.0.tar.gz

cd nginx-1.9.0

./configure --prefix=/usr/local/nginx --with-http_ssl_module &&make &&make install

1.3 start the nginx

/usr/local/nginx/sbin/nginx

1.4 visit nginx via brower

http://{input the ip address here}:80/

we will get the following content in the page.

Welcome to nginx!

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

For online documentation and support please refer tonginx.org.
Commercial support is available atnginx.com.

Thank you for using nginx.

done, celebration!

Nginx的第一个模块-Hello World

麻雀虽小,五脏俱全,小小的Hello World盛行于程序世界,就在于其代码虽短,但要真正运行起来,需要我们略通基本语法,稍懂编译运行环境,知晓操作过程,最后,还有一颗持之以恒,不怕折腾的心。前一阵子...
  • u013140542
  • u013140542
  • 2014-08-25 21:34:56
  • 1326

Nginx上的第一个HelloWorld

前言(废话): 刚刚看完 深入理解nginx模块开发与架构解析的http处理模块,想想先写一个http处理模块的hellowrold,也算是入门了吧。 安装完nginx就可以搞了,安装配置请参考N...
  • my_sky2012
  • my_sky2012
  • 2015-11-02 09:29:31
  • 939

Nginx编写HTTP模块:第一个Nginx HTTP模块 “Hello World!”

写一个Nginx的http模块,当向Nginx发送请求时,Nginx返回“Hello World!” 一、代码         文件名:ngx_http_mytest_module.c #inclu...
  • kanguolaikanguolaik
  • kanguolaikanguolaik
  • 2015-05-01 21:49:31
  • 1360

nginx 编写简单HTTP模块 hello world

1. 编写HTTP模块1.1 目标 编写一个简单的显示hello world 信息的HTTP 模块 1.2 几个重要组成部分1.2.1 ngx_command_t 数组 也就是说, 对于我们在ngi...
  • zhyh1435589631
  • zhyh1435589631
  • 2016-06-11 22:55:31
  • 1435

Nginx的http开发中用两种介入方式打印“hello world”

在对nginx进行http开发时,有两种方式介入http模块,具体可以参考nginx模块定制开发中介入http模块的方法及NGX_HTTP_CONTENT_PHASE阶段的详细介绍,下面用代码来具体实...
  • lijinqi1987
  • lijinqi1987
  • 2016-11-07 19:04:27
  • 1266

[转]开发nginx模块之Hello World篇

1 进行echo模块的功能设计 以下是本模块要能识别的nginx配置 作为演示模块,我们这个模块仅仅完成以下功能: 读入nginx.conf中以echo开头的配置;echo是本模块新加入的命...
  • wangyi1988wang
  • wangyi1988wang
  • 2014-06-05 06:46:02
  • 441

nginx 两种hello world

core 下api  #define ngx_http_conf_get_module_loc_conf(cf, module)                       ...
  • cschengvdn
  • cschengvdn
  • 2014-04-05 20:25:20
  • 490

Lua:Nginx Lua环境配置,第一个Nginx Lua代码

一、编译安装LuaJIT         Lua:编译安装LuaJIT,第一个Lua程序,http://blog.csdn.net/guowenyan001/article/details/48250...
  • kanguolaikanguolaik
  • kanguolaikanguolaik
  • 2015-09-06 20:54:47
  • 3372

Hello nginx

1. Reverse proxy In computer networks, a reverse proxy is a type of proxy server that retrieves...
  • hanruikai
  • hanruikai
  • 2015-07-29 18:00:10
  • 392

nginx设置可以默认访问index.php

vim /usr/local/nginx/conf/nginx.conf:      在 location /{                index index.php index.html...
  • chenmoimg_
  • chenmoimg_
  • 2017-03-21 14:31:50
  • 490
收藏助手
不良信息举报
您举报文章:Hello Nginx!
举报原因:
原因补充:

(最多只允许输入30个字)