HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   The Perfect SpamSnake - Ubuntu 12.04 - Nginx, uWSGI & Baruwa (http://www.howtoforge.com/forums/showthread.php?t=59846)

Eike 3rd December 2012 17:20

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

Rocky 4th December 2012 16:33

What errors do you get with uwsgi and nginx?

Eike 5th December 2012 10:46

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?

Rocky 7th December 2012 13:12

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

Eike 11th December 2012 10:28

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?

falko 11th December 2012 22:04

Can you post your /etc/nginx/sites-enabled/baruwa.conf file?

lctn 21st December 2012 22:47

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;
}
}

Rocky 22nd December 2012 04:39

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

JhonKa 27th December 2012 19:03

Quote:

Originally Posted by lctn (Post 289960)
/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.

flashingcurser 28th December 2012 05:43

The config file and ini file for uwsgi are mixed up in the tutorial. Swap the info between and you'll be golden.


All times are GMT +2. The time now is 08:31.

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