Having trouble getting papermerge to run in apache2
See original GitHub issueHi, thanks for taking the time to look into this issue.
I am trying to get apache running following the guide at: https://papermerge.readthedocs.io/en/latest/setup/server_configurations.html
I am receiving a 500 error when attempting to browse to the web interface. I receive the following errors in apache error.log.
Any ideas on what I could be doing wrong?
Thanks 😃
[Tue Dec 01 03:12:03.128646 2020] [mpm_event:notice] [pid 52070:tid 139872824998976] AH00489: Apache/2.4.41 (Ubuntu) mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations [Tue Dec 01 03:12:03.128904 2020] [core:notice] [pid 52070:tid 139872824998976] AH00094: Command line: '/usr/sbin/apache2' [Tue Dec 01 03:12:07.840581 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] mod_wsgi (pid=52071): Failed to exec Python script file '/var/www/papermerge/config/wsgi.py'. [Tue Dec 01 03:12:07.845902 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] mod_wsgi (pid=52071): Exception occurred processing WSGI script '/var/www/papermerge/config/wsgi.py'. [Tue Dec 01 03:12:07.861047 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] Traceback (most recent call last): [Tue Dec 01 03:12:07.861138 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] File "/var/www/papermerge/config/wsgi.py", line 3, in <module> [Tue Dec 01 03:12:07.861163 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] from django.core.wsgi import get_wsgi_application [Tue Dec 01 03:12:07.861238 2020] [wsgi:error] [pid 52071:tid 139872689960704] [client 192.168.1.8:22265] ModuleNotFoundError: No module named 'django'
Issue Analytics
- State:
- Created 3 years ago
- Comments:18
Ubuntu is based on Debian so that should normally work. The steps are an installation from scratch. Some path’s can differ with your installation. I have installed Papermerge in /opt/papermerge. The apache user is www-data and the Papermerge configuration file is in /etc/ Papermerge is running as a virtualhost in apache on port 8060
Install GIT
apt install git -y
Clone
git clone --branch v1.5.0 https://github.com/ciur/papermerge.git /opt/papermerge
install SUDO
apt install sudo -y
install dependencies
Prepare python virtual environment
Activate it
source .venv/bin/activate
Install dependencies
pip3 install -r requirements/base.txt
./manage.py migrate
./manage.py createsuperuser
Copy example configuration file to /etc
cp /opt/papermerge/papermerge.conf.py.example /etc/papermerge.conf.py
Permissions for Apache
chown www-data:www-data /etc/papermerge.conf.py
chmod 770 /etc/papermerge.conf.py
Create static
cd /opt/papermerge
source .venv/bin/activate
./manage.py collectstatic
Install APACHE
apt install apache2 -y
Install WSGI module
apt install libapache2-mod-wsgi-py3 -y
Create virtualhost for apache
vi /etc/apache2/sites-available/papermerge.conf
Create link to activate virtualhost
sudo ln -s /etc/apache2/sites-available/papermerge.conf /etc/apache2/sites-enabled/
Add listening port 8060 to apache
vi /etc/apache2/ports.conf
Add 1 line below Listen 80
Listen 8060
Restart apache
systemctl restart apache2
Test
I was facing the very same issue, after i entered my login credentials i ran into that “attempt to write a readonly database”. The fix for me was to create a copy of the papermerge.conf.py into my servers /etc/ folder. for a unknown reason the file in the projectfolder was ignored. now its running and using my mysql server: finally. @doughnet: thanks for sharing your way through it, when reading what you did i noticed that i didn’t place my config there! GL everyone