How-To install nginx_mainline with CustomBuild 2

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
Install nginx_mainline

Run this code to get a script to install nginx_mainline:


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NEW WAY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Code:
cd /usr/local/directadmin/custombuild/
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/nginx/build_nginx -O /usr/local/directadmin/custombuild/build_nginx
chmod 755 ./build_nginx
./build_nginx

With this you will get a script build_nginx installed - with the script you can check/download/install a mainline version of NGINX.

Code:
./build_nginx versions && ./build_nginx install
Custombuild2 script can be still used to install NGINX version, but you will need to run

Code:
./build_nginx versions && ./build_nginx download
or

Code:
./build_nginx cron first

  • The latest version number of NGINX mainline is taken from NGINX repositories. So no need to adjust version manually.
  • No MD5 checksum is done in the script. It's up to custombuild to check md5-sum of a file with nginx sources.


That's it! You can stop here. And you do not need to follow old way if you installed the script using the new way.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OLD WAY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Code:
cd /usr/local/directadmin/custombuild/
touch ./build_nginx1
chmod 755 ./build_nginx1
vi ./build_nginx1
Press "Insert" and paste the following code into the created file:

Code:
#!/bin/bash
NGINX_VER=1.15.1
cd /usr/local/directadmin/custombuild
cat custom_versions.txt | grep -Ev "^nginx:|^$" > custom_versions.txt.new
mv -f custom_versions.txt.new custom_versions.txt
echo "nginx:${NGINX_VER}:" >> custom_versions.txt
wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz -O nginx-${NGINX_VER}.tar.gz
./build update
./build nginx
Press "Escape" then ":x" and "Enter" to save and exit.

To get nginx mainline installed:

Code:
cd /usr/local/directadmin/custombuild
./build_nginx1


Later when a new version will be released just update the script with its number, ie. line:

Code:
NGINX_VER=1.11.4


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CUSTOMIZING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



If you need to configure nginx with your own set of options/modules run this code:

Stand-alone NGINX:

Code:
cd /usr/local/directadmin/custombuild/
mkdir -p custom/nginx/
cp configure/nginx/configure.nginx custom/nginx/configure.nginx
Update custom/nginx/configure.nginx with your instructions.
Re-install nginx


Nginx in front of Apache:

Code:
cd /usr/local/directadmin/custombuild/
mkdir -p custom/nginx_reverse/
cp configure/nginx_reverse/configure.nginx custom/nginx_reverse/configure.nginx
Update custom/nginx_reverse/configure.nginx with your instructions.
Re-install nginx
 
Last edited:

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
436
Location
Arnhem, NL
+1, thanks. I used the manual method a couple of days ago when 1.9.11 was released but when the next version comes out i will try this. :)
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
The nginx-1.10.0 stable version has been released, incorporating new features from the 1.9.x mainline branch - including the stream module, HTTP/2, dynamic modules support and more.

As soon as it will be added into CustomBuild there will be no more need to use custom version of nginx-mainline solely for utilizing HTTP/2.
 

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
436
Location
Arnhem, NL
What kind of update do you want? :) http/2 is available in the stable branch (1.10.0) that is currently available in CustomBuild.
 

NocRoom

Verified User
Joined
Jul 19, 2015
Messages
48
What kind of update do you want? :) http/2 is available in the stable branch (1.10.0) that is currently available in CustomBuild.


seems like as if this scripts whats to download the file doesnt exist from wget url, i have the file downloaded from directadmin download folder no need to pull the file again

i think some edits are needed and updated
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
So you mean that the script should check if the required file exists in the folder and download it if it's missing. If so, then it can be easily done. Just please confirm that I get you right.
 

NocRoom

Verified User
Joined
Jul 19, 2015
Messages
48
correct, even tho i have already downloaded the file is still trying to download it from nginx but really should be checking in file.directadmin or check if is there first then do install but with this script doesnt and fails
 

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
436
Location
Arnhem, NL
Not all mainline versions are added to CustomBuild. 1.11.(1-2-3) don't exist on files1 etc. 1.11.4 does. So indeed maybe a check would be nice if the file already exists.
 

NocRoom

Verified User
Joined
Jul 19, 2015
Messages
48
Not all mainline versions are added to CustomBuild. 1.11.(1-2-3) don't exist on files1 etc. 1.11.4 does. So indeed maybe a check would be nice if the file already exists.

so back to question 1 :) how can 1.11.4 be installed ?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
A New way to install NGINX mainline was added:

Code:
cd /usr/local/directadmin/custombuild/
wget -O build_nginx2 https://raw.githubusercontent.com/poralix/directadmin-utils/master/nginx/build_nginx2
chmod 755 ./build_nginx2
./build_nginx2
IMPORTANT:


  • A version number of NGINX mainline is taken from versions.txt of Directadmin. So no need to adjust version manually.
  • No MD5 checksum is done in the script. It's up to custombuild to check md5-sum of a file with nginx sources.

 

NocRoom

Verified User
Joined
Jul 19, 2015
Messages
48
A New way to install NGINX mainline was added:

Code:
cd /usr/local/directadmin/custombuild/
wget -O build_nginx2 https://raw.githubusercontent.com/poralix/directadmin-utils/master/nginx/build_nginx2
chmod 755 ./build_nginx2
./build_nginx2
IMPORTANT:


  • A version number of NGINX mainline is taken from versions.txt of Directadmin. So no need to adjust version manually.
  • No MD5 checksum is done in the script. It's up to custombuild to check md5-sum of a file with nginx sources.

anyway have an option http2 when install ?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
Do you mean that a script should do everything that is required so that you would get NGINX with HTTP/2 in the end? I.e. without a need to modify any file manually? If so, yes, it's possible, we use some already ;) Will it be wanted by others?
 

NocRoom

Verified User
Joined
Jul 19, 2015
Messages
48
Do you mean that a script should do everything that is required so that you would get NGINX with HTTP/2 in the end? I.e. without a need to modify any file manually? If so, yes, it's possible, we use some already ;) Will it be wanted by others?
Yes, I'm sure is others by the amount of threads for http2 :)
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,075
Location
GMT +7.00
For those who gets wrong version number:

Code:
[root@server custombuild]# ./build_nginx versions
Latest mainline version of Nginx: </html>
Installed version of Nginx: 1.15.0
[root@server custombuild]#


i.e. </html> instead of a version number, here is an updated version of the script:

Code:
cd /usr/local/directadmin/custombuild/
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/nginx/build_nginx -O /usr/local/directadmin/custombuild/build_nginx
chmod 755 ./build_nginx
./build_nginx
./build_nginx versions
 
Top