Upgrading nginx on Centos 6.8 - nginx

I'm trying to update Nginx on Centos 6.8. I tried
sudo vi /etc/yum.repos.d/nginx.repo
and then changing the nginx.repo to
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
and then ran:
sudo yum update && sudo yum install nginx
But when I check the version with nginx -v, it's still version 1.9.2.
I also tried quitting and reloading, but neither did anything.
Also tried:
cd /opt
wget http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.10.1-1.el6.ngx.x86_64.rpm
yum update nginx-1.10.1-1.el6.ngx.x86_64.rpm
Could someone point me in the right direction?

Download the latest epel-release rpm from http://dl.fedoraproject.org/pub/epel/6/x86_64/
Install epel-release rpm:
# rpm -Uvh epel-release*rpm
Install nginx rpm package:
# yum --enablerepo=epel-testing install nginx

Related

How to install Swoole in ubuntu

Simply my Question is How to Install Swoole in Ubuntu 14.04 LTS
I have tried
sudo pecl install swoole
am getting handfull of errors, already posted here
Is there any alternate way to install the same...
Swoole Installation alternate ways
1.Install from source
sudo apt-get install php7-dev
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
make && make install
2.Example for static compile
git clone -b PHP-7.2 --depth 1 https://github.com/php/php-src.git
cd php-src/
git clone -b master --depth 1 https://github.com/swoole/swoole-src.git ext/swoole
./buildconf --force
./configure --prefix=/usr/local/php7 --disable-all --enable-cli --disable-cgi --disable-fpm --disable-phpdbg --enable-bcmath --enable-hash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-sockets --enable-pdo --with-sodium --with-password-argon2 --with-sqlite3 --with-pdo-sqlite --with-pcre-regex --with-zlib --with-openssl-dir --enable-swoole-static --enable-openssl --with-swoole
time make -j `cat /proc/cpuinfo | grep processor | wc -l`
sudo make install
Some Linux distributions do not include the PHP-XML extension in their PHP package and will need to be enabled before using PECL. You can install using apt-get install php-xml and you may need to install PHPize to compile Swoole, you can install it using apt-get install php7.*-dev or whatever PHP version you are using.
Then try again with sudo pecl install swoole
For those who installed PHP from ondrej/php PPA (quite common way to install PHP in Ubuntu) it's quite easy now:
sudo apt install php-swoole
Or for specific version:
sudo apt install php7.4-swoole
Tip. This is how you usually install ondrej/php PPA:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install swoole for version specific should work for example if you have php 7.3 use
sudo apt install php7.3-swoole
replace the version to your local php env

How to upgrade openresty with or without downtime

All,
I have few servers that have openresty installed and the version running on it is nginx version: openresty/1.9.7.2
How can i upgrade it to 1.11.5.2.
I have seen the documentation but things are not getting clear. Can someone please provide the detailed steps of the same.
This is a pretty late reply, but I just performed an upgrade from OpenResty 1.13.6.2 to 1.15.8.2. I'm running OpenResty in AWS/EC2 on Ubuntu 16.04.6 LTS. I just followed the Ubuntu guide to install at OpenResty
I did this on a backup instance to make sure everything worked, then applied the upgrade to my Live instance. All of my configs were intact and unchanged.
# install some prerequisites needed by adding GPG public keys (could be removed later)
sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates
# import our GPG key:
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
# for installing the add-apt-repository
sudo apt-get -y install --no-install-recommends software-properties-common
# add the our official APT repository:
sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
# to update the APT index:
sudo apt-get update
# Then you can install openresty:
sudo apt-get -y install openresty
# check the new version:
openresty -v
# restart openresty
sudo service openresty restart

How to install PHP 7.1 on EC2 running on Amazon Linux AMI 2018.03 having nginx as web server?

How to install PHP 7.1 on Amazon EC2 t2.micro Instance running Amazon Linux AMI 2018.03 having nginx as web server?
Reference to PHP7
With reference to this answer, change Step 1 to the following:
1. Install Apache 2.4 and PHP 7.1 on Amazon Linux AMI
# Remove current apache & php
sudo yum remove httpd* php*
# Install Apache 2.4
sudo yum install httpd24
# Install PHP 7.1
sudo yum install php71
# Install additional commonly used php packages
sudo yum install php71-gd
sudo yum install php71-imap
sudo yum install php71-mbstring
sudo yum install php71-mysqlnd
sudo yum install php71-opcache
sudo yum install php71-pdo
sudo yum install php71-pecl-apcu
Basically replacing php70 with php71.
Continue with step 2 and the rest as per the original tutorial.
I followed below steps to install PHP7.1 which had already Nginx as web server for Amazon Linux AMI 2018.03
#Remove Old PHP
yum remove php*
#Update Reposistory
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
#Update Amazon AMI
yum upgrade -y
#Install PHP
#List of PHP packages https://webtatic.com/packages/php71/
yum install php71w php71w-cli php71w-fpm
yum install php71w-mysql php71w-xml php71w-curl
yum install php71w-opcache php71w-pdo php71w-gd
yum install php71w-pecl-apcu php71w-mbstring php71w-imap
yum install php71w-pecl-redis php71w-mcrypt
#change listen mode to CGI
sed -i 's/127.0.0.1:9000/\/tmp\/php5-fpm.sock/g' /etc/php-fpm.d/www.conf
/etc/init.d/php-fpm restart
touch /tmp/php5-fpm.sock
chmod 777 /tmp/php5-fpm.sock
service nginx restart
The reason I am still using /tmp/php5-fpm.sock file so that I do not need to change PHP7 sock file in all website nginx conf and assuming server do not have PHP5 as as on first step it has been removed.
A reliable way to achieve the same output is by following commands on Amazon Linux AMI 2.
# Remove current php & apache
sudo service httpd stop
sudo yum remove httpd* php*
sudo yum install httpd
amazon-linux-extras install php7.1

Nginx update on ubuntu fails

I am not nginx expert and having problems in configuring it.
Examples I found on web are slightly different so I wanted to update nginx 1.05 to 1.4.1 to see if it helps.
I have found instructions to install nginx from PPA as
apt-get install python-software-properties
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
It seems as is it has installed but nginx -v is still telling me I have 1.0.5
What I missed?
Using ubuntu 11.10
Thanks
NGINX maintains is own apt repository which means you don't need to use the PPA.
Firstly remove the added ppa:
sudo add-apt-repository --remove ppa:nginx/stable
Then, if you're not running anything critical through nginx I would suggest running apt-get remove --purge nginx to completely remove nginx.
To use NGINX's repository add the following to `/etc/apt/sources.list.d/nginx.list':
deb http://nginx.org/packages/ubuntu/ oneiric nginx
deb-src http://nginx.org/packages/ubuntu/ oneiric nginx
Then run apt-get update. Then reinstall using apt-get install nginx.
Hope that works.

Cannot install RStudio on CentOS 6.4

I am trying to install RStudio on Centos 6.4 with an already installed R version.
I got the following error:
error: Failed dependencies:
libcrypto.so.6()(64bit) is needed by rstudio-server-0.97.336-x86_64
libgfortran.so.1()(64bit) is needed by rstudio-server-0.97.336-x86_64
libssl.so.6()(64bit) is needed by rstudio-server-0.97.336-x86_64
Any hint will be highly appreciated.
I fixed this error following this link:
http://jermdemo.blogspot.com.es/2011/08/installing-rstudio-server-on-scientific.html
You have to install some dependencies:
yum install libcrypto.so.6 -y
yum install libgfortran.so.1 -y
yum install libssl.so.6 -y
yum install openssl098e-0.9.8e -y
yum install gcc41-libgfortran-4.1.2 -y
yum install pango-1.28.1 -y
and the tricky one:
wget ftp.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/compat-
libgfortran-41-4.1.2-39.el6.x86_64.rpm
rpm -Uvh compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm
and install Rstudio with no-deps flag:
rpm -Uvh --nodeps rstudio-server-0.97.336-x86_64.rpm
rstudio-server verify-installation

Resources