Apache child process aborted, can't run Django based server












0















I have a Django site, that I configured with Apache2. The configurations I used are taken from this digital ocean blog.



After doing 0.0.0.0, nothing opens up.



My directory organization looks like this:



home/
rohit/
WORK/
django-site/
infer/ (Main site folder)
temp/ (App)
infer/
inferenv/ (Python Virtual Environment)


Apache's error.log:



[Wed Feb 27 00:24:20.649183 2019] [core:notice] [pid 28903:tid 139772406614976] AH00051: child pid 23307 exit signal Aborted (6), possible coredump in /etc/apache2
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'


I don't understand this error, specifically the reason for child's abortion. The child here seems to be the www-data owned processes, which are <defunct>, as seen under the top command. The parent apache2 process owned by root seems to be working fine. So I can't use gdb, as the child processes are instantaneously halted and the parent process never halts.



Previously, I had my addresses (to the virtual environment and the project folder) all wrong. The errors at the last("encodings" and "Python Fatal Error"), were still present then.



What should I do?





/etc/apache2/sites-available/000-default.conf looks like this:



<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/rohit/WORK/django-site/infer/static
<Directory /home/rohit/WORK/django-site/infer/static>
Require all granted
</Directory>
<Directory /home/rohit/WORK/django-site/infer/infer>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess infer python-path=/home/rohit/WORK/django-site/infer python-home=/home/rohit/WORK/django-site/inferenv
WSGIProcessGroup infer
WSGIScriptAlias / /home/rohit/WORK/django-site/infer/infer/wsgi.py
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


Plus, I followed all the permissions modification commands.



Here is theapache2.conf file :



DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/WORK/django-site/infer/infer>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
AccessFileName .htaccess
<FilesMatch "^.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
ServerName localhost









share|improve this question







