Showing posts with label Nginx Webserver. Show all posts
Showing posts with label Nginx Webserver. Show all posts

Monday, 8 October 2018

Renew letsencrypt certificate in nginx on Centos

To renew your letsencrypt certificate,

please follow the following steps

First you need to stop the nginx service on centos using the following command

[root@manivel]# service nginx stop
Stopping nginx:                                            [  OK  ]

[root@manivel]#Go to the letsencrypt folder and run the following commands to renew the certificate,


[root@manivel letsencrypt]# ./certbot-auto renew

./certbot-auto renewSaving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/manivel.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator standalone, Installer None
Renewing an existing certificate
Performing the following challenges:
tls-sni-01 challenge for nginx.manivel.com
tls-sni-01 challenge for mail.manivel.com
Waiting for verification...Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/manivel.com/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/manivel.com/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[root@manivel letsencrypt]# 


Start the nginx service using the following command


[root@manivel letsencrypt]# service nginx start 
Startting nginx:                                            [  OK  ]

[root@manivel letsencrypt]#
Now you have successfully renewed your letsencrypt ssl certificate.

Wednesday, 27 June 2018

Nginx warning - A client request body is buffered to a temporary file /var/cache/nginx/client_temp/


Today I saw a unknown warning error on the Nginx server that it happens when i was trying to upload a file to a website, checking the logs I found this error "A client request body is buffered to a temporary file "

This is my log file:
2018/06/27 12:27:38 [warn] 20230#20230: *743 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000007, client: 10.177.6.42, server: 10.177.6.45, request: "POST /creation/upload/component/9656/video/ HTTP/1.1", host: "10.177.6.45", referrer: "http://10.177.6.45/creation/upload/component/9656/video/"

 

Solution :

 

While investigating this, I found that the size of the uploaded file is larger than memory buffer set for my file uploads.

After that I changed the "client_body_buffer_size" variable value in Nginx configuration file

[root@server ]# vim /etc/nginx/conf.d/default.conf

client_body_buffer_size 100M;

Then restart the nginx service

[root@server ]# service nginx restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]

[root@server]#


My issue is resolved.

Sunday, 20 May 2018

bind(): No such file or directory [core/socket.c line 230]

I configured uwsgi with nginx and got the following error


 


Solution :


Later i found socket parameter of uwsgi doesn't exists. So, I have created the following folder as per the uwsgi configuration.



[root@localhost]# mkdir /var/run/uwsgi


After i restart the uwsgi and it is working fine.


(venv)[root@localhost ]# uwsgi --ini uwsgi.ini





Thursday, 21 November 2013

How to install nginx on Centos 6


Here i am going to install the Nginx using nginx official repository

To create nginx repo,

[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

:wq



To install nginx using yum,
 
[root@localhost ~]# yum install nginx



To start the nginx service,


[root@localhost ~]# /etc/init.d/nginx start

Starting nginx:                                            [  OK  ]
[root@localhost ~]#

To verfiy the version,

[root@locahost ~]# nginx -v

To list the nginx files location,

[root@localhost ~]# rpm -ql nginx

/etc/logrotate.d/nginx
/etc/nginx
/etc/nginx/conf.d
/etc/nginx/conf.d/default.conf
/etc/nginx/conf.d/ssl.conf
/etc/nginx/conf.d/virtual.conf
/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi.conf.default
/etc/nginx/fastcgi_params
/etc/nginx/fastcgi_params.default
/etc/nginx/koi-utf
/etc/nginx/koi-win
/etc/nginx/mime.types
/etc/nginx/mime.types.default
/etc/nginx/nginx.conf
/etc/nginx/nginx.conf.default
/etc/nginx/scgi_params
/etc/nginx/scgi_params.default
/etc/nginx/uwsgi_params
/etc/nginx/uwsgi_params.default
/etc/nginx/win-utf
/etc/rc.d/init.d/nginx
/etc/sysconfig/nginx
/usr/lib64/perl5/vendor_perl/auto/nginx
/usr/lib64/perl5/vendor_perl/auto/nginx/nginx.so
/usr/lib64/perl5/vendor_perl/nginx.pm
/usr/sbin/nginx
/usr/share/doc/nginx-1.0.15
/usr/share/doc/nginx-1.0.15/CHANGES
/usr/share/doc/nginx-1.0.15/LICENSE
/usr/share/doc/nginx-1.0.15/README
/usr/share/man/man3/nginx.3pm.gz
/usr/share/man/man8/nginx.8.gz
/usr/share/nginx
/usr/share/nginx/html
/usr/share/nginx/html/404.html
/usr/share/nginx/html/50x.html
/usr/share/nginx/html/index.html
/usr/share/nginx/html/nginx-logo.png
/usr/share/nginx/html/poweredby.png
/var/lib/nginx
/var/lib/nginx/tmp
/var/log/nginx
[root@localhost ~]#

Now you can able to access the nginx default page. Go to the web browser and type your machine ip address or localhost. In my case ip address 10.118.248.52


It's working...