Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd December 2012, 17:20
Eike Eike is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question The Perfect SpamSnake - Ubuntu 12.04 - Nginx, uWSGI & Baruwa

Hey guys,

first of all I'm still "learning" and got stuck on this great howto. I did it a few years ago with Ubuntu 8.04 and the server still works well. Now I am trying to put a new version on a new server with Ubuntu 12.04.
Most of the 10.10-howto still works good but I am having problems with the installation of Nginx, uWSGI & Baruwa. The biggest problem ist that there are no Packages for 12.04 on https://launchpad.net/~chris-lea/+archive/uwsgi. I tried using the Ubuntu repository, but then folders like /etc/uwsgi/uwsgi-python2.6/ are missing because there is no uwsgi-python2.6 on 12.04.
I would even install more from the repository, but when I install Baruwa, it doesn't find Mailscanner, needs to install/replace it and crashes because it cannot remove the folders. When I even install Mailscanner (from the Baruwa repo) with Aptitude the folders completely differ from the howto.
Can anyone help me, especially with uWSGI? Or is it easy to use Apache, instead of nginx?

Thanks a lot & best regards
Eike
Reply With Quote
Sponsored Links
  #2  
Old 4th December 2012, 16:33
Rocky Rocky is offline
Senior Member
 
Join Date: Oct 2005
Posts: 553
Thanks: 14
Thanked 49 Times in 48 Posts
Default

What errors do you get with uwsgi and nginx?
__________________
Home of the SpamSnake
Reply With Quote
  #3  
Old 5th December 2012, 10:46
Eike Eike is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is no Precise-/Quantal-.deb for uWSGI on Chris Lea's Launchpad and when I install nginx and uWSGI with Aptitude I need Python 2.7, instead of 2.6. The folder /etc/uwsgi/uwsgi-python2.6/ doesn't exist and currently my Linux skills are (by far...) not good enough to find the solution...

Is it difficult to use Apache, instead of nginx? Or would it end up in a mess when I try to install Mailscanner, Baruwa and Apache with Aptitude?
Reply With Quote
  #4  
Old 7th December 2012, 13:12
Rocky Rocky is offline
Senior Member
 
Join Date: Oct 2005
Posts: 553
Thanks: 14
Thanked 49 Times in 48 Posts
Default Try This

Let me know if the following steps are successful:

apt-get install nginx uwsgi uwsgi-extra uwsgi-plugin-python

vi /etc/nginx/sites-available/baruwa.conf

[uwsgi]
workers = 2
chdir = /usr/share/pyshared/baruwa
env = DJANGO_SETTINGS_MODULE=baruwa.settings
module = django.core.handlers.wsgi:WSGIHandler()

vi /etc/uwsgi/apps-available/baruwa.ini

server {
server_name spamsnake.mcrirents.com;
access_log /var/log/nginx/access.log;
location / {
uwsgi_pass unix:///var/run/uwsgi/app/baruwa/socket;
include uwsgi_params;
}
}

Create symlinks
rm -r /etc/nginx/sites-enabled/default
cp /usr/share/doc/uwsgi-extra/nginx/uwsgi_params /etc/nginx/
ln -s /etc/nginx/sites-available/baruwa.conf /etc/nginx/sites-enabled/baruwa.conf
ln -s /etc/uwsgi/apps-available/baruwa.ini /etc/uwsgi/apps-enabled/baruwa.ini

Restart both nginx and uwsgi
/etc/init.d/nginx restart && /etc/init.d/uwsgi restart
__________________
Home of the SpamSnake

Last edited by Rocky; 7th December 2012 at 13:14.
Reply With Quote
  #5  
Old 11th December 2012, 10:28
Eike Eike is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Rocky,
thanks for answering. Sorry, I had not much time in the last few days.

I've changed the files and commented out the content of /etc/nginx/sites-available/baruwa.conf.
But when I restart nginx and uwsgi I get this:

Code:
Restarting nginx: nginx: [emerg] unknown directive "[uwsgi]" in /etc/nginx/sites-enabled/baruwa.conf:25
nginx: configuration file /etc/nginx/nginx.conf test failed
Do you know what I did wrong?
Reply With Quote
  #6  
Old 11th December 2012, 22:04
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Can you post your /etc/nginx/sites-enabled/baruwa.conf file?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 21st December 2012, 22:47
lctn lctn is offline
Junior Member
 
Join Date: May 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default nginx failes on restart

I see others are having similar issues. Any help is appreciated with this problem:

I had to install baruwa via apt, since the file in the tutorial could not be found. Maybe that caused the issue. I see it also installed apache2, but not sure if that causes a problem.



/etc/init.d/uwsgi restart && /etc/init.d/nginx restart
* Restarting app server(s) uwsgi [ OK ]
Restarting nginx: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/baruwa.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed



/etc/nginx/sites-enabled/baruwa.conf
[uwsgi]
workers = 2
chdir = /usr/share/pyshared/baruwa
env = DJANGO_SETTINGS_MODULE=baruwa.settings
module = django.core.handlers.wsgi:WSGIHandler()

/etc/uwsgi/apps-available/baruwa.ini:

server_name relay-2.lctn.org;
root /usr/share/pyshared/baruwa;
autoindex on;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /static {
root /usr/share/pyshared/baruwa/static/;
}

# static resources
location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar |bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp| rtf|js)$
{
expires 30d;
break;
}

location / {
uwsgi_pass unix:///var/run/uwsgi/app/baruwa/socket;
include uwsgi_params;
}
}
Reply With Quote
  #8  
Old 22nd December 2012, 04:39
Rocky Rocky is offline
Senior Member
 
Join Date: Oct 2005
Posts: 553
Thanks: 14
Thanked 49 Times in 48 Posts
Default

Hey,

Unfortunately, you have to use my sn package for the install. I've removed a few things from the binary from my custom setup, so that's why you're having issues. I've updated the link, let me know if it works. Google is not really document friendly anymore and I don't have a storage for it.

Rocky
__________________
Home of the SpamSnake
Reply With Quote
  #9  
Old 27th December 2012, 19:03
JhonKa JhonKa is offline
Junior Member
 
Join Date: Dec 2012
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lctn View Post
/etc/init.d/uwsgi restart && /etc/init.d/nginx restart
* Restarting app server(s) uwsgi [ OK ]
Restarting nginx: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/baruwa.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed

Rocky,

I used your SN package for the install and I'm getting this same error.
Reply With Quote
  #10  
Old 28th December 2012, 05:43
flashingcurser flashingcurser is offline
Junior Member
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 3 Times in 2 Posts
 
Default

The config file and ini file for uwsgi are mixed up in the tutorial. Swap the info between and you'll be golden.
Reply With Quote
The Following 2 Users Say Thank You to flashingcurser For This Useful Post:
JhonKa (28th December 2012), Rocky (28th December 2012)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spamsnake 10.10 Baruwa issues after update tuxic HOWTO-Related Questions 5 11th September 2011 03:21
The Perfect SpamSnake - Ubuntu Jeos 10.04 - Nginx, uWSGI & Baruwa Drex56 HOWTO-Related Questions 17 8th February 2011 23:21
Connection timed out on intermail outgoing mails gouravgarg Server Operation 6 5th March 2010 21:31
MailScanner trouble with DBD-MYSQL sergio.arnaldo Server Operation 11 26th August 2009 19:08
SpamSnake SpamAssassin not working? getrav HOWTO-Related Questions 5 24th June 2008 00:02


All times are GMT +2. The time now is 13:41.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.