How to install nginx in Ubuntu

The steps for installing the nginx on Ubuntu below.

1.install the packages first.

apt-get install gcc
apt-get install libpcre3 libpcre3-dev
apt-get install zlib1g zlib1g-dev
apt-get install openssl openssl-dev

2.download the source code of nginx from the website http://nginx.org/en/download.html

3. uncompress the downloaded nginx file.

tar zxvf nginx-1.8.0

4.install nginx.

su root #using root user to install nginx
cd /home/pinxiong/pinxiong/nginx-1.8.0/ #the directory is the unpressed nginx‘s dictory.
./configure
make
make install

5.check if nginx configure is right.

[email protected]:/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

6.check if nginx had started.

[email protected]:/usr/local/nginx# ps -ax | grep nginx
17050 ?        Ss     0:00 nginx: master process ./sbin/nginx
17051 ?        S      0:00 nginx: worker process
17052 ?        S      0:00 nginx: worker process
17053 ?        S      0:00 nginx: worker process
17054 ?        S      0:00 nginx: worker process
17055 ?        S      0:00 nginx: worker process
17056 ?        S      0:00 nginx: worker process
17057 ?        S      0:00 nginx: worker process
17058 ?        S      0:00 nginx: worker process
17059 ?        S      0:00 nginx: worker process
17060 ?        S      0:00 nginx: worker process
17062 pts/1    S+     0:00 grep --color=auto nginx

7.check if nginx can work well.

open your browser and then type the web address localhost/index.html . It‘s OK if you can see a webpage showing "Welcome to nginx!", or failed otherwise.

时间: 2024-08-08 22:03:29

How to install nginx in Ubuntu的相关文章

[django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04

关键点1:chmod-socket=666 (mysite_uwsgi.ini) 关键点2 : 工程目录和虚拟环境目录搞清楚 几个参考: http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-

[转载]Deploying Python with uWSGI and Nginx on Ubuntu 13.10

http://perlmaven.com/deploying-pyton-with-uwsgi-on-ubuntu-13-10 The following is a tutorial on how to set up uWSGI with an Nginx front end to server simple Python scripts. In this tutorial we will only use the packages that are supplied by Ubuntu. It

使用 Nginx 在 Ubuntu 16.04 上托管 ASP.NET Core

使用 Nginx 在 Ubuntu 16.04 上托管 ASP.NET Core 准备工作 服务器主机:腾讯云主机 Ubuntu 16.04 64位 客户端软件:putty.exe; WinSCP 5.13.2 在 Ubuntu 中安装 ASP.NET Core 微软在 .NET Core指南 提供了在不同操作系统中安装运行 ASP.NET Core 的帮助文档,请选择 linux-prerequisites 部分,并找到和自己服务器所安装操作系统相同的内容进行安装即可. 注册Microsoft

Django + Gunicorn + Nginx 部署 Ubuntu 服务器

Django + Gunicorn + Nginx 部署服务器 获取腾讯云 root权限 本人的服务器使用的是腾讯云,腾讯云默认是没有开放 root 用户的,我们来创建 root 用户. 创建 root 账号并设置密码. sudo passwd root 设置 root 账户登录需要密码. sudo vim /etc/ssh/sshd_config 修改 without-password 为 yes. PermitRootLogin yes 重启 ssh 服务. sudo service ssh

install Nginx iptables

install the dependent package yum install -y pcre pcre-devel yum install -y zlib zlib-devel get nginx package wget http://nginx.org/download/nginx.1.8.1.tar.gz create user id for nginx useradd -M -s /sbin/nologin nginx install nginx tar xvzf nginx.1.

(转) How to install eclipse in ubuntu 12.04

源地址:http://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/ Eclipse installation in ubuntu 12.04 is very simple . you can install eclipse using “software center” but you may not get the latest version, better download the latest version and ins

yum install nginx

先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm 查看: yum info nginx 安装: yum install nginx service nginx start yum install nginx,布

Install Nginx/PHP-FPM on CentOS/RHEL

Install Nginx, PHP 5.5.15 and PHP-FPM on Fedora 20/19/18/17, CentOS 7/6.5/5.10, Red Hat (RHEL) 7/6.5/5.10 1. Change to root user. su 2. Install needed repositories CentOS 7/6.5/5.10 and Red Hat (RHEL) 7/6.5/5.10 Remi repository  ## Remi Dependency on

Install golang on Ubuntu 14.04 LTS

1. Install golang on Ubuntu 14.04 LTS a)~$ sudo apt-get install golang                   success b)~$ sudo add-apt-repository ppa:gophers/go ~$ sudo apt-get update ~$ sudo apt-get install golang-stable         fail c) complie from source code