First linux setup

4 views
Skip to first unread message

John Riddle

unread,
Dec 18, 2009, 2:09:19 PM12/18/09
to cherryp...@googlegroups.com
Hey folks, I've been running a cherrypy app on a WAMP box for awhile now and am now setting up a LAMP. I'm having much more difficulty than I ever did with the windows side of things surprisingly... I've got a strong feeling I have flicked on one "switch" somewhere and was hoping you guys could point it out. I've checked every log I can think of and not one of them is showing any sort of error but when I browse to my site the browser just hangs. I'm also serving phpmyadmin and that works great. My wild guess is that the mod_python isn't accessing the cherrypy.setup module, judging by the hang. Also when this file (called root.py) is accessed python usually creates it's compiled version (.pyc) and don't see it for root.py. Any help you can give a struggling noob is appreciated!

my sites-enabled file:

<VirtualHost *:80>
    ServerAdmin jri...@shadevfx.com
    ServerName umbra
    DocumentRoot /var/www/umbra/htdocs
   
    PythonPath "sys.path+['/var/www/umbra/htdocs']"
    SetHandler python-program
    PythonHandler cherrypy._cpmodpy::handler
    PythonOption cherrypy.setup root::serverless
    PythonDebug On
   
    ErrorLog /var/www/umbra/logs/log.log
    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

And the lines in root::serverless that start us up
cherrypy.config.update({'environment': 'production',
                                #'log.screen': False,
                                'log.screen': True,
                                'log.error_file': '/var/www/umbra/logs/site.log',
                                'show_tracebacks': True,})
                                #'show_tracebacks': True,})
cherrypy.engine.SIGHUP = None
cherrypy.engine.SIGTERM = None
cherrypy.tree.mount(Root())
cherrypy.engine.start()


Михаил

unread,
Dec 18, 2009, 6:06:19 PM12/18/09
to cherryp...@googlegroups.com
I never used mod_python, is it important for you to use it exactly? If
not I can post there mod_wsgi configuration example.

> --
>
> You received this message because you are subscribed to the Google Groups
> "cherrypy-users" group.
> To post to this group, send email to cherryp...@googlegroups.com.
> To unsubscribe from this group, send email to
> cherrypy-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cherrypy-users?hl=en.
>

Michael Semcheski

unread,
Dec 18, 2009, 2:52:07 PM12/18/09
to cherryp...@googlegroups.com
I would strongly recommend looking at /var/log/httpd/error.log.

Pete H

unread,
Dec 19, 2009, 9:16:12 AM12/19/09
to cherrypy-users

On Dec 18, 7:09 pm, John Riddle <jbrav...@gmail.com> wrote:
> Hey folks, I've been running a cherrypy app on a WAMP box for awhile now and
> am now setting up a LAMP. I'm having much more difficulty than I ever did
> with the windows side of things surprisingly... I've got a strong feeling I
> have flicked on one "switch" somewhere and was hoping you guys could point
> it out. I've checked every log I can think of and not one of them is showing
> any sort of error but when I browse to my site the browser just hangs. I'm
> also serving phpmyadmin and that works great. My wild guess is that the
> mod_python isn't accessing the cherrypy.setup module, judging by the hang.
> Also when this file (called root.py) is accessed python usually creates it's
> compiled version (.pyc) and don't see it for root.py. Any help you can give
> a struggling noob is appreciated!
>
> my sites-enabled file:
>
> <VirtualHost *:80>

>     ServerAdmin jrid...@shadevfx.com


>     ServerName umbra
>     DocumentRoot /var/www/umbra/htdocs
>
>     PythonPath "sys.path+['/var/www/umbra/htdocs']"
>     SetHandler python-program
>     PythonHandler cherrypy._cpmodpy::handler
>     PythonOption cherrypy.setup root::serverless
>     PythonDebug On
>
>     ErrorLog /var/www/umbra/logs/log.log
>     CustomLog /var/log/apache2/access.log combined
> </VirtualHost>
>
> And the lines in root::serverless that start us up
> cherrypy.config.update({'environment': 'production',
>                                 #'log.screen': False,
>                                 'log.screen': True,
>                                 'log.error_file':
> '/var/www/umbra/logs/site.log',
>                                 'show_tracebacks': True,})
>                                 #'show_tracebacks': True,})
> cherrypy.engine.SIGHUP = None
> cherrypy.engine.SIGTERM = None
> cherrypy.tree.mount(Root())
> cherrypy.engine.start()

Well that looks exactly the same as the config and code that works for
me.

This should be a silly question, but you have loaded mod_python?
Something like

LoadModule python_module lib/httpd/mod_python.so

in httpd.conf.

Other than that, look in the error log as already suggested.

As an aside you shouldn't be putting any code in htdocs - it should be
outside the apache documents path - something like cgi-bin.
And as has already been said mod_wsgi offers many benefits, not least
that properly configured other users in a virtula hosting environment
can't see your code.

Pete

John Riddle

unread,
Dec 22, 2009, 10:04:03 PM12/22/09
to cherryp...@googlegroups.com
So I'm error-less no matter what logs I check. For now, I'd like to just get this running with mod_python. I'm noticing now that when I try to browse to my site I get directed to the index.html file sitting at the /var/www root, despite having specified a different documentroot. Any thoughts?

Pete H

unread,
Dec 23, 2009, 7:07:01 AM12/23/09
to cherrypy-users

> > cherrypy-user...@googlegroups.com<cherrypy-users%2Bunsu...@googlegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cherrypy-users?hl=en.

Sounds like Apache can't get to your htdocs and is falling back to the
server root at /var/www

Does the user Apache as running as have list access to /var/www/umbra/
htdocs and all the directories on the way from / ? Apache will try to
stat each segment of the path.

Does the user Apache is running as have read access to your program
files in htdocs?

Have you got a section thus:

<Directory "/var/www/umbra/htdocs">

Options FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

This can go in the virtual host section.

Pete

Andrew Falcon

unread,
Dec 23, 2009, 11:08:26 AM12/23/09
to cherryp...@googlegroups.com
I see your using a sites-enabled directory for configuration.  Do you have a file like '000-default' in sites-enabled that also contains a VirtualHost on *:80?  A quick test showed that the VirtualHost in my 000-default file overrides anything in my custom files when 000-default is parsed first.

--

You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherryp...@googlegroups.com.
To unsubscribe from this group, send email to cherrypy-user...@googlegroups.com.

John Riddle

unread,
Jan 4, 2010, 3:01:57 PM1/4/10
to cherryp...@googlegroups.com
'Twas the permitions. When in doubt, 777 it out. =P

pkoelle

unread,
Jan 4, 2010, 4:48:53 PM1/4/10
to cherryp...@googlegroups.com
Am 23.12.2009 04:04, schrieb John Riddle:
> So I'm error-less no matter what logs I check. For now, I'd like to just get
> this running with mod_python. I'm noticing now that when I try to browse to
> my site I get directed to the index.html file sitting at the /var/www root,
> despite having specified a different documentroot. Any thoughts?
Most likely your request is not served by the correct VirtualHost. Your
"ServerName umbra" line looks suspicious (this should usually be a
FQDN). What's the URL your requesting? You can also check the Host:
HTTP-Header with firebug if you happen to use Firefox.

cheers
Paul

>> cherrypy-user...@googlegroups.com<cherrypy-users%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages