Editing
Upgrading major versions of Nginx,Mysql
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Upgrading Version of Nginx ------------------------------ Login to Server (on which need to update Nginx version) β’ Cd /home/neal/root/ Download the nginx source β’ wget http://nginx.org/download/nginx-1.18.0.tar.gz Unzip the downloaded file β’ tar xzvf filename β’ Nginx βV Copy the configuration modules in text Open the server with latest SSL version (demo.apoyar) β’ Nginx βV Copy the last configuration command with SSL and paste it in text document at last Download the open SSL source β’ Go to cd /usr/local/src/ β’ wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz β’ tar xzvf filename β’ go to cd root/ β’ go to nginx folder Paste here that configuration module which we have in text document and hit enter NOTE: - If getting any errors, troubleshoot with the below steps as per errors coming across. If the ./configure gives you any errors, take the following steps: apt-get install uuid-dev If ./configure gives you an error about psol not found apt-get install libgd-dev in case of this error: ./configure: error: the HTTP image filter module requires the GD library. apt-get install libgeoip-dev in case of: ./configure: error: the GeoIP module requires the GeoIP library. install libssl-dev in case of: ./configure: error: SSL modules require the OpenSSL library. install libpcre++-dev in case of: ./configure: error: the HTTP rewrite module requires the PCRE library. apt-get install libxslt1-dev in case of: ./configure: error: the HTTP XSLT module requires the libxml2/libxslt apt-get install zlib1g-dev ./configure: error: the HTTP gzip module requires the zlib library apt-get install libpam0g-dev in case of: make gives you an error: fatal error: security/pam_appl.h: No such file or directory Then run below command β’ make Uninstall OLD Nginx β’ Cd etc/ β’ tar czvf nginx β’ mv nginx /root/ β’ dpkg -l | grep nginx β’ apt-get purge nginx After removing old nginx reboot the server Installing NEW Nginx β’ Cd /root/nginx 1.18.0 β’ make install β’ Go to cd etc/ β’ unzip the older zipped nginx folder here β’ Nginx βV If the nginx command doesn't work, create a symlink: β’ ln -s /usr/share/nginx/sbin/nginx /usr/sbin/Ln β’ Nginx βV Go to Cd /nginx/sites-enabled Check syntax and potential errors: β’ sudo nginx βt # Will throw this error nginx: [emerg] mkdir() "/var/lib/nginx/body" failed (2: No such file or directory) # Just create directory β’ mkdir -p /var/lib/nginx && sudo nginx βt Create systemd unit file for NGINX: β’ sudo vim /etc/systemd/system/nginx.service Copy/paste the following content: NOTE: The location of the PID file and the NGINX binary may be different depending on how NGINX was compiled. [Unit] Description=A high performance web server and a reverse proxy server After=network.target [Service] Type=forking PIDFile=/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;' ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;' ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid TimeoutStopSec=5 KillMode=mixed [Install] WantedBy=multi-user.target Start and enable NGINX service: β’ sudo systemctl start nginx.service && sudo systemctl enable nginx.service Create UFW NGINX application profile: β’ sudo vim /etc/ufw/applications.d/nginx Copy/paste the following content: [Nginx HTTP] title=Web Server (Nginx, HTTP) description=Small, but very powerful and efficient web server ports=80/tcp [Nginx HTTPS] title=Web Server (Nginx, HTTPS) description=Small, but very powerful and efficient web server ports=443/tcp [Nginx Full] title=Web Server (Nginx, HTTP + HTTPS) description=Small, but very powerful and efficient web server ports=80,443/tcp Now, verify that UFW app profiles are created and recognized: β’ sudo ufw app list # Available applications: # Nginx Full # Nginx HTTP # Nginx HTTPS # OpenSSH
Summary:
Please note that all contributions to Apoyar Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Apoyar Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Apoyar Infrastructure
Active Directory
Recent changes
Random page
Upload file
Tools
What links here
Related changes
Special pages
Page information