Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx source code compilation and installation

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Installation environment centos6.5

1. Installation must be in the environment

The compilation of nginx requires cantilever, while prce (redirection support) and openssl (https support) also need to be installed.

[root@admin ~] # yum install gcc-c++

[root@admin ~] # yum-y install pcre*

[root@admin ~] # yum-y install openssl*

two。 Download nginx-1.9.9.tar.gz and put it in the / usr/local/ directory

[root@admin ~] # cd / usr/local/

[root@admin local] # wget http://nginx.org/download/nginx-1.9.9.tar.gz

3. Create Nginx user groups and users

Groupadd nginx

Useradd-s / sbin/nologin-M-g nginx nginx

4. Compilation and installation

Cd nginx-1.9.9

. / configure-user=nginx-group=nginx

If you do not have error information, you can perform the following installation:

Makemake install

5. Open the firewall port 80

/ sbin/iptables-I INPUT-p tcp-- dport 80-j ACCEPT # Open port 80

/ etc/rc.d/init.d/iptables save # Save configuration

/ etc/rc.d/init.d/iptables restart # restart the service

6. Start the nginx service

Enter the installation directory / usr/local/nginx

[root@admin ~] # cd / usr/local/nginx

[root@admin sbin] #. / nginx

7. You can visit the ip:80 test, and the prompt on the page indicates that the installation is successful.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report