Hello Tom, everybody,
So I tried all the day, and I still have the same issue in /var/log/apache2/error.log:
[Tue Oct 25 06:08:44.168910 2016] [:error] [pid 45065] /Library/Python/2.7/site-packages/astropy/config/configuration.py:541: ConfigurationMissingWarning: Configuration defaults will be used due to OSError:Could not find unix home directory to search for astropy config dir on None
[Tue Oct 25 06:08:44.169002 2016] [:error] [pid 45065] warn(ConfigurationMissingWarning(msg))Remember I am on a Mac OSX El Capitan 10.11.6
so I did :
$ mkdir -p /var/www/astropyconfig/astropy
$ mkdir -p /var/www/astropycache/astropy
$ chown -R www:www /var/www/astropyconfig
$ chown -R www:www /var/www/astropycache
Not chown -R apache:apache (as written is the doc) because on Mac user apache is not existing. I supposed www is the apache user (because, by default in my httpd.conf file, I have User _www Group _www)
cat /Library/Server/Web/Config/apache2/httpd.conf | grep User# User/Group: The name (or #number) of the user/group to run httpd as.
User _www
cat /Library/Server/Web/Config/apache2/httpd.conf | grep Group# User/Group: The name (or #number) of the user/group to run httpd as.
Group _www
and check on the mac:
sudo ls /var/db/dslocal/nodes/Default/users
_amavisd.plist _devicemgr.plist _krb_kadmin.plist _nsurlstoraged.plist _trustevaluationagent.plist
_appleevents.plist _displaypolicyd.plist _krb_kerberos.plist _ondemand.plist _unknown.plist
_appowner.plist _distnote.plist _krb_krbtgt.plist _postfix.plist _update_sharing.plist
_appserver.plist _dovecot.plist _krbfast.plist _postgres.plist _usbmuxd.plist
_ard.plist _dovenull.plist _krbtgt.plist _qtss.plist _uucp.plist
_assetcache.plist _dpaudio.plist _launchservicesd.plist _sandbox.plist _warmd.plist
_astris.plist _eppc.plist _lda.plist _screensaver.plist _webauthserver.plist
_atsserver.plist _ftp.plist _locationd.plist _scsd.plist _windowserver.plist
_avbdeviced.plist _gamecontrollerd.plist _lp.plist _securityagent.plist _www.plist
_calendar.plist _geod.plist _mailman.plist _serialnumberd.plist _wwwproxy.plist
_ces.plist _iconservices.plist _mbsetupuser.plist _softwareupdate.plist _xserverdocs.plist
_clamav.plist _installassistant.plist _mcxalr.plist _spotlight.plist com.apple.calendarserver.plist
_coreaudiod.plist _installer.plist _mdnsresponder.plist _sshd.plist daemon.plist
_coremediaiod.plist _jabber.plist _mysql.plist _svn.plist macports.plist
_cvmsroot.plist _kadmin_admin.plist _netbios.plist _taskgated.plist nobody.plist
_cvs.plist _kadmin_changepw.plist _netstatistics.plist _teamsserver.plist pipeline.plist
_cyrus.plist _krb_anonymous.plist _networkd.plist _timezone.plist root.plist
_devdocs.plist _krb_changepw.plist _nsurlsessiond.plist _tokend.plist
So maybe it is _www not www user, ok, I did:
I tried with _www user
chown -R _www:_www /var/www/astropyconfig/
chown -R _www:_www /var/www/astropycache/
Still the same issue as above....
Typically, what I am doing is that:
I launch a specific httpd.conf (I checked all my conf files, the configuration is OK)
sudo apachectl -f /Library/Server/Web/Config/apache2/httpd.conf -k restart
so the httpd_wsgi.conf is loaded by mysite.conf with this line: Include /Library/Server/Web/Config/apache2/httpd_wsgi.conf
1)
the httpd_wsgi.conf:
WSGIDaemonProcess web_s1 user=pipeline group=qes threads=5
WSGIPassAuthorization On
WSGIScriptAlias / /Users/pipeline/software/qes2_pipeline/stage1_website/web_s1.wsgi
2)
the web_s1.wsgi:
import sys
sys.path.insert(0, '/Users/pipeline/software/qes2_pipeline/')
from stage1_website.web_s1 import application
3)
the web_s1.pyimport sys
try:
import envars os.environ.update(envvars)
except ImportError:
sys.exit()
import datetime
import os
import glob
from astropy.io import fitsfrom collections import namedtuple
import flaskfrom flask.ext.basicauth import BasicAuth
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.contrib.fixers import ProxyFix
from lib import calibration, db_tools, models
from api_website import web_api
from config import config
import tools
import time
import numpy as np
import matplotlib
from matplotlib import pyplot
DEFAULT_CONFIG = config.DEFAULT_CONFIG
# The sites that the web site will display, these need to be the site column from the sites column.
# The web page will only show information for sites in the database so at the telescopes because
# there will be no data for the other sites in those tables you can leave this variable as it is.
# But it will need to be edited if you decide to hide or add sites where data from multi sites exist
# in the database
SITES = ["KCAM", "NM", "TF", "CN"]
__author__ = 'Neil Parley, Dan Bramich'
app = flask.Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
app.debug = True
app.config['SECRET_KEY'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
app.config['BASIC_AUTH_USERNAME'] = config.web_password.user_name
app.config['BASIC_AUTH_PASSWORD'] = config.web_password.password
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
web_api.API_ROOT = "api/"
web_api.DEFAULT_CONFIG = DEFAULT_CONFIG
application = DispatcherMiddleware(app, {
'/api':
web_api.app})
connection = db_tools.Connection(DEFAULT_CONFIG)
APP_LOCATION = os.path.dirname(os.path.abspath(__file__))
#####################################################################################
#Functions
def get_operation_logs(night):
BLABLABLABLA
####################################################################################
if __name__ == "__main__":
run_simple('localhost', 5000, application,
use_reloader=True, use_debugger=True, use_evalex=True)
4) I set
envars.py as requested in the doc
$ cat envvars.py
envvars = {
'XDG_CONFIG_HOME': '/var/www/astropyconfig',
'XDG_CACHE_HOME': '/var/www/astropycache'
}
Am I correct ? did I do the proper thing to fix the error ?
Please let me know.
Another point, this web site works perfectly on other Mac OSX El Capitan through the world. (In practice 1 site for each observing station).
We just replace the hardware, so maybe I forgot to install something which is required for apache and astropy.
Please let me know, I am deep in the mess and desperate, I do not find any explanations or solutions ...
Thank you so much in advance.
best regards
Nicolas
PS: do not hesitate to ask me complementary infos.