Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

321
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda