From 7f2b6ebfc0d2e4d2b8c8e6d3208a2cae435d0eeb Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Tue, 8 Apr 2014 11:52:38 -0400 Subject: Enable python-horizon to run from apache. - modify python-horizon to install files needed for horizon/apache - add apache configuration file (openstack-dashboard-apache.conf) to setup a virtual host running from port 80 to run the mod_wsgi/openstack-dashboard app - add horizon-apache and apache2 to controller task list - Note: local_settings.py differs from the one in examples in two ways: 1. LOCAL_PATH = "/usr/share/openstack-dashboard/openstack_dashboard/static" since the apache app runs as daemon, we neeed to specify a path where daemon has write permissions 2. configure python-horizon/apache to use memcached. (see CACHES) Signed-off-by: Amy Fong --- .../recipes-devtools/python/python-horizon_git.bb | 36 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-horizon_git.bb') diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb index c3e167f..153f4d4 100644 --- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb +++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb @@ -27,12 +27,14 @@ DEPENDS_${PN} += "python-django \ python-pbr \ " -PR = "r1" +PR = "r2" SRCNAME = "horizon" SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ file://horizon.init \ file://fix_bindir_path.patch \ + file://openstack-dashboard-apache.conf \ + file://local_settings.py \ " SRCREV="b2259b352fd1e00a269b8275afa8093223598235" @@ -68,9 +70,25 @@ do_install_append() { # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin cp run_tests.sh ${HORIZON_CONF_DIR} + + # the following are setup required for horizon-apache + install -d ${D}/usr/share/openstack-dashboard + cp -a ${S}/openstack_dashboard ${D}/usr/share/openstack-dashboard/ + cp ${S}/manage.py ${D}/usr/share/openstack-dashboard + + install -D -m 644 ${WORKDIR}/local_settings.py \ + ${D}/etc/openstack-dashboard/local_settings.py + ln -fs /etc/openstack-dashboard/local_settings.py \ + ${D}/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py + + install -D -m 644 ${WORKDIR}/openstack-dashboard-apache.conf \ + ${D}/etc/apache2/conf.d/openstack-dashboard-apache.conf + sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#' ${D}/etc/apache2/conf.d/openstack-dashboard-apache.conf + + ln -fs openstack_dashboard/static ${D}/usr/share/openstack-dashboard/static } -PACKAGES += "${SRCNAME}-tests ${SRCNAME}" +PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-apache" FILES_${PN} = "${libdir}/*" @@ -81,6 +99,12 @@ FILES_${SRCNAME} = "${bindir}/* \ ${datadir}/* \ " +FILES_${SRCNAME}-apache = "/etc/apache2 \ + /etc/openstack-dashboard/ \ + /usr/share/openstack-dashboard/ \ + /var/lib/openstack-dashboard \ + " + RDEP_ARCH_VAR = "" RDEP_ARCH_VAR_arm = "nodejs" RDEP_ARCH_VAR_i686 = "nodejs" @@ -113,3 +137,11 @@ RDEPENDS_${SRCNAME} = "${PN}" INITSCRIPT_PACKAGES = "${SRCNAME}" INITSCRIPT_NAME_${SRCNAME} = "horizon" INITSCRIPT_PARAMS_${SRCNAME} = "${OS_DEFAULT_INITSCRIPT_PARAMS}" + +RDEPENDS_${SRCNAME}-apache = "\ + apache2 \ + mod-wsgi \ + python-lesscpy \ + memcached \ + python-memcached \ + " -- cgit v1.2.3-54-g00ecf