-- Prepare the Environment 1. ensure that the GCC compiler is installed in the operating system. You must also install the Autoconf and Automake tools. Yum-yinstallgccgcc-c ++ autoconfautomake2. module dependency: some Nginx modules require the support of other third-party libraries. for example, the gzip module requires the zlib library and the rewrite module requires the pcre library, the ssl function requires an openssl library. Yum-yins
-- Prepare the environment 1. ensure that the operating system is installed with the GCC compiler. You must also install the Autoconf and Automake tools.
Yum-y install gcc-c ++ autoconf automake
2. module dependency: some Nginx modules require support from other third-party libraries. for example, the gzip module requires the zlib library, the rewrite module requires the pcre library, and the ssl function requires the openssl library.
Yum-y install zlib-devel openssl-devel pcre-devel
3. download an rpm package on the nginx official website, which is: http://nginx.org/en/download.html or wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Install this rpm Package
Rpm-ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
The following error occurs during installation:
Warning: nginx-release-centos-6-0.el6.ngx.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
If you don't know what to do, just ignore it.
A large amount of information will be displayed, asking if you are OK or not: Is this OK [y/N]:
Enter y. after the screen is rolled for a while, the installation is Complete. the prompt "Complete!" is displayed !" The installation is complete.
2. several default nginx directories
Whereis nginx
Nginx:/usr/sbin/nginx/etc/nginx/usr/share/nginx
------------------ Configure ----------------
1. modify the default access port
In the "/etc/nginx/conf. d/default. conf" file, find "listen 80", change 80 to the desired port, and save and restart the port.
2. modify the default access path
In the "/etc/nginx/conf. d/default. conf" file, find the root/root under location/{} and change it to the desired path.
For example: location /{
Root/home/images;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service