• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Input Bash script to compile Nginx from source with additional modules on Plesk Onyx

@virtubox,

It might be a good idea to post some additional information and, more important, a link to your github pages.

I am pretty sure that would help a bit, since your original post and contribution is drowning in a whole lot of posts in this topic thread.

And many thanks, since this is an excellent contribution, from the start on.

Regards..........

Hello @trialotto,

You are right, it's a good idea to add a link to the github repository in my releases posts, especially for members who may find this post in "New Posts" section.
 
@virtubox,

I might also suggest that you put this "topic" in the contributions section of the forum, in order to have your new releases where they actually belong.

Nevertheless, I am not sure how that works ......not sure what happens if you have to notify about a new release: no experience with that.

Regards!
 
I am not saying it's bad or, harmful but I didn't really like the idea of replacing the default NGINX stuffs provided by Plesk. Thus I choose to compile the modules dynamically instead and it's working fine for me.

I would really like to see Plesk to offer latest stable NGINX Version and Popular NGINX Modules by default very soon.

Thanks.
 
I am not saying it's bad or, harmful but I didn't really like the idea of replacing the default NGINX stuffs provided by Plesk. Thus I choose to compile the modules dynamically instead and it's working fine for me.

I would really like to see Plesk to offer latest stable NGINX Version and Popular NGINX Modules by default very soon.

Thanks.

Hello @Tonmoy Ajize,

I understand totally your point of view, and compiling modules dynamically is one of the features I'm going to add on the roadmap.
 
i got some Errors with the actual Script:
Code:
Welcome to the plesk-nginx bash script.


Do you want to compile the latest Nginx Mainline [1] or Stable [2] Release ?
Select an option [1-2]: 2

Do you want Ngx_Pagespeed ?
Select an option [y/n]: y

Do you want NAXSI WAF (still experimental)?
Select an option [y/n]: n

Do you want RTMP streaming module ?
Select an option [y/n]: n

       Installing dependencies                [OK]
       Downloading additionals modules        [OK]
       Downloading brotli                     [OK]
       Downloading openssl                    [OK]
       Downloading pagespeed                  [OK]
/dev/fd/63: line 445: cd: /usr/local/src/nginx/: No such file or directory
root@wp01:~#

I got this Error on every Server.
 
i got some Errors with the actual Script:
Code:
Welcome to the plesk-nginx bash script.


Do you want to compile the latest Nginx Mainline [1] or Stable [2] Release ?
Select an option [1-2]: 2

Do you want Ngx_Pagespeed ?
Select an option [y/n]: y

Do you want NAXSI WAF (still experimental)?
Select an option [y/n]: n

Do you want RTMP streaming module ?
Select an option [y/n]: n

       Installing dependencies                [OK]
       Downloading additionals modules        [OK]
       Downloading brotli                     [OK]
       Downloading openssl                    [OK]
       Downloading pagespeed                  [OK]
/dev/fd/63: line 445: cd: /usr/local/src/nginx/: No such file or directory
root@wp01:~#

I got this Error on every Server.

Hello,

issue has been fixed, thanks for your report.
 
To make the development process easier, Plesk-Nginx is now unified with Nginx-ee.

Here the changelog since the last release :
  • nginx updated to 1.15.3
  • Openssl update to 1.1.1
  • TLS v1.3 support
  • Compilation now performed with gcc7 or gcc8.1
  • Added Nginx VTS (Virtual host traffic) module, configuration instructions available in the Wiki
  • added non-interactive install
 
With Mainlinerelease and Ubuntu 18:


Code:
2018-10-30 14:46:20 (138 MB/s) - ‘nginx__dynamic_tls_records.patch’ saved [8325/8325]

patching file src/event/ngx_event_openssl.c
Hunk #1 succeeded at 1267 (offset 136 lines).
Hunk #2 succeeded at 2116 (offset 446 lines).
Hunk #3 succeeded at 2258 (offset 452 lines).
patching file src/event/ngx_event_openssl.h
Hunk #1 succeeded at 64 (offset 10 lines).
Hunk #2 FAILED at 89.
Hunk #3 succeeded at 116 (offset 18 lines).
1 out of 3 hunks FAILED -- saving rejects to file src/event/ngx_event_openssl.h.rej
patching file src/http/modules/ngx_http_ssl_module.c
Hunk #1 succeeded at 246 with fuzz 1 (offset 13 lines).
Hunk #2 succeeded at 611 (offset 43 lines).
Hunk #3 succeeded at 683 (offset 45 lines).
Hunk #4 succeeded at 881 with fuzz 1 (offset 49 lines).
patching file src/http/modules/ngx_http_ssl_module.h
Hunk #1 succeeded at 58 (offset 1 line).
 
Hi Script runs successfull but at the end i couldn start the service because of a module. Here is the error from log.

nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_passenger_module.so" version 1013008 instead of 1015006

could i update the module manual or running the script with different option?
my webservices down so would be awesome to get short help?

I try to run the script again in meanwhile with different option
 
try to compile the module and copy it to the needed location with:
root@server:~/nginx-1.15.6/objs# cp ngx_http_passenger_module.so /usr/share/nginx/modules/ -v
'ngx_http_passenger_module.so' -> '/usr/share/nginx/modules/ngx_http_passenger_module.so'

now the error changed to

nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_passenger_module.so" is not binary compatible in /etc/nginx/modules.conf.d/phusion-passenger.conf:1

please help
 
try to compile the module and copy it to the needed location with:
root@server:~/nginx-1.15.6/objs# cp ngx_http_passenger_module.so /usr/share/nginx/modules/ -v
'ngx_http_passenger_module.so' -> '/usr/share/nginx/modules/ngx_http_passenger_module.so'

now the error changed to

nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_passenger_module.so" is not binary compatible in /etc/nginx/modules.conf.d/phusion-passenger.conf:1

please help

Hello,
Do you use Nginx passenger module to run applications on your server ?
If not you can safely comment the content of /etc/nginx/modules.conf.d/phusion-passenger.conf.

But if you need passenger module you have to download the module and to override the list of third-party modules compiled by nginx-ee. To do so you have just to use the following command (after adding the line about passenger inside). If you need more informations about passenger setup, here the officiel documentation : Installing Passenger as a normal or dynamic Nginx module - Passenger Library

Code:
export OVERRIDE_NGINX_ADDITIONAL_MODULES="--add-module=/usr/local/src/echo-nginx-module \
    --add-module=/usr/local/src/headers-more-nginx-module \
    --add-module=/usr/local/src/ngx_cache_purge \
    --add-module=/usr/local/src/ngx_brotli \
    --add-module=/usr/local/src/ngx_http_substitutions_filter_module \
    --add-module=/usr/local/src/srcache-nginx-module \
    --add-module=/usr/local/src/ngx_http_redis \
    --add-module=/usr/local/src/redis2-nginx-module \
    --add-module=/usr/local/src/memc-nginx-module \
    --add-module=/usr/local/src/ngx_devel_kit \
    --add-module=/usr/local/src/set-misc-nginx-module \
    --add-module=/usr/local/src/ngx_http_auth_pam_module \
    --add-module=/usr/local/src/nginx-module-vts \
    --add-module=/usr/local/src/ipscrubtmp/ipscrub"

bash <(wget -qO - https://raw.githubusercontent.com/VirtuBox/nginx-ee/master/nginx-build.sh)
 
no actually i was asking myself the same and thougth it came from the script. i dont know what iit is for actually.
the reason why i use the script was rtmp streaming service on one of my machines.
i uncomment the configs with the passengers areas.
i uncomment the whole http area in my config. then it works before it told me ip:80 in use. now service is starting but my websites now offline.
i thought i use apache for it. know im confused totally.
 
no actually i was asking myself the same and thougth it came from the script. i dont know what iit is for actually.
the reason why i use the script was rtmp streaming service on one of my machines.
i uncomment the configs with the passengers areas.
i uncomment the whole http area in my config. then it works before it told me ip:80 in use. now service is starting but my websites now offline.
i thought i use apache for it. know im confused totally.

In this case just make sure the line "load_module nginx/modules/ngx_http_passenger_module.so;" is commented with a "#" at the beginning.
Make sure Nginx is stopped, enable the systemd service and try to start it.

Code:
service nginx stop

systemctl enable nginx.service

service nginx start
 
Question, will this script still be required as pagespeed was added with the last Plesk update
and TSL1.3 support will be added with 17.9
 
Question, will this script still be required as pagespeed was added with the last Plesk update
and TSL1.3 support will be added with 17.9
It's up to you. As far as I remember here was implemented other additional modules which don't exists in Plesk official nginx build. Brotli, for example.
 
Hi I used this script 3 days ago on my Ubuntu 18.04 install.

All was working nicely until this moring when i did a

Plesk installer update.

This basically downgraded to plesk defaul nginx.

So i tried to re-run the script once more, but it first fail on openssl. So i removed this folder.
Then re-run the script once more and now its stuck on applying nginx patch [FAIL]

Checking logs I see

Code:
2019-06-25 14:52:16 (6.04 MB/s) - ‘nginx-1.17.1.tar.gz’ saved [1033452/1033452]

--2019-06-25 14:52:16--  https://raw.githubusercontent.com/cujanovic/nginx-dynamic-tls-records-patch/master/nginx__dynamic_tls_records_1.13.0%2B.patch
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.12.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8325 (8.1K) [text/plain]
Saving to: ‘nginx__dynamic_tls_records.patch’

     0K ........                                              100% 33.7M=0s

2019-06-25 14:52:16 (33.7 MB/s) - ‘nginx__dynamic_tls_records.patch’ saved [8325/8325]

patching file src/event/ngx_event_openssl.c
Hunk #1 succeeded at 1507 (offset 376 lines).
Hunk #2 succeeded at 2360 (offset 690 lines).
Hunk #3 succeeded at 2502 (offset 696 lines).
patching file src/event/ngx_event_openssl.h
Hunk #1 succeeded at 64 (offset 10 lines).
Hunk #2 FAILED at 89.
Hunk #3 succeeded at 117 (offset 19 lines).
1 out of 3 hunks FAILED -- saving rejects to file src/event/ngx_event_openssl.h.rej
patching file src/http/modules/ngx_http_ssl_module.c
Hunk #1 succeeded at 249 with fuzz 1 (offset 16 lines).
Hunk #2 succeeded at 615 (offset 47 lines).
Hunk #3 succeeded at 687 (offset 49 lines).
Hunk #4 succeeded at 911 with fuzz 1 (offset 79 lines).
patching file src/http/modules/ngx_http_ssl_module.h
Hunk #1 succeeded at 61 (offset 4 lines).


What can i do to fix this?
 
He updated it already, and it workes fine.

For adjustment of nginx.conf would this generator help a bit or is there any upto date pleskv version?

nginxconfig.io
 
Back
Top