title: apache2 error log. Call to 'site.addsitedir()' failed for '(null)', stopping
body: <p>I would like to connect Python and Apache 2 server in Ubuntu.</p>
  
  <p>So aws have to enter the following code ubuntu server.</p>
  
  <pre><code>pip install Django
  
  sudo apt-get install appache2
  
  sudo apt-get install libapache2-mod-wsgi-py3
  </code></pre>
  
  <p>Then I created the Python project and the app folder as Python venv.</p>
  
  <p>The code for Apache 2 000-default.conf looks like this:</p>
  
  <pre><code>&lt;virtualhost *:80&gt;
  WSGIDaemonProcess bot python-path=/home/ubuntu/Django/bot:/home/ubuntu/Django/myvenv/lib/python3.5/site-packages
  ServerAdmin webmaster@localhost
  WSGIScriptAlias /52.78.108.223 /home/ubuntu/Django/bot/wsgi.py
  &lt;Directory /home/ubuntu/Django/bot&gt;
  &lt;Files wsgi.py&gt;
          Require all granted
  &lt;/Files&gt;
  &lt;/Directory&gt;
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/virtualhost&gt; 
  </code></pre>
  
  <p>The location is correct. There is no typing miss.</p>
  
  <p>The first argument to 'WSGIScriptAlias ​​/' should be blank, but if you put it in a blank space, you will not see the 'it walked' page when you hit that IP. So I put the external IP of the server. Then it walked well.</p>
  
  <p>Looking at the Apache 2 error log.</p>
  
  <p>[Wed May 02 21:32:28.100569 2018] [wsgi:warn] [pid 22648:tid 140282945054592] mod_wsgi: Compiled for Python/3.5.1+.</p>
  
  <p>[Wed May 02 21:32:28.100633 2018] [wsgi:warn] [pid 22648:tid 140282945054592] mod_wsgi: Runtime using Python/3.5.2.</p>
  
  <p>[Wed May 02 21:32:28.101406 2018] [mpm_event:notice] [pid 22648:tid 140282945054592] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations</p>
  
  <p>[Wed May 02 21:32:28.101426 2018] [core:notice] [pid 22648:tid 140282945054592] AH00094: Command line: '/usr/sbin/apache2'</p>
  
  <p>[Wed May 02 21:32:28.191175 2018] [wsgi:error] [pid 22651:tid 140282945054592] mod_wsgi (pid=22651): Call to 'site.addsitedir()' failed for '(null)', stopping.</p>
  
  <p>[Wed May 02 21:32:28.192041 2018] [wsgi:error] [pid 22651:tid 140282945054592] mod_wsgi (pid=22651): Call to 'site.addsitedir()' failed for '/home/ubuntu/Django/myvenv/lib/python3.5/site-packages'.</p>
  
  <p>[Wed May 02 21:33:21.733277 2018] [mpm_event:notice] [pid 22648:tid 140282945054592] AH00494: SIGHUP received. Attempting to restart</p>
  
  <p>[Wed May 02 21:33:21.787095 2018] [wsgi:warn] [pid 22648:tid 140282945054592] mod_wsgi: Compiled for Python/3.5.1+.</p>
  
  <p>[Wed May 02 21:33:21.787410 2018] [wsgi:warn] [pid 22648:tid 140282945054592] mod_wsgi: Runtime using Python/3.5.2.</p>
  
  <p>[Wed May 02 21:33:21.788397 2018] [mpm_event:notice] [pid 22648:tid 140282945054592] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations</p>
  
  <p>[Wed May 02 21:33:21.788447 2018] [core:notice] [pid 22648:tid 140282945054592] AH00094: Command line: '/usr/sbin/apache2'</p>
  
  <p>[Wed May 02 21:33:21.860854 2018] [wsgi:error] [pid 22781:tid 140282945054592] mod_wsgi (pid=22781): Call to 'site.addsitedir()' failed for '(null)', stopping.</p>
  
  <p>[Wed May 02 21:33:21.860889 2018] [wsgi:error] [pid 22781:tid 140282945054592] mod_wsgi (pid=22781): Call to 'site.addsitedir()' failed for '/home/ubuntu/Django/myvenv/lib/python3.5/site-packages'.</p>
  
  <p>It comes out like this.</p>
  
  <p>I searched the internet. It is said that wsgi version is low.</p>
  
  <p>However, wsgi used by apache2 can only be installed with 'sudo apt-get install libapache2-mod-wsgi-py3'.</p>
  
  <p>The Apache 2 error log shows that wsgi version is 4.3.0.</p>
  
  <p>If you install the latest version of wsgi with 'pip install mod-wsgi', the Apache 2 error log will show 4.3.0.</p>
  
  <p>'Call to' site.addsitedir () 'failed for' (null) ', stopping.' The error log still appears.</p>
  
  <p>How do I resolve this error?</p>