WebFaction
Community site: login faq

Ok, I'm stuck.

I've create a Apache, mod_wsgi 4.2.8/Python 3.4 app.

When I'm inside an activate virtual environmet (pyvenv or virtualenv) and I run $ ../apache2/bin/restart, I get:

File "/home/user/webapps/wsgi_app/apache2/bin/stop", line 14 print "Apache is not running." ^ SyntaxError: invalid syntax httpd (pid 23570) already running

When I deactivate my env, then I can restart no probs.

Why do I get a syntax error when restarting Apache via an env?

asked 07 Jan '15, 04:47

mhulse
411616
accept rate: 0%


Sorry for the trouble - this is a bug, and I've passed it along to our system administration team to have it corrected in new mod_wsgi installs.

To fix your application, you should be able to simply edit the "stop" script and replace this:

print "Apache is not running."

with this:

print("Apache is not running.")

Hope that helps!

permanent link

answered 07 Jan '15, 08:03

ryans ♦♦
5.0k83159
accept rate: 43%

Ahhh! Why didn't I think of that! I looked at that line several times and could not figure out what the issue was. Lol, I'm still not used to Python3's parens change. Thanks @ryans, I really appreciate the help!

(07 Jan '15, 08:05) mhulse
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×904
×224
×55
×55
×6

question asked: 07 Jan '15, 04:47

question was seen: 1,642 times

last updated: 07 Jan '15, 08:05

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM