Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!