LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-30-2021, 12:47 PM   #1
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,993

Rep: Reputation: 193Reputation: 193
[SOLVED] No libapache2-mod-scgi in Debian 11 Bullseye


If you run into this problem and need libapache2-mod-scgi which is not in Debian 11 Bullseye. Then you can get it from Debian 10 by using apt download libapache2-mod-scgi on system running Buster or get it from the Debian archives on the web. A simple dpkg -i libapache2-mod-scgi_1.13-1.1_arm64.deb will install it fine and enables it in the Apache configuration. The arm64 package being the arch needed for my Pi 4 it worked on my AMD 64 system too during the testing of the procedure. If you do upgrade from Buster you are in for shock, as you see it still work, if needing to do fresh install. As those files do survive the upgrade process as nothing has a conflict to remove them, it is only on fresh install you notice it does not work anymore as they are not there to install.
 
Old 08-30-2021, 04:14 PM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,684

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351

The question to be asked in this situation is why was it removed?

To find the answer start at the Buster package page and follow the "Developer Information" to the removal alerts, within which you'll find reference to this bug report: https://bugs.debian.org/cgi-bin/bugr...cgi?bug=948756

In summary: it seems the Debian SCGI package was Python2-only and unmaintained since 2014.

The latest Python 3 version of SCGI is available from PyPi so you should probably be installing that instead?

 
Old 08-30-2021, 06:36 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,993

Original Poster
Rep: Reputation: 193Reputation: 193
Quote:
Originally Posted by boughtonp View Post
The question to be asked in this situation is why was it removed?

To find the answer start at the Buster package page and follow the "Developer Information" to the removal alerts, within which you'll find reference to this bug report: https://bugs.debian.org/cgi-bin/bugr...cgi?bug=948756

In summary: it seems the Debian SCGI package was Python2-only and unmaintained since 2014.

The latest Python 3 version of SCGI is available from PyPi so you should probably be installing that instead?

Who knows it will be the next time I get the ambition to do a fresh install and get to check if it still will work with that way of doing it. So much for a packaging system to install software now relying on third party who knows what is in them to do it methods.
 
Old 08-30-2021, 09:30 PM   #4
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,993

Original Poster
Rep: Reputation: 193Reputation: 193
Well I remembered my test system I had tried this on and curiosity getting the better of me had to try it. It works as intended once you get it installed and loaded properly luckily I had the other system to copy the loading file from or it would have taken me ages to figure it out..

The whole procedure for anyone wanting to give it a go from my notes on the main machine.



New method for mod_scgi download the code for the module, compile and activate it.
Came after getting the idea from my post telling of the download previous in a reply to it
linking to the website. https://github.com/nascheme/scgi
Code:
root@bullseye-raspi:~# cat /etc/apache2/mods-available/scgi.load
LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
The file installed from the Debian Buster package for the loading above.
The old package installed from Buster listed.

Code:
root@bullseye-raspi:~/scgi# dpkg -L libapache2-mod-scgi
/.
/etc
/etc/apache2
/etc/apache2/mods-available
/etc/apache2/mods-available/scgi.load
/usr
/usr/lib
/usr/lib/apache2
/usr/lib/apache2/modules
/usr/lib/apache2/modules/mod_scgi.so
/usr/share
/usr/share/doc
/usr/share/doc/libapache2-mod-scgi
/usr/share/doc/libapache2-mod-scgi/changelog.Debian.gz
/usr/share/doc/libapache2-mod-scgi/README.txt
/usr/share/doc/libapache2-mod-scgi/changelog.gz
/usr/share/doc/libapache2-mod-scgi/copyright
root@bullseye-raspi:~/scgi# ll /usr/lib/apache2/modules/mod_scgi.so
-rw-r--r-- 1 root root 18240 Sep  3  2014 /usr/lib/apache2/modules/mod_scgi.so
Remove it.

Code:
root@bullseye-raspi:~/scgi# dpkg -r libapache2-mod-scgi
(Reading database ... 31138 files and directories currently installed.)
Removing libapache2-mod-scgi (1.13-1.1) ...
Module scgi disabled.
apache2_invoke prerm: Disable module scgi
apache2_reload: Your configuration is broken. Not restarting Apache 2
apache2_reload: AH00526: Syntax error on line 48 of /etc/apache2/sites-enabled/000-default.conf:
apache2_reload: Invalid command 'SCGIMount', perhaps misspelled or defined by a module not included in the server configuration
root@bullseye-raspi:~/scgi# ll /usr/lib/apache2/modules/mod_scgi.so
ls: cannot access '/usr/lib/apache2/modules/mod_scgi.so': No such file or directory
Make directory to work in and copy the file needed to compile with Apache module builder.
The source came from. https://github.com/nascheme/scgi/tree/master/apache2 a simple copy and
paste of it from the mod_scgi.c listed there

Code:
root@bullseye-raspi:~# mkdir scgi
root@bullseye-raspi:~# cd scgi/
root@bullseye-raspi:~/scgi# nano mod_scgi.c
To get the -dev files to compile the module with Apache.

Code:
root@bullseye-raspi:~/scgi# agi apache2-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autopoint autotools-dev binutils binutils-aarch64-linux-gnu binutils-common
  bsdextrautils build-essential cpp cpp-10 debhelper dh-autoreconf dh-strip-nondeterminism
  dpkg-dev dwz fakeroot g++ g++-10 gcc gcc-10 gettext gettext-base groff-base intltool-debian
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapr1-dev
  libaprutil1-dev libarchive-cpio-perl libarchive-zip-perl libasan6 libatomic1 libbinutils
  libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0
  libdebhelper-perl libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl
  libfile-stripnondeterminism-perl libgcc-10-dev libgd3 libisl23 libitm1 libldap2-dev liblsan0
  libltdl-dev libmail-sendmail-perl libmpc3 libmpfr6 libnsl-dev libpipeline1 libsctp-dev libsctp1
  libsigsegv2 libstdc++-10-dev libsub-override-perl libsys-hostname-long-perl libtirpc-dev libtool
  libtsan0 libubsan1 libuchardet0 libxpm4 linux-libc-dev m4 make man-db manpages manpages-dev
  po-debconf uuid-dev
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc binutils-doc cpp-doc gcc-10-locales dh-make
  debian-keyring gcc-10-doc gcc-multilib flex bison gdb gcc-doc gettext-doc libasprintf-dev
  libgettextpo-dev groff glibc-doc bzr libgd-tools libtool-doc lksctp-tools libstdc++-10-doc
  gfortran | fortran95-compiler gcj-jdk m4-doc make-doc www-browser libmail-box-perl
The following NEW packages will be installed:
  apache2-dev autoconf automake autopoint autotools-dev binutils binutils-aarch64-linux-gnu
  binutils-common bsdextrautils build-essential cpp cpp-10 debhelper dh-autoreconf
  dh-strip-nondeterminism dpkg-dev dwz fakeroot g++ g++-10 gcc gcc-10 gettext gettext-base
  groff-base intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libapr1-dev libaprutil1-dev libarchive-cpio-perl libarchive-zip-perl
  libasan6 libatomic1 libbinutils libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev
  libctf-nobfd0 libctf0 libdebhelper-perl libdpkg-perl libexpat1-dev libfakeroot
  libfile-fcntllock-perl libfile-stripnondeterminism-perl libgcc-10-dev libgd3 libisl23 libitm1
  libldap2-dev liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libmpfr6 libnsl-dev libpipeline1
  libsctp-dev libsctp1 libsigsegv2 libstdc++-10-dev libsub-override-perl libsys-hostname-long-perl
  libtirpc-dev libtool libtsan0 libubsan1 libuchardet0 libxpm4 linux-libc-dev m4 make man-db
  manpages manpages-dev po-debconf uuid-dev
0 upgraded, 81 newly installed, 0 to remove and 0 not upgraded.
Need to get 69.9 MB of archives.
After this operation, 257 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main arm64 bsdextrautils arm64 2.36.1-8 [142 kB]
Get:2 http://deb.debian.org/debian bullseye/main arm64 libuchardet0 arm64 0.0.7-1 [67.9 kB]
Get:3 http://deb.debian.org/debian bullseye/main arm64 groff-base arm64 1.22.4-6 [883 kB]
...
Setting up apache2-dev (2.4.48-3.1+deb11u1) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for libc-bin (2.31-13) ...
Now build the module.

