mod_python

I need to deploy a python application, I want to know if installing the default FC3 mod_python rpm will work with the apache that ships with Interworx?

It should be but it’s never been tried or tested. Most apache modules obtained in RPM format for Apache 2.0.41+ should work.

Chris

Dear houndbee,

Did it work out? Since we would like to install it on our servers as well.

Thanks,

R?mon

Hi Ramon,

I never really got around to installing mod_python, just hosted the stuff with a friend who had it running already.

Cheers,
-K

I can confirm it’s working here.
Just a simple “yum install mod_python” and a “service httpd restart” does the job.
And than adding this to the python.conf in /etc/httpd/conf.d:


<Directory /home/domainco/domain.com/html/>
    SetHandler mod_python
    PythonHandler mod_python.publisher
</Directory>

I would like to add this to the standard http conf’s of the sites:

[SIZE=1]# begin Pyhton
<Directory /home/domainco/domain.com/html/python>
                 SetHandler mod_python
                 PythonHandler mod_python.publisher
</Directory>
ScriptAlias /python/ /home/domainco/domain.com/html/python/
# end Pyhton
[/SIZE]

Is this possible? Can I add it somewhere so that this will be written on default?
And is it possible that the /python dir will be created on site creation?

Thanks,

R?mon

Which scripts use Python?
Mabye there is some nice forum software for it…
Edit: I have taken a look at Hotscripts but there are not many scripts for Python… (or do you have to look somewhere else?)

Django
http://www.djangoproject.com/

Looks good!

I found it in the documentation, I’ll have to edit /home/interworx/etc/vhost-base.conf

It looks like this now:

<VirtualHost <<IP_ADDR>>:<<PORT>>>
  <<SUEXEC>>
  DocumentRoot <<WEBROOT>>
  ServerName <<DOMAIN>>
  ServerAlias <<ALIASES>> *.<<DOMAIN>>
  ServerAdmin [EMAIL="webmaster@<<DOMAIN"]webmaster@<<DOMAIN[/EMAIL]>>
  # subdomain logic
  RewriteEngine On
  RewriteOptions inherit
  RewriteCond %{HTTP_HOST} !^www\.<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} !^<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+)\.<<ESCDOMAIN>> [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^([0-9A-Za-z-]+)\.<<ESCDOMAIN>>/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]
  # end subdomain logic
  ErrorLog <<ERRORLOG>>
  CustomLog <<XFERLOG>> combined
  php_admin_flag engine On
  # cgi: <<CGISTATUS>>  don't edit between this and the "end cgi" comment below
  <Directory <<WEBROOT>>>
  <<CGI1>>
  </Directory>
  <<CGI2>>
  # end cgi
</VirtualHost>

I think that I have to change it in this:

<VirtualHost <<IP_ADDR>>:<<PORT>>>
  <<SUEXEC>>
  DocumentRoot <<WEBROOT>>
  ServerName <<DOMAIN>>
  ServerAlias <<ALIASES>> *.<<DOMAIN>>
  ServerAdmin [EMAIL="webmaster@<<DOMAIN"]webmaster@<<DOMAIN[/EMAIL]>>
  # subdomain logic
  RewriteEngine On
  RewriteOptions inherit
  RewriteCond %{HTTP_HOST} !^www\.<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} !^<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+)\.<<ESCDOMAIN>> [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^([0-9A-Za-z-]+)\.<<ESCDOMAIN>>/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]
  # end subdomain logic
  ErrorLog <<ERRORLOG>>
  CustomLog <<XFERLOG>> combined
  php_admin_flag engine On
  # cgi: <<CGISTATUS>>  don't edit between this and the "end cgi" comment below
  <Directory <<WEBROOT>>>
  <<CGI1>>
  </Directory>
  <<CGI2>>
  # end cgi
  # begin Pyhton
  <Directory <<WEBROOT>>/python>
 SetHandler mod_python
 PythonHandler mod_python.publisher
  </Directory>
  ScriptAlias /python/ <<WEBROOT>>/python/
  # end Pyhton
</VirtualHost>

Can I just create the map python in /usr/local/interworx/etc/skel/ ? Or should I do more?

Hi Ramon,

Yes, you should just need to create the python directory in the InterWorx skel directory. The contents of that directory will get copied over to any newly created SiteWorx account.

Socheat

OK, thanks. The python map should be owned bij the user “iworx” correct? In the skel map?

Does the modified “vhost-base.conf” looks OK? Or did I make a mistake?

-R?mon