sh 烧瓶安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 烧瓶安装相关的知识,希望对你有一定的参考价值。
#!/bin/bash
export GIT_WORK_TREE=/mnt/websites/sites/AdminPanelRNB/WEBSITES/5marias.com.ar #Carpeta publica donde se copian los archivos
export GIT_DIR=/mnt/websites/sites/AdminPanelRNB/REPOS/5marias.com.ar.git #Carpeta del repositorio git
echo "-------------------------------------------------------------------------->"
echo "--------------------- Actualizando Rama MASTER --------------------------->"
echo "-------------------------------------------------------------------------->"
git --work-tree=$GIT_WORK_TREE --git-dir=$GIT_DIR checkout -f
echo "-------------------------------------------------------------------------->"
echo "---------------------- Actualizar PIP ------------------------------------>"
echo "-------------------------------------------------------------------------->"
cd $GIT_WORK_TREE
source _env/bin/activate
pip install -r req.txt
pip freeze | grep -v -f req.txt - | xargs pip uninstall -y
echo "-------------------------------------------------------------------------->"
echo "--------------------- Actualizar Permisos -------------------------------->"
echo "-------------------------------------------------------------------------->"
cd $GIT_WORK_TREE
chown www-data:www-data -R $GIT_WORK_TREE
echo '---------------> Reiniciar apache ---------------------------------------->'
service apache2 reload
#while read oldrev newrev ref
#do
# # only checking out the master (or whatever branch you would like to deploy)
# if [[ $ref =~ .*/master$ ]];
# then
#
# else
# echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
# fi
#done
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName panel.site
ServerAlias panel.site www.panel.site
ErrorLog /var/log/apache2/panel-error.log
CustomLog /var/log/apache2/panel-access.log combined
WSGIDaemonProcess panelweb user=www-data group=www-data threads=5
WSGIProcessGroup panelweb
WSGIScriptAlias / /var/www/html/PANEL_WEB/app_apache.wsgi
Alias /static/ /var/www/html/PANEL_WEB/www
<Directory /var/www/html/PANEL_WEB/www>
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName panel.site
ServerAlias panel.site www.panel.site
WSGIDaemonProcess application_<name> user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/html/PANEL_WEB/app_apache.wsgi
<Directory /var/www/html/PANEL_WEB>
#Options Indexes FollowSymLinks MultiViews
#AllowOverride all
#Require all granted
#WSGIProcessGroup application
#WSGIApplicationGroup %{GLOBAL}
#WSGIScriptReloading On
Order deny,allow
Allow from all
Require all granted
</Directory>
ErrorLog /var/log/apache2/panel.site-error.log
LogLevel error
CustomLog /var/log/apache2/panel.site-access.log combined
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =mydomain.com
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
#!/usr/bin/env python
import sys
import os
base_path = os.path.dirname(os.path.abspath(__file__))
activate_this = base_path + '/_env/bin/activate_this.py'
if sys.version_info[0] < 3:
try:
execfile(activate_this, dict(__file__=activate_this))
except:
raise Exception('Error python version')
else:
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))
sys.path.insert(0, base_path)
os.environ['PROD'] = 'True'
os.environ['PATH_SITE'] = os.path.dirname(os.path.abspath(__file__))
try:
from app import app as application
except:
from index import app as application
# Mysql driver
sudo apt-get install libmysqlclient-dev
#apache wsgi python3 (no funciona en conjunto con el python2)
sudo apt-get install libapache2-mod-wsgi-py3
以上是关于sh 烧瓶安装的主要内容,如果未能解决你的问题,请参考以下文章
确认烧瓶安装后,Flask app no module named flask 出现在 elasticbeanstalk 中