Code:
root@bullseye-raspi:~/scgi# apxs -i -c mod_scgi.c
/usr/share/apr-1.0/build/libtool  --mode=compile --tag=disable-static aarch64-linux-gnu-gcc -prefer-pic -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -Wdate-time -D_FORTIFY_SOURCE=2   -DLINUX -D_REENTRANT -D_GNU_SOURCE  -pthread  -I/usr/include/apache2  -I/usr/include/apr-1.0   -I/usr/include/apr-1.0 -I/usr/include  -c -o mod_scgi.lo mod_scgi.c && touch mod_scgi.slo
libtool: compile:  aarch64-linux-gnu-gcc -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -c mod_scgi.c  -fPIC -DPIC -o .libs/mod_scgi.o
/usr/share/apr-1.0/build/libtool  --mode=link --tag=disable-static aarch64-linux-gnu-gcc -Wl,--as-needed -Wl,-z,relro -Wl,-z,now    -o mod_scgi.la  -rpath /usr/lib/apache2/modules -module -avoid-version    mod_scgi.lo
libtool: link: aarch64-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/mod_scgi.o    -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,mod_scgi.so -o .libs/mod_scgi.so
libtool: link: ( cd ".libs" && rm -f "mod_scgi.la" && ln -s "../mod_scgi.la" "mod_scgi.la" )
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_scgi.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install install mod_scgi.la /usr/lib/apache2/modules/
libtool: install: install .libs/mod_scgi.so /usr/lib/apache2/modules/mod_scgi.so
libtool: install: install .libs/mod_scgi.lai /usr/lib/apache2/modules/mod_scgi.la
libtool: finish: PATH="/root/bin:/sbin:/home/seeder1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin" ldconfig -n /usr/lib/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/apache2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 644 /usr/lib/apache2/modules/mod_scgi.so
The new module was installed.

Code:
root@bullseye-raspi:~/scgi# ll /usr/lib/apache2/modules/mod_scgi.so
-rw-r--r-- 1 root root 84496 Aug 30 22:53 /usr/lib/apache2/modules/mod_scgi.so
To enable create the scgi.load file.

Code:
root@bullseye-raspi:~# nano /etc/apache2/mods-available/scgi.load
root@bullseye-raspi:~# cat /etc/apache2/mods-available/scgi.load
LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
root@bullseye-raspi:~/scgi# a2enmod scgi
Enabling module scgi.
To activate the new configuration, you need to run:
  systemctl restart apache2
root@bullseye-raspi:~/scgi# systemctl restart apache2
The old was uninstalled.

Code:
root@bullseye-raspi:~/scgi# apt-cache policy libapache2-mod-scgi
libapache2-mod-scgi:
  Installed: (none)
  Candidate: (none)
  Version table:
     1.13-1.1 -1
        100 /var/lib/dpkg/status
It works now to see if it survives a reboot and it did. Oh and the pip install scgi is useless for the Apache web server.
 
Old 08-31-2021, 06:48 AM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,684

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by HappyTux View Post
Who knows it will be the next time I get the ambition to do a fresh install and get to check if it still will work with that way of doing it. So much for a packaging system to install software now relying on third party who knows what is in them to do it methods.
I'm not sure what this is saying.

SCGI was in the Debian repos whilst it had a maintainer - five years after its maintainer stopped updating the version in the Debian repos, someone suggested it was removed. The ex-maintainer agreed, so it was removed from the next major version (v11/Bullseys), whilst remaining in v10/Buster which is still supported for another 3 years.

I'm not really sure what the benefit of SCGI is supposed to be - the website which currently redirects to GitHub (despite being mentioned in the opening paragraph of the GitHub readme) claimed "it is similar to FastCGI but is designed to be easier to implement" - except the FastCGI spec doesn't appear that complicated, and is widely implemented, so I don't see the benefit of SCGI.

Certainly in terms of not being removed, FastCGI would seem to be the better option, so perhaps you should look at migrating across.



Quote:
Oh and the pip install scgi is useless for the Apache web server.
Perhaps I should have been clearer - providing the link to PyPi was not me suggesting a pip install.

The download on PyPi includes the code for mod_scgi - it is a more stable source for the released code than the GitHub repo which lacks explicit tags/releases.

 
Old 08-31-2021, 12:28 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,993

Original Poster
Rep: Reputation: 193Reputation: 193
Quote:
Originally Posted by boughtonp View Post
I'm not sure what this is saying.
The code is checked in the Debian archive, the packages are signed with a gpg key for security and it fits in the system so it knows it is there without the users jumping through hoops to get it working. Unlike any of that in the github then add in the recent breaches where malicious code was introduced into other similar online repositories it makes it a iffy proposition to download with them tools from those type of sites. In the end I took the chance and went with the three month old code and not the near seven year old variety I had.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to locate package libapache2-mod-jk adumith Linux - Server 2 09-05-2014 10:48 AM
LXer: Debian: 2778-1: libapache2-mod-fcgid: heap-based buffer overflow LXer Syndicated Linux News 0 10-15-2013 06:51 AM
[SOLVED] RTorrent SCGI / XML-RPC PelliX Linux - Server 1 02-19-2010 03:21 PM
Multiple SCGI Servers with Lighttpd devinw Linux - Server 1 07-18-2009 12:40 PM
RTorrent SCGI / XML-RPC -- blank responses german Linux - Software 2 08-12-2008 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration