Install the high performance Nginx web server on Ubuntu
来源:互联网 发布:数据圈付费社区 编辑:程序博客网 时间:2024/05/21 09:27
Look out Apache, there’s a web server – Nginx (pronounced Engine X) – that means to dismantle you as the defacto standard web server. The Nginx project started development in 2002, but it’s just now really showing its strength and starting to gain a serious following. Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server, and it’s known for high performance, stability, a vast feature set, easy configuration, and very low resource consumption.
Since Nginx is new to many users, I thought I should begin a series of articles to get everyone up to speed on using this fantastic web server. Throughout this series, I’ll be using the Ubuntu platform. You can use this series as the basis for other platforms – just pay close attention to the variances of installation technology and (in some cases) directory structure. With that said, let’s install Nginx on the Ubuntu platform.
Note: As this series won’t bother with basic platform setup and security, I’ll assume that you already have the server up and running and secure to your liking. I’ll also assume that you have MySQL up and running (along with PHP support).
Requirements
Nginx has few dependencies that Ubuntu doesn’t already take care of. Here’s what you’ll need:
- The Gzip modules requires the zlib library
- The rewrite module requires the pcre library
- SSL support requires the openssl library
With the Ubuntu platform, the only library from the list above that you’ll need to install is the pcre library. To install this, follow these steps:
1.Open a terminal window
2.Issue the command:
sudo apt-get install libpcre3-dev
3.Type your sudo password and hit Enter
4.Accept the installation
5.Allow the installation to complete
Nginx can use PHP5 with the help of PHP-FPM (an alternative PHP FastCGI implementation with additional features, which is useful to busier sites). Here’s how to install PHP-FPM:
1.Open a terminal window
2.Issue the command:
sudo apt-get install php5-fpm
3.Type your sudo password (if prompted) and hit Enter
4.Accept the installation
5.Allow the installation to complete
Installing Nginx
As you might expect, the installation of Nginx is quite simple. Just follow these steps:
1.Open a terminal window
2.Issue the command:
sudo apt-get install nginx
3.Type your sudo password (if prompted) and hit Enter
4.Accept the installation
5.Allow the installation to complete
That’s it. The new web server is installed. Now, let’s peek around a bit.
Starting and stopping the server
To start the Nginx server, issue the following command:
sudo service nginx start
Top stop the Nginx server, issue the following command:
sudo service nginx stop
With the Nginx service started, fire up your browser and point it to the IP address (or domain) of the hosting server. If you see the “Welcome to Nginx” page, everything is good to go.
Before you close that terminal window, it’s necessary to set the Nginx service to start at boot. Just issue the following command:
update-rc.d nginx defaults
If you see:
System start/stop links for /etc/init.d/nginx already exist
That means Nginx is already set to start at boot time. You can now rest assured that you won’t have to manually start your web server upon reboot.
Configuration files/folders
- The main configuration file for Nginx is /etc/nginx/nginx.conf
- Virtual hosts are defined in /etc/nginx/sites-available/default
- PHP will be configured in /etc/php5/fpm/php.ini
That should do it for Nginx installation on the Ubuntu platform. In upcoming posts, we’ll start working through various configurations and optimizations to round out the series. Enjoy your new web server!
reference:http://www.techrepublic.com/blog/linux-and-open-source/install-the-high-performance-nginx-web-server-on-ubuntu/
- Install the high performance Nginx web server on Ubuntu
- install web server on the linux
- install Apache web server on Ubuntu!
- install nginx on ubuntu
- Build High performance Server
- High-Performance Server Architecture
- high-performance server architecture
- High-Performance Server Architecture
- High-Performance Server Architecture
- High-Performance server architecture
- High-Performance Server Architecture
- High performance Web Sites
- Install Samba Server on Ubuntu
- FastCGI: A High-Performance Web Server Interface 中文翻译版本
- Note On <High Performance JavaScript>
- Note On <High Performance JavaScript>
- Note On <High Performance JavaScript>
- Install The PostgreSQL on the Ubuntu Server hosted by the Digital Ocean
- 黑马程序员_Java基础泛型
- HDU ACM 1077 Catching Fish
- 表达式求值
- 黑马程序员_Java_异常机制及常见异常总结
- HDU 3535 AreYouBusy
- Install the high performance Nginx web server on Ubuntu
- unity内部float类型转换string类型只保留整数部分
- 数学中国体力值
- Python笔记——01模块安装方法
- java加密解密工具类
- PHP知识积累
- bzoj 2631: tree
- spring中的default-autowire="byName"
- Qt5中文乱码