title: Apache server "ImportError: No module named site"
body: <p>I am trying to run Apache server using squashfs based rootfs. When I try to connect to the server, I see the following in the /var/log/apache2_error_logs</p>
  
  <pre><code>cat /var/log/apache2_error_log
  [Mon Apr 29 18:40:28.705047 2013] [mpm_worker:notice] [pid 0:tid 1073880416] AH00292: Apache/2.4.3 (Unix) mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal operations
  [Mon Apr 29 18:40:28.706298 2013] [core:notice] [pid 2235447778748764:tid 1073880416] AH00094: Command line: '/usr/local/apache2/bin/httpd'
  ImportError: No module named site
  ImportError: No module named site
  ImportError: No module named site
  The above log keeps incrementing. 
  </code></pre>
  
  <p>I also see that httpd is up, however  Ialso see defunct proceses which I don't understand.</p>
  
  <pre><code>ps -aef | grep httpd
  root      8085     1  0 18:40 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
  daemon    8086  8085  0 18:40 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
  daemon    9563  8085  3 18:43 ?        00:00:00 [httpd] &lt;defunct&gt;
  daemon    9564  8085  3 18:43 ?        00:00:00 [httpd] &lt;defunct&gt;
  manu      9573   448  0 18:43 ttyO2    00:00:00 grep httpd
  </code></pre>
  
  <p>Some of the important configuration settings in the httpd.conf are </p>
  
  <pre><code>ServerRoot "/usr/local/apache2"
  
  Listen 80
  
  LoadModule reqtimeout_module modules/mod_reqtimeout.so
  LoadModule filter_module modules/mod_filter.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule env_module modules/mod_env.so
  LoadModule headers_module modules/mod_headers.so
  LoadModule setenvif_module modules/mod_setenvif.so
  LoadModule version_module modules/mod_version.so
  LoadModule unixd_module modules/mod_unixd.so
  LoadModule status_module modules/mod_status.so
  LoadModule autoindex_module modules/mod_autoindex.so
  LoadModule cgid_module modules/mod_cgid.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule wsgi_module modules/mod_wsgi.so
  
  &lt;Directory /platform/www/html/&gt;
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  &lt;/Directory&gt;
  
  ServerName FX750072AFAE:80
  &lt;Directory /&gt;
      AllowOverride none
      Require all denied
  &lt;/Directory&gt;
  
  ErrorLog "/var/log/apache2_error_log"
  ScriptSock /var/run/cgisock
  &lt;Directory "/platform/www/cgi-bin/"&gt;
                  AddHandler cgi-script .cgi .pl .py
                  Options +ExecCGI
                  AllowOverride AuthConfig FileInfo
                  Order allow,deny
                  Allow from all
                  Require all granted
  &lt;/Directory&gt;
  
  &lt;Directory "/platform/www/wsgi-bin/"&gt;
          AddHandler wsgi-script .wsgi .pl .py
          Options +ExecCGI
          AllowOverride AuthConfig FileInfo
          Order allow,deny
          Allow from all
          Require all granted
  &lt;/Directory&gt;
  Alias /control "/platform/www/wsgi-bin/rm.wsgi"
  Alias /Control "/platform/www/wsgi-bin/rm.wsgi"
  PidFile /var/run/httpd.pid
  
  The same configuration with JFFS2 based root file system works fine. 
  
  Also before I launch the apache service, 
  
  export PYTHONHOME=/
  sudo /usr/local/apache2/bin/restart.sh
  
  where restart.sh has the following contents
  /usr/local/apache2/bin/apachectl  stop
  rm -rf /var/run/httpd.pid
  /usr/local/apache2/bin/apachectl  start
  </code></pre>