In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install nginx. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
0. download
Wget http://nginx.org/download/nginx-1.0.4.tar.gz
two。 Running
/ usr/local/nginx/sbin/nginx # Note: nginx uses port 80 by default. If port 80 is occupied, modify the server {listen 80 in / usr/local/nginx/conf/nginx.conf.
3. test
Echo "test123" > / usr/local/nginx/html/index.html wget http://127.0.0.1
4. Basic command
/ usr/local/nginx/sbin/nginx-h # help / usr/local/nginx/sbin/nginx-v # display version / usr/local/nginx/sbin/nginx-V # display version and configuration information / usr/local/nginx/sbin/nginx-t # test configuration / usr/local/nginx/sbin/nginx-Q # test configuration Only output error message / usr/local/nginx/sbin/nginx-s stop # stop server / usr/local/nginx/sbin/nginx-s reload # reload configuration / usr/local/nginx/sbin/nginx-s quit # I don't know, probably similar to stop / usr/local/nginx/sbin/nginx-s reopen # I don't know It is estimated that it is similar to reload / usr/local/nginx/sbin/nginx-p / nginx/path # defaults to / usr/local/nginx (nginx installation path). After modification, it affects the log directory and html directory / usr/local/nginx/sbin/nginx-c / configure/file/path # configuration file path. The default is conf/nginx.conf, which is useful when there are multiple configuration files. Use this to start multiple different nginx listeners on different ports / usr/local/nginx/sbin/nginx-g # unused # user nobody # nginx startup user, when configuring fastcgi, you need to change to the user with permission to execute fastcgi worker_processes 1; # the number of processes started by nginx, 1 is enough # error_log logs/error.log; # nginx error log relative to / usr/local/nginx/ # error_log logs/error.log notice # nginx record warning log relative to / usr/local/nginx/, can be changed to logs/notice.log # error_log logs/error.log info; # nginx record information log relative to / usr/local/nginx/, can be changed to logs/info.log # pid logs/nginx.pid; # nginx process file, it is best not to change events {worker_connections 1024 # maximum number of nginx connections, preferably less than the maximum number of socket of the system and the number of file openings} http {include mime.types; # see the same directory mime.types, which is used to generate http header default_type application/octet-stream based on the file suffix # log_format main'$remote_addr-$remote_user [$time_local] "$request" #'$status $body_bytes_sent "$http_referer" #'"$http_user_agent"$http_x_forwarded_for"; # access_log logs/access.log main; # access log sendfile on; # tcp_nopush on; # keepalive_timeout 0; keepalive_timeout 65; # connection retention time in seconds # gzip on; server {listen 80 # Port server_name localhost; # server name # charset koi8-r; # default character set # access_log logs/host.access.log main; # generate the corresponding access log location / {root html; # root directory based on the access domain name, relative to the installation directory index index.html index.htm; # default home page} # error_page 404 / 404.html # error page # redirect server error pages to the static page / 50x.html # error_page 500502 503504 / 50x.html; location = / 50x.html {root html;} # proxy the PHP scripts to Apache listening on 127.0.0.1 pass the PHP scripts to FastCGI server listening on 80 # # location ~. Php$ {# proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1 50x.html 9000 # location ~. Php$ {# root html # fastcgi_pass 127.0.0.1 include fastcgi_params; 9000; # forward to port 9000 for processing # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # # location ~ /\ .ht {# deny all #}} # another virtual host using mix of IP-, name-, and port-based configuration # # server {# listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / {# root html; # index index.html index.htm; #} #} # HTTPS server # # server {# listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers all ssl_prefer_server_ciphers on; export 56 root html; # index index.html index.htm; #} #}
5. Configuration
The configuration file is in the installation directory / conf/nginx.conf
Reload with / usr/local/nginx/sbin/nginx-s reload after modification
1. Installation
Install to / usr/local/nginx by default
Tar-zxvf nginx-1.0.4.tar.gz cd nginx-1.0.4. / configure make;make install Thank you for your reading! This is the end of the article on "how to install nginx". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.