Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
apache lib-wsgi 403 Forbidden

The only way I can run apps on my local machine is by using apache and lib-wsgi. I have installed all the relevent packages including encodings but in my browser I am getting a 403 Forbidden error and in my error logs I am getting this:

AH00051: child pid 28900 exit signal Aborted (6), possible coredump in /etc/apache2
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

I have run

sudo chmod a+x on my files

and

sudo chmod +rw on my folders.

and

sudo chown on my working directories

What do I need to do to get this working?

These are my files:

.conf file:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/demo1
        ServerName 127.0.0.1
        # Give an alias to to start your website url with
     WSGIDaemonProcess application python-home=/var/www/html/demo1
     WSGIProcessGroup flask-hello-app
     WSGIApplicationGroup %{GLOBAL}
     WSGIScriptAlias /demo1 /var/www/html/demo1/flask-hello-app.wsgi
     <Directory /var/www/html/demo1/>
                # set permissions as per apache2.conf file
            Options FollowSymLinks
            # AllowOverride None
            # Require all granted
            Order deny,allow
            Allow from all
     </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

flask-hello-app.wsgi

#!/uae/bin/python3
import logging
import sys
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/var/www/html/demo1/')
from application import app as application
application.secret_key = 'super_secret_key'

flask-hello-app.py

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql+psycopg2://postgres:F00tBall@127.0.0.1:5432/example'
db = SQLAlchemy(app)

class Person(db.Model):
    __tablename__ = 'persons'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(), nullable=False)

db.create_all()

@app.route('/')
def index():
    return 'Hello '

if __name__ == '__main__':
    app.run()

I really need to know how to get this working.

Thanks.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda