M
M
Maqsat Batyrqul2016-10-26 18:15:48
Perl
Maqsat Batyrqul, 2016-10-26 18:15:48

How to include ngx_http_perl_module?

Good evening!!! I wanted to connect the ngx_http_perl_module module, I tried different instructions, but every time I get some kind of error, can you recommend a good article on installing the module in nginx?
Even in the nginx manual it says

This module is not built by default and must be allowed to be built using the --with-http_perl_module configuration parameter.

I did not understand how to understand this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Jakim, 2021-02-22
@Jakim

It's long enough to explain here, but still.
1) https://nginx.org/ we look at the latest version of nginx 6033b6237f5fb684962257.jpeg
2) in the console we go to some directory cd /home
3) we download and unzip the downloaded nginx

wget http://nginx.org/download/nginx-1.19.7.tar.gz
tar -zxvf nginx-1.19.7.tar.gz && cd nginx-1.19.7

We can look at the configure help and include only what we need in our build ./configure -help |less
# Errors that may occur during the build process.
-------------------------------------------------- ------------------------------
./configure: error: the HTTP rewrite module requires the PCRE library.
apt-get install -y libpcre++-dev
-------------------------------------------------- ------------------------------
./configure: error: SSL modules require the OpenSSL library.
apt-get install -y libssl-dev
4) then we can assemble the necessary modules
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --user=nginx --group=nginx --without-http_autoindex_module --without-http_ssi_module --without-http_scgi_module --without-http_uwsgi_module --without-http_geo_module --without-http_split_clients_module --without-http_memcached_module --without-http_empty_gif_module --without-http_browser_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_mp4_module --with-http_auth_request_module --with-http_stub_status_module --with-http_random_index_module --with-http_gunzip_module --with-threads --with-http_perl_module

You should see something in this format 6033b7b23e5df176893320.jpeg
If errors are pouring in, read on, it's impossible to foresee everything, then any Ubuntu library is missing
5) In step 4, we created a Makefile and indicated the summary configuration, then you can proceed to the installation
make && make install
IMPORTANT!!!
If you already have Nginx installed, remove it by first copying the contents of folders with site configs, certificates and other
sudo apt-get remove nginx*
sudo apt-get purge nginx*

For one of the unknown reasons, set the add. library
sudo apt-get install build-essential libgl1-mesa-dev
sudo apt-get install libgl-dev libglu-dev
sudo apt-get install libperl-dev

After there should be something like this
6033bd82ae91c607703079.jpeg
6) Create the directories necessary for the server to work.
mkdir /var/cache/nginx && mkdir /etc/nginx/conf/ && mkdir /etc/nginx/sites-enabled/ && mkdir /etc/nginx/sites-available/ && mkdir /etc/nginx/common/

7) Let's execute the last commands. Symbolic link to the nginx user, set the shell to /usr/sbin/nologin
useradd -s /usr/sbin/nologin nginx
ln -s /usr/sbin/nginx /bin/nginx

8) Add the nginx.service service to startup and start it.
systemctl enable nginx.service
systemctl start nginx.service

9) FINAL!
check how your Nginx works
systemctl status nginx
nginx -v

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question