nginx installation Ensure that the virtual machine can access the Internet: 1. Log in as root user 2. Check nginx installation information: yum info nginx 3. If nginx information cannot be found, execute the following: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm 4. Check the installation information of nginx 5. If there is information, install nginx command: yum install nginx 6. Check http://192.168.1.7. If the nginx page appears, everything is ok. nginx.conf configuration file details user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; log_format liuhao '$remote_addr^A$msec^A$http_host^A$request_uri'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; # include /etc/nginx/conf.d/*.conf; server { listen 80; server_name localhost; #access_log /var/log/nginx/host.access.log main; location ~ .jpg { root /data/www/web; index index.html index.htm; access_log /var/log/nginx/gp1918.log liuhao; } location ~ / { root /usr/share/nginx/html; index index.html index.htm; access_log /var/log/nginx/access.log main; } } } The nginx.conf in /etc/nginx is a custom configuration file that directly configures the above content The default configuration file in nginx/conf.d does not need to be modified After the replacement, restart the NGINX service service nginx restart Open two windows for monitoring tail -f /var/log/nginx/access.log tail -f /var/log/nigx/gp1918.log gp1918.log.log needs to be created by yourself Enter your own ip/test.jpg on the web page Finally, look at the monitoring Another monitoring is when you access the IP Summarize The above is the nginx monitoring problem under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Vue implements scroll loading table
>>: Detailed tutorial on installing mysql under Linux
Table of contents 1. Problem 2. Solution 2.1 Pagi...
Before talking about CSS priority, we need to und...
Table of contents 1. beforeCreate & created 2...
Table of contents 1. Concept 1.1 Definition 1.2 D...
When configuring proxy_pass in nginx, if you matc...
Due to company requirements, two nginx servers in...
Why do we achieve this effect? In fact, this ef...
Many of my friends may encounter a problem and do...
This article uses examples to illustrate the comm...
The main contents of this article are as follows:...
A. Installation of MySQL backup tool xtrabackup 1...
Normal explanation % means any client can connect...
The company's business scenario requires the ...
How long has it been since I updated my column? H...
Table of contents Prototype chain diagram Essenti...