I'm using multipass on Mac OS and set up a new VM through the command:
multipass launch -d 10G -m 2G -n server-dev
which builds a clean Ubuntu 20.04 LTS with 10G space and 2G ram for me.
then I proceed to the next steps:
sudo apt update
sudo apt install python3-dev apache2 apache2-dev
wget (URI for mod_wsgi 4.8.0)
tar xvfz 4.8.0.tar.gz
cd mod_wsgi-4.8.0
./configure
export CPATH=/usr/include/python3.8:$CPATH
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
make
the two lines to export path helped me to overcome Python.h missing problem
however, I encounter a new one which I have not yet find a solution:
/usr/share/apr-1.0/build/libtool --mode=link --tag=disable-static x86_64-linux-gnu-gcc -Wl,--as-needed -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -o src/server/
mod_wsgi.la -rpath /usr/lib/apache2/modules -module -avoid-version src/server/wsgi_validate.lo src/server/wsgi_thread.lo src/server/wsgi_stream.lo src/server/wsgi_server.lo src/server/wsgi_restrict.lo src/server/wsgi_metrics.lo src/server/wsgi_memory.lo src/server/wsgi_logger.lo src/server/wsgi_interp.lo src/server/wsgi_daemon.lo src/server/wsgi_convert.lo src/server/wsgi_buckets.lo src/server/wsgi_apache.lo src/server/mod_wsgi.lo -L -L -lpython
libtool: error: require no space between '-L' and '-L'
apxs:Error: Command failed with rc=65536
.
make: *** [Makefile:31: src/server/
mod_wsgi.la] Error 1
It seems like a problem with libtool so I updated libtool with:
sudo apt install libtool-bin
but with no success. Any thought?