New contributor




Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have a Django site, that I configured with Apache2. The configurations I used are taken from this digital ocean blog.



    After doing 0.0.0.0, nothing opens up.



    My directory organization looks like this:



    home/
    rohit/
    WORK/
    django-site/
    infer/ (Main site folder)
    temp/ (App)
    infer/
    inferenv/ (Python Virtual Environment)


    Apache's error.log:



    [Wed Feb 27 00:24:20.649183 2019] [core:notice] [pid 28903:tid 139772406614976] AH00051: child pid 23307 exit signal Aborted (6), possible coredump in /etc/apache2
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
    ModuleNotFoundError: No module named 'encodings'


    I don't understand this error, specifically the reason for child's abortion. The child here seems to be the www-data owned processes, which are <defunct>, as seen under the top command. The parent apache2 process owned by root seems to be working fine. So I can't use gdb, as the child processes are instantaneously halted and the parent process never halts.



    Previously, I had my addresses (to the virtual environment and the project folder) all wrong. The errors at the last("encodings" and "Python Fatal Error"), were still present then.



    What should I do?





    /etc/apache2/sites-available/000-default.conf looks like this:



    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    Alias /static /home/rohit/WORK/django-site/infer/static
    <Directory /home/rohit/WORK/django-site/infer/static>
    Require all granted
    </Directory>
    <Directory /home/rohit/WORK/django-site/infer/infer>
    <Files wsgi.py>
    Require all granted
    </Files>
    </Directory>
    WSGIDaemonProcess infer python-path=/home/rohit/WORK/django-site/infer python-home=/home/rohit/WORK/django-site/inferenv
    WSGIProcessGroup infer
    WSGIScriptAlias / /home/rohit/WORK/django-site/infer/infer/wsgi.py
    </VirtualHost>

    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


    Plus, I followed all the permissions modification commands.



    Here is theapache2.conf file :



    DefaultRuntimeDir ${APACHE_RUN_DIR}
    PidFile ${APACHE_PID_FILE}
    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    HostnameLookups Off
    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    IncludeOptional mods-enabled/*.load
    IncludeOptional mods-enabled/*.conf
    Include ports.conf
    <Directory />
    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
    </Directory>
    <Directory /usr/share>
    AllowOverride None
    Require all granted
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>
    <Directory /home/WORK/django-site/infer/infer>
    <Files wsgi.py>
    Require all granted
    </Files>
    </Directory>
    AccessFileName .htaccess
    <FilesMatch "^.ht">
    Require all denied
    </FilesMatch>
    LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
    LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
    LogFormat "%h %l %u %t "%r" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    IncludeOptional conf-enabled/*.conf
    IncludeOptional sites-enabled/*.conf
    ServerName localhost









    share|improve this question







    New contributor




    Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a Django site, that I configured with Apache2. The configurations I used are taken from this digital ocean blog.



      After doing 0.0.0.0, nothing opens up.



      My directory organization looks like this:



      home/
      rohit/
      WORK/
      django-site/
      infer/ (Main site folder)
      temp/ (App)
      infer/
      inferenv/ (Python Virtual Environment)


      Apache's error.log:



      [Wed Feb 27 00:24:20.649183 2019] [core:notice] [pid 28903:tid 139772406614976] AH00051: child pid 23307 exit signal Aborted (6), possible coredump in /etc/apache2
      Fatal Python error: Py_Initialize: Unable to get the locale encoding
      Fatal Python error: Py_Initialize: Unable to get the locale encoding
      ModuleNotFoundError: No module named 'encodings'


      I don't understand this error, specifically the reason for child's abortion. The child here seems to be the www-data owned processes, which are <defunct>, as seen under the top command. The parent apache2 process owned by root seems to be working fine. So I can't use gdb, as the child processes are instantaneously halted and the parent process never halts.



      Previously, I had my addresses (to the virtual environment and the project folder) all wrong. The errors at the last("encodings" and "Python Fatal Error"), were still present then.



      What should I do?





      /etc/apache2/sites-available/000-default.conf looks like this:



      <VirtualHost *:80>
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      Alias /static /home/rohit/WORK/django-site/infer/static
      <Directory /home/rohit/WORK/django-site/infer/static>
      Require all granted
      </Directory>
      <Directory /home/rohit/WORK/django-site/infer/infer>
      <Files wsgi.py>
      Require all granted
      </Files>
      </Directory>
      WSGIDaemonProcess infer python-path=/home/rohit/WORK/django-site/infer python-home=/home/rohit/WORK/django-site/inferenv
      WSGIProcessGroup infer
      WSGIScriptAlias / /home/rohit/WORK/django-site/infer/infer/wsgi.py
      </VirtualHost>

      # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


      Plus, I followed all the permissions modification commands.



      Here is theapache2.conf file :



      DefaultRuntimeDir ${APACHE_RUN_DIR}
      PidFile ${APACHE_PID_FILE}
      Timeout 300
      KeepAlive On
      MaxKeepAliveRequests 100
      KeepAliveTimeout 5
      User ${APACHE_RUN_USER}
      Group ${APACHE_RUN_GROUP}
      HostnameLookups Off
      ErrorLog ${APACHE_LOG_DIR}/error.log
      LogLevel warn
      IncludeOptional mods-enabled/*.load
      IncludeOptional mods-enabled/*.conf
      Include ports.conf
      <Directory />
      #Options FollowSymLinks
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
      </Directory>
      <Directory /usr/share>
      AllowOverride None
      Require all granted
      </Directory>
      <Directory /var/www/>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
      </Directory>
      <Directory /home/WORK/django-site/infer/infer>
      <Files wsgi.py>
      Require all granted
      </Files>
      </Directory>
      AccessFileName .htaccess
      <FilesMatch "^.ht">
      Require all denied
      </FilesMatch>
      LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
      LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
      LogFormat "%h %l %u %t "%r" %>s %O" common
      LogFormat "%{Referer}i -> %U" referer
      LogFormat "%{User-agent}i" agent
      IncludeOptional conf-enabled/*.conf
      IncludeOptional sites-enabled/*.conf
      ServerName localhost









      share|improve this question







      New contributor




      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a Django site, that I configured with Apache2. The configurations I used are taken from this digital ocean blog.



      After doing 0.0.0.0, nothing opens up.



      My directory organization looks like this:



      home/
      rohit/
      WORK/
      django-site/
      infer/ (Main site folder)
      temp/ (App)
      infer/
      inferenv/ (Python Virtual Environment)


      Apache's error.log:



      [Wed Feb 27 00:24:20.649183 2019] [core:notice] [pid 28903:tid 139772406614976] AH00051: child pid 23307 exit signal Aborted (6), possible coredump in /etc/apache2
      Fatal Python error: Py_Initialize: Unable to get the locale encoding
      Fatal Python error: Py_Initialize: Unable to get the locale encoding
      ModuleNotFoundError: No module named 'encodings'


      I don't understand this error, specifically the reason for child's abortion. The child here seems to be the www-data owned processes, which are <defunct>, as seen under the top command. The parent apache2 process owned by root seems to be working fine. So I can't use gdb, as the child processes are instantaneously halted and the parent process never halts.



      Previously, I had my addresses (to the virtual environment and the project folder) all wrong. The errors at the last("encodings" and "Python Fatal Error"), were still present then.



      What should I do?





      /etc/apache2/sites-available/000-default.conf looks like this:



      <VirtualHost *:80>
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      Alias /static /home/rohit/WORK/django-site/infer/static
      <Directory /home/rohit/WORK/django-site/infer/static>
      Require all granted
      </Directory>
      <Directory /home/rohit/WORK/django-site/infer/infer>
      <Files wsgi.py>
      Require all granted
      </Files>
      </Directory>
      WSGIDaemonProcess infer python-path=/home/rohit/WORK/django-site/infer python-home=/home/rohit/WORK/django-site/inferenv
      WSGIProcessGroup infer
      WSGIScriptAlias / /home/rohit/WORK/django-site/infer/infer/wsgi.py
      </VirtualHost>

      # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


      Plus, I followed all the permissions modification commands.



      Here is theapache2.conf file :



      DefaultRuntimeDir ${APACHE_RUN_DIR}
      PidFile ${APACHE_PID_FILE}
      Timeout 300
      KeepAlive On
      MaxKeepAliveRequests 100
      KeepAliveTimeout 5
      User ${APACHE_RUN_USER}
      Group ${APACHE_RUN_GROUP}
      HostnameLookups Off
      ErrorLog ${APACHE_LOG_DIR}/error.log
      LogLevel warn
      IncludeOptional mods-enabled/*.load
      IncludeOptional mods-enabled/*.conf
      Include ports.conf
      <Directory />
      #Options FollowSymLinks
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
      </Directory>
      <Directory /usr/share>
      AllowOverride None
      Require all granted
      </Directory>
      <Directory /var/www/>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
      </Directory>
      <Directory /home/WORK/django-site/infer/infer>
      <Files wsgi.py>
      Require all granted
      </Files>
      </Directory>
      AccessFileName .htaccess
      <FilesMatch "^.ht">
      Require all denied
      </FilesMatch>
      LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
      LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
      LogFormat "%h %l %u %t "%r" %>s %O" common
      LogFormat "%{Referer}i -> %U" referer
      LogFormat "%{User-agent}i" agent
      IncludeOptional conf-enabled/*.conf
      IncludeOptional sites-enabled/*.conf
      ServerName localhost






      server python apache2 django






      share|improve this question







      New contributor




      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 5 hours ago









      MooncraterMooncrater

      1012




      1012




      New contributor




      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Mooncrater is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Mooncrater is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121482%2fapache-child-process-aborted-cant-run-django-based-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Mooncrater is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Mooncrater is a new contributor. Be nice, and check out our Code of Conduct.













          Mooncrater is a new contributor. Be nice, and check out our Code of Conduct.












          Mooncrater is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121482%2fapache-child-process-aborted-cant-run-django-based-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]