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

322
Vistas
Hosting django channels on apache and daphne

I am trying to deploy django chat application on apache the same way. Can someone please help me with setting up the daphne server? I am totally new to deploying django channels. I have a linux virtual machine (ubuntu). The site is running but the websocket connection is not established. the error I see in the console is:

(index):16 WebSocket connection to 'ws://chat.bagdigital.in/ws/chat/lobby/' failed: 
(anonymous) @ (index):16
(index):30 Chat socket closed unexpectedly
chatSocket.onclose @ (index):30

here is my apache conf file.

<VirtualHost *:80>
    ServerName chat.bagdigital.in

    #ServerAdmin webmaster@localhost
    #DocumentRoot /var/www/html


    ErrorLog ${APACHE_LOG_DIR}/error_chat_bagwebsite.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


    Alias /static /home/pksingh/chat-app/chat-api/static
    Alias /media /home/pksingh/chat-app/chat-api/media

    <Directory /home/pksingh/chat-app/chat-api/static>
            Require all granted
    </Directory>

    <Directory /home/pksingh/chat-app/chat-api/media>
            Require all granted
    </Directory>



    <Directory /home/pksingh/chat-app/chat-api/chatapi>
            <Files wsgi.py>
                    Require all granted
            </Files>
    </Directory>

    WSGIScriptAlias / /home/pksingh/chat-app/chat-api/chatapi/wsgi.py
    WSGIDaemonProcess bag_chat_app python-path=/home/pksingh/chat-app/chat-api python-home=/home/pksingh/chat-app/chat-api/venv
    WSGIProcessGroup bag_chat_app

I have installed the redis server. And the socket connection is running fine if I run the django server at port 8000 normally without using apache.

python3 manage.py runserver 0.0.0.0:8000 &

Can someone help me with setting up daphne server here??

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