Discussion:
[bottlepy] Deployment issue with Apache + mod_wsgi
Selçuk Mıynat
2015-07-09 22:35:24 UTC
Permalink
Hi,

I wrote a little Bottle application, which have a form for taking
input and eval'ing this input.
This app is working fine with the internal server of Bottle, but I
couldn't succeed to run it under Apache.

When I put an input and submit the form, it gives me the error which
seen at the screenshot.

I've raised the LogLevel of Apache but it didn't give me any more logs
about this problem.

Could somebody point me to the right direction to solve this issue?

(All of the codes are in this Gist, also :
https://gist.github.com/miynat/bab4d32e14a817ca3194)

8<===== apache vhosts.conf ===== >8

<VirtualHost *:80>
ServerName debianserver

WSGIDaemonProcess rce user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias /rce /var/www/html/adapter.wsgi

Alias /public /var/www/html/public

<Directory "/var/www/html">
WSGIProcessGroup rce
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>

==========

8<===== rce.py ===== >8

from bottle import get, post, request, run, template, static_file

@get('/public/<filename>')
def server_static(filename):
return static_file(filename, root='public/')

@get('/')
def index():
return template('home', content = "")

@post('/')
def form():
result = request.forms.get('content')
content = eval(result)
return template('home', content = content)

#run(host='0.0.0.0', port=9393, debug=True, reloader=True)

===========

8<===== adapter.wsgi ===== >8

import os, sys

sys.path = ['/var/www/html/'] + sys.path
os.chdir(os.path.dirname(__file__))

import bottle
import rce

application = bottle.default_app()
===========

8<===== views/template.tpl ===== >8

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Python RCE</title>
<link href="/public/reset.css" rel="stylesheet">
<link href="/public/style.css" rel="stylesheet">
</head>
<body>
<header>
<hgroup>
<h1>Python RCE</h1>
</hgroup>
</header>

{{ !base }}

</body>
</html>

===========

8<===== views/home.tpl ===== >8
% rebase ('template.tpl')

% if content:
<article class="complete">
<p>
Your name is: {{ content }}
</p>
</article>

% else:

<section id="add">
<form action="/" method="post">
<textarea name="content" placeholder="Input&hellip;"></textarea>
<input type="submit" value="Gönder!">
</form>
</section>

% end
===========

Thanks,
--
Selçuk Mıynat
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...