Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Aug 04, 2012 12:09 pm 
Offline

Joined: Sat Aug 04, 2012 11:38 am
Posts: 1
Hello,
I have installed Apache2, mod_wsgi, Django.
I have not managed to run the server with Django I serve static content with nginx, changing the port 80, the page does not load.

"/etc/apache2/sites-availables/dominio.com
Code:
<VirtualHost *:8080>
   ServerName dominio.com
   ServerAlias www.dominio.com
   ServerAdmin admin@dominio.com

   DocumentRoot /var/www

   WSGIScriptAlias / /home/user/mysite/mysite/wsgi.py
   WSGIPythonPath /home/user/mysite
   <Directory /home/user/mysite/mysite>
   <Files wsgi.py>
      Order allow,deny
      Allow from all
   </Files>
   </Directory>
   ErrorLog /var/logs/error.log
   CustomLog /var/logs/access.log combined
</VirtualHost>


'/etc/apache2/ports.conf'
Code:
NameVirtualHost *:8080
Listen 8080

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>


Please share any guide to install "Django1.4"+apach2+nginx+mod_wsgi.

Thank you very much.


Top
   
PostPosted: Sun Aug 05, 2012 7:28 am 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
Here is my http.conf:

Code:
# for use of the multiprocessing module
WSGIRestrictStdin Off

# Django main site, threaded for non-session and non-weave pages
WSGIDaemonProcess zunzun user=www-data group=www-data processes=2 threads=10 maximum-requests=100
WSGIImportScript /home/zunzun/current/wsgi.handler process-group=zunzun application-group=%{GLOBAL}
WSGIDaemonProcess zunzun_recycle user=www-data group=www-data processes=6 threads=1 maximum-requests=1
WSGIImportScript /home/zunzun/current/wsgi.handler process-group=zunzun_recycle application-group=%{GLOBAL}


# Django testing and development
WSGIDaemonProcess zunzun_test user=www-dev group=www-data processes=1 threads=2 maximum-requests=50
WSGIImportScript /home/zunzun/development/wsgi.handler process-group=zunzun_test application-group=%{GLOBAL}
WSGIDaemonProcess zunzun_recycle_test user=www-dev group=www-data processes=1 threads=1 maximum-requests=1
WSGIImportScript /home/zunzun/development/wsgi.handler process-group=zunzun_recycle_test application-group=%{GLOBAL}

WSGIApplicationGroup %{GLOBAL}


Top
   
PostPosted: Fri Aug 10, 2012 10:38 am 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:35 pm
Posts: 111
Location: United Kingdom
Why don't you ditch Apache completely? I use Nginx for everything (two Wordpress sites and a Django site). It seems silly to have two capable HTTP servers on the same machine. Ditch Apache and just stick with Nginx for everything.


Top
   
PostPosted: Fri Aug 10, 2012 11:20 am 
Offline
Senior Newbie

Joined: Tue Aug 07, 2012 2:55 pm
Posts: 11
Can you post your nginx config please?

Cromulent wrote:
Why don't you ditch Apache completely? I use Nginx for everything (two Wordpress sites and a Django site). It seems silly to have two capable HTTP servers on the same machine. Ditch Apache and just stick with Nginx for everything.


It's not silly. There are good reasons to use both Nginx and Apache on the same server.

1. Nginx can handle way more concurrent connections than Apache so it makes an awesome proxy in front of an apache server or even multiple apache servers.
2. Nginx excels at serving static content while Apache excels at serving dynamic content like php or python. If they both serve what they're best at instead of having one serve static and dynamic content, you'll end up serving your web pages faster.
3. Apache has way more modules, especially authentication modules than Nginx. So for example, if need you some fancy authentication method, there's most likely an existing Apache module for it.

Don't get me wrong though, I LOVE Nginx and it's my go to web server but don't be so quick at ditching Apache.


Top
   
PostPosted: Fri Aug 10, 2012 4:20 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
limitedquantities wrote:
2. Nginx excels at serving static content while Apache excels at serving dynamic content like php or python. If they both serve what they're best at instead of having one serve static and dynamic content, you'll end up serving your web pages faster.


[Citation Needed]

Do you have any benchmarks that show that Apache handles dynamic content faster than nginx?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group