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
Preface The three-column layout, as the name sugg...
<br />I'm basically going crazy with thi...
introduction It is okay to add or not add a semic...
HTML is a hybrid language used for publishing on ...
Sometimes we build a file server through nginx, w...
<br />For each of our topics, the team will ...
character Decimal Character Number Entity Name --...
mysql create table sql statement Common SQL state...
The current environment is: Centos 7.5 docker-ce ...
Download the official website Choose the version ...
Preface This article mainly introduces how to sta...
Table of contents What is JSON Why this technolog...
Preface Recently connected to mysql /usr/local/my...
This article shares the specific code of JavaScri...
This article shares the specific code of JavaScri...