I'm trying to install mod_wsgi on Raspbian Stretch Lite (which is based on Debian Stretch).
Following the documentation, I installed apache and mod_wsgi with:
sudo apt -y install apache2 apache2-dev
source ~/venv/bin/activate
pip3.6 install mod_wsgi
Everything looks good so far. To verify that the installation was successful, I ran
mod_wsgi-express start-server
But I got the error
apache2 (mod_wsgi-express): Syntax error on line 159 of /tmp/mod_wsgi-localhost:8000:1000/httpd.conf: Cannot load /home/pi/venv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-arm-linux-gnueabihf.so into server: /home/pi/venv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-arm-linux-gnueabihf.so: undefined symbol: forkpty
So what did I do wrong?
The mod_wsgi documentation has a section on the undefined forkpty error, but it only applies to Fedora and building mod_wsgi from source.
In case it's important, I installed Python 3.6 with:
sudo apt -y install build-essential checkinstall libbz2-dev libc6-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libsqlite3-dev libssl-dev openssl tk-dev zlib1g-dev
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar xzvf Python-3.6.5.tgz
cd Python-3.6.5
./configure
make
sudo make altinstall
cd ..
sudo rm -r Python-3.6.5
rm Python-3.6.5.tgz
python3.6 -m venv ~/venv
source ~/venv/bin/activate
pip3.6 install --upgrade pip
pip3.6 install setuptools wheel