Nginx 的安装入门
来源:互联网 发布:mac的复制黏贴快捷键 编辑:程序博客网 时间:2024/05/16 03:38
1.首先需要安装必须的库,PCRE,zlib
sudo apt-get install libpcre3 libpcre3-dev
如果找不到文件的话就下载源文件进行安装。
2.解压下载的nginx源码,进入目录: sudo ./configure 得到的输出如下:
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using builtin md5 code
+ sha1 library is not found
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
+ using system PCRE library
+ OpenSSL library is not used
+ using builtin md5 code
+ sha1 library is not found
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
3. sudo make
4. sudo make install
5. 查看配置文件,然后启动
vonzhou@de16:~/nginx-1.0.15$ sudo /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
vonzhou@de16:~/nginx-1.0.15$ sudo /usr/local/nginx/sbin/nginx
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
vonzhou@de16:~/nginx-1.0.15$ sudo /usr/local/nginx/sbin/nginx
此时查看进程有:
vonzhou@de16:~/nginx-1.0.15$ ps -axu | grep nginxroot 9723 0.0 0.0 22536 592 ? Ss 22:49 0:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 9724 0.0 0.0 22936 1052 ? S 22:49 0:00 nginx: worker process
6. 然后可以通过curl简单测试index页面:
vonzhou@de16:~$ curl http://localhost:80/
<html>
<head>
<title>Welcome to nginx!</title>
</head>
<body bgcolor="white" text="black">
<center><h1>Welcome to nginx!</h1></center>
</body>
</html>
<html>
<head>
<title>Welcome to nginx!</title>
</head>
<body bgcolor="white" text="black">
<center><h1>Welcome to nginx!</h1></center>
</body>
</html>
根据nginx.conf的配置,响应文件是html/index.html页面:
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
1 0
- Nginx 的安装入门
- nginx windows安装入门
- Nginx 安装入门
- nginx入门之安装
- Nginx 安装配置入门
- Nginx--入门及安装
- 【nginx】nginx的安装
- windows下nginx的安装及使用方法入门
- windows下nginx的安装及使用方法入门
- windows下nginx的安装及使用方法入门
- windows下nginx的安装及使用方法入门
- windows下nginx的安装及使用方法入门
- Nginx入门介绍与安装
- nginx的入门
- nginx的入门案例
- Nginx的使用入门
- Nginx的入门使用
- Nginx的入门使用
- mac 终端 svn 命令
- spring定时器的实现方式-quartz 实现方式
- 唯快不破!90后大学生9天完成近670页的Swift语言文档翻译
- Linux声卡驱动移植和测试
- 找大数问题
- Nginx 的安装入门
- Android 自定义的数字键盘 支持随意拖动 和稳定的字符输入的控件
- C#不重启程序读取appconfig
- spring与Quartz整合实现定时邮件发送
- MYSQL的master,slave环境的搭建
- Android: NDK编程入门笔记
- sphinx/coreseek如何及时删除索引里的数据呢
- leetcode:Reverse Words in a String
- java网络的流量控制