Apache Help

263 views
Skip to first unread message

Daniel Wexler

unread,
Sep 16, 2008, 11:16:47 PM9/16/08
to reviewboard
I'm struggling through the Apache configuration. I've finally got the
various paths set correctly and I no longer get any errors in the
apache log files, but I can't get rid of the silly "Manual server
updates required" page.

I've followed all the instructions for the new uploaded/images dir in:
http://code.google.com/p/reviewboard/source/detail?r=1247

I've checked the paths to the reviewboard/htdocs/media/uploaded/images
directory and made sure they are all owned by the webserver user.
Heck, I've even chmod'ed them all as 777! I've done the
fixscreenshots bit.

It all works fine if I run the "manage.py runserver <machine>:8000"
server. With the simple server, I can log in and manage reviewboard.
But through Apache, at "http://<machine>" I get the "Manual server
updates required" page.

Any tips on what might still be required to get Apache serving pages?

This is using Apache 2.0 with Django 1.0 on Windows XP.

Here's the relevant part of my httpd.conf file (reviewboard is in C:/
reviewboard, it took a long time to figure out the PythonPath):

<VirtualHost *:80>
ServerName maki.nvidia.com
#DocumentRoot @pythondir@/reviewboard/htdocs
DocumentRoot "c:/reviewboard/htdocs"

# Error handlers
ErrorDocument 500 /errordocs/500.html

# Serve django pages
<Location "/">
#PythonPath "['@djangodir@'] + ['@pythondir@/reviewboard'] +
['@pythondir@/djblets'] + sys.path"
PythonPath "['c:/'] + ['c:/reviewboard'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonAutoReload Off
PythonDebug On
# If you run multiple mod_python sites in the same apache
# instonce, uncomment this line:
# PythonInterpreter reviewboard
</Location>

# Serve static media without running it through mod_python
# (overrides the above)
<Location "/media">
SetHandler None
</Location>
<Location "/errordocs">
SetHandler None
</Location>

# Alias static media requests to filesystem
#Alias /media @pythondir@/reviewboard/htdocs/media
#Alias /errordocs @pythondir@/reviewboard/htdocs/errordocs
Alias /media "c:/reviewboard/htdocs/media"
Alias /errordocs "c:/reviewboard/htdocs/errordocs"
</VirtualHost>

Terry Rankine

unread,
Sep 17, 2008, 12:30:10 AM9/17/08
to revie...@googlegroups.com
our test server is setup this way. debian linux, apache 2.2, not sure if it helps

<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /home/rb/reviewboard/htdocs
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature Off


        # Alias static media requests to filesystem
        Alias /media /home/rb/reviewboard/htdocs/media
        Alias /errordocs /home/rb/reviewboard/htdocs/errordocs


        ErrorDocument 500 /errordocs/500.html

        # Serve django pages
        <Location "/">
                PythonPath "['/usr/lib/python2.4/site-packages/django', '/usr/lib/python2.4/site-packages/pysqlite2', '/home/rb', '/home/rb/reviewboard', '/home/rb/reviewboard/djblets'] + sys.path"

                SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
                SetHandler mod_python
                PythonHandler django.core.handlers.modpython
                PythonAutoReload Off
                PythonDebug Off

                # If you run multiple mod_python sites in the same apache
                # instonce, uncomment this line:
                PythonInterpreter reviewboard
        </Location>

        # Serve static media without running it through mod_python
        # (overrides the above)
        <Location "/media">
                SetHandler None
        </Location>
        <Location "/errordocs">
                SetHandler None
        </Location>
</VirtualHost>

Not sure

Guillaume

unread,
Sep 17, 2008, 3:13:55 AM9/17/08
to reviewboard
Hi All,

I got the same problem : "Manual server updates required" page.
My configuration seems to be more or less the same than daniel.

Some informations about my installation :
Installed on linux Ubuntu server 8.04 with most of the apt-get
features (debian package manager)
reviewboard is checkout in /usr/share
so everything is in /usr/share/reviewboard

My apache configuration is :

<VirtualHost *>
ServerName review.sharengo.org
DocumentRoot /usr/share/reviewboard/htdocs

# Error handlers
ErrorDocument 500 /errordocs/500.html

# Serve django pages
<Location "/">
PythonPath "['/usr/lib/python2.5/site-packages/django']
+ ['/usr/share'] + ['/usr/share/reviewboard'] + ['/usr/share/
reviewboard/djblets'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonAutoReload Off
PythonDebug Off
# If you run multiple mod_python sites in the same
apache
# instonce, uncomment this line:
PythonInterpreter reviewboard
</Location>

# Serve static media without running it through mod_python
# (overrides the above)
<Location "/media">
SetHandler None
</Location>
<Location "/errordocs">
SetHandler None
</Location>

# Alias static media requests to filesystem
Alias /media /usr/share/reviewboard/htdocs/media
Alias /errordocs /usr/share/reviewboard/htdocs/errordocs
</VirtualHost>

Christian Hammond

unread,
Sep 17, 2008, 3:47:40 AM9/17/08
to revie...@googlegroups.com
In both your cases, which instructions is it showing for the manual server updates? There are currently two things that can trigger this page. One being that /media/uploaded/images is not a directory, and one being that syncdb hasn't been ran.

I'm assuming the former in both your cases.

Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.

Guillaume Dufrêne

unread,
Sep 17, 2008, 4:41:25 AM9/17/08
to revie...@googlegroups.com
Hi Christian,
thanks for your reply,

Both errors were reported by this page for me.
So, I created the /media/uploaded/images
I "chowned" this new directory to www-data which is the apache user
I executed the ./manage.sh syncdb
I reloaded apache (I don't really think it was necessary)

No more error about the images directory but it is still said that i need to sync my db ... ever, and ever ...

--
Guillaume.

fharrison

unread,
Sep 17, 2008, 4:58:14 AM9/17/08
to reviewboard
Did the sync give you any warnings?

I also got both errors when I updated yesterday. The directories in
question needs to be owned or read/writeable by the Apache user; a
quick hack (and it is a hack) is to (from media) "chmod 777 -R
uploaded".

F.

On Sep 17, 9:41 am, Guillaume Dufrêne <guillaume.dufr...@free.fr>
wrote:
> > Christian Hammond - chip...@chipx86.com <mailto:chip...@chipx86.com>
> > VMware, Inc.

Guillaume Dufrêne

unread,
Sep 17, 2008, 6:16:38 AM9/17/08
to revie...@googlegroups.com
Hi,

About rights, I made a chown of my media dir ...
Do i need to do a chmod 777 on it ?

ps of my server :
root 31830 0.0 0.3 26248 9764 ? Ss Sep16 0:01
/usr/sbin/apache2 -k start
www-data 25219 0.2 0.4 33816 14636 ? S 11:39 0:04 \_
/usr/sbin/apache2 -k start
www-data 25969 0.2 0.4 33908 13852 ? S 11:51 0:02 \_
/usr/sbin/apache2 -k start

As you can see my apache is run by www-data user

ls -al htdocs/media
drwxr-xr-x 9 www-data root 4096 2008-09-16 16:13 .
drwxr-xr-x 5 www-data root 4096 2008-09-16 16:13 ..
drwxr-xr-x 6 www-data root 4096 2008-09-16 16:13 admin
drwxr-xr-x 6 www-data root 4096 2008-09-16 16:13 djblets
drwxr-xr-x 6 www-data root 4096 2008-09-16 16:12 rb
drwxr-xr-x 6 www-data root 4096 2008-09-16 16:13 .svn
drwxr-xr-x 4 www-data root 4096 2008-09-16 17:57 uploaded
drwxr-xr-x 28 www-data root 4096 2008-09-16 16:12 yui
drwxr-xr-x 3 www-data root 4096 2008-09-16 16:12 yui-ext

And as you can see this directory is owned by www-data this read/write
privileges.

./manage.py syncdb
Installing json fixture 'initial_data' from
'/usr/share/reviewboard/scmtools/fixtures'.
Installed 6 object(s) from 1 fixture(s)

No warning at all ...

I'm still confused about this error.

--
Guillaume.

Daniel Wexler

unread,
Sep 17, 2008, 7:49:25 AM9/17/08
to reviewboard
Thanks for the replies. Good to see this is happening to others!

The tan manual server updates required box is followed by a single
light blue "Database changes" box that indicates that the schema has
changed since my last upgrade and I need to run syncdb.

I get no errors when I run syncdb. Even better, there has been no
upgrade. This is a completely fresh install.

Also, reviewboard works properly when I use the built-in server on
port 8000. I only get these messages via Apache on port 80.

My directories are all chmod'ed 777.

I think that, like Guillaume, I initially had the "images" error, but
that's gone away.

On Sep 17, 3:16 am, Guillaume Dufrêne <guillaume.dufr...@free.fr>

Christian Hammond

unread,
Sep 17, 2008, 8:07:22 AM9/17/08
to revie...@googlegroups.com
How did you guys install Review Board and Djblets?

Please try the following and report the output.

Run:

$ ./manage.py shell
>>> from djblets.siteconfig.models import SiteConfiguration
>>> siteconfig = SiteConfiguration.objects.get_current()

This will help to track it down.

Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.


Daniel Wexler

unread,
Sep 17, 2008, 8:16:51 AM9/17/08
to reviewboard


On Sep 17, 5:07 am, "Christian Hammond" <chip...@chipx86.com> wrote:
> How did you guys install Review Board and Djblets?

Reviewboard is installed from scratch in this case, using sqlite and
the standard instructions on Getting Started. Django was installed
from an egg file using an egg file and easy_install (IIRC). This is
using Python25 on Windows XP.

> Please try the following and report the output.
>
> Run:
>
> $ ./manage.py shell
>
> >>> from djblets.siteconfig.models import SiteConfiguration
> >>> siteconfig = SiteConfiguration.objects.get_current()

No errors, and no output:

C:\reviewboard>manage.py shell
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from djblets.siteconfig.models import SiteConfiguration
>>> siteconfig = SiteConfiguration.objects.get_current()
>>>


Reading through the Django/mod_python docs, it does indicate that
Django eats the error messages. Is there any place to look to see the
errors or any way to enable error reporting? I've turned on
PythonDebug in my httpd.conf file to no avail. I also tried following
the egg-specific instructions in the Django mod_python setup
instructions. I created a writable directory in "C:/reviewboard/
enable_eggs" and added the following lines to my httpd.conf file
outside the VirtualHost block:

PythonInterpreter reviewboard
PythonImport "c:/reviewboard/enable_eggs.py" reviewboard

And then, inside the VirtualHost block, I enable the PythonInterpreter
with:

PythonInterpreter reviewboard

No change. Same problem.

>
> This will help to track it down.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> VMware, Inc.

Daniel Wexler

unread,
Sep 17, 2008, 8:19:27 AM9/17/08
to reviewboard
In the same "manage.py shell" I tried printing the siteconfig:

>>> print siteconfig
maki.nvidia.com/ (version 0.9)


It is kinda odd that it says version 0.9 since I installed Django
1.0...

fharrison

unread,
Sep 17, 2008, 8:33:45 AM9/17/08
to reviewboard
Daniel, are you on Windows? If so how are chmoding, cygwin, colinux?
Chmoding via cygwin won't work, you'll need to use the Windows native
security settings; to give whatever the Apache user is read/write
perms, do it via the folder's properties (right-click->properties-
>'Security' tab). Btw, I accidentally changed the security settings on
the wrong directory "reviewboard\uploaded" instead of "reviewboard
\htdocs\media\uploaded". That confused me for a couple of minutes. :(

I'm a bit confused though, are you still getting the "Database
changes" box, even after a sync? Have you tried "manage.py evolve"?

Guillaume, are you sure you've created the images directory?

F.

Daniel Wexler

unread,
Sep 17, 2008, 9:02:58 AM9/17/08
to reviewboard
Thanks for sticking with me, but I still have the same issue.

Yes, I'm on Windows and I was using cygwin's chmod/chown commands. I
just tried using the Window's security settings, as you suggested, but
that didn't change anything. I still get the "Database changes" box.

The syncdb command never told me to do an evolve, but I had tried it
before, just in case, and I tried it again now, and it just returns
"No evolution required."

Yes, I still get the Database changes box, even after I run syncdb
with no errors. The only output from syncdb is:


C:\reviewboard>manage.py evolve
No evolution required.

C:\reviewboard>manage.py syncdb
Installing json fixture 'initial_data' from 'C:\reviewboard\scmtools
\fixtures'.
Installed 6 object(s) from 1 fixture(s)



Guillaume Dufrêne

unread,
Sep 17, 2008, 9:40:15 AM9/17/08
to revie...@googlegroups.com

Yes I do :

ls -al htdocs/media/uploaded/
drwxr-x--- 4 www-data root 4096 2008-09-16 17:57 .
drwxr-xr-x 9 www-data root 4096 2008-09-16 16:13 ..
drwxr-x--- 2 www-data root 4096 2008-09-16 17:57 images
drwxr-x--- 6 www-data root 4096 2008-09-16 16:13 .svn

I tried to chmod 777 the uploaded directory without any positive result ...


About ./manage.py shell :
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2

Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from djblets.siteconfig.models import SiteConfiguration
>>> siteconfig = SiteConfiguration.objects.get_current()
>>>

no output ...


About the way I installed reviewboard, I wrote a common procedure to install it on ubuntu distrib :

apt-get install libapache2-mod-python patchutils memcached libjpeg62-dev libfreetype6-dev python-all-dev gcc python-svn
cd /usr/share
svn checkout http://reviewboard.googlecode.com/svn/trunk/reviewboard
cd /tmp
wget http://www.djangoproject.com/download/1.0/tarball/
tar zxvf Django-1.0.tar.gz
cd Django-1.0
python setup.py install
cd /tmp
wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
cd Imaging-1.1.6
python setup.py install
cd /usr/share/reviewboard
cp settings_local.py.tmpl settings_local.py
vi settings_local.py

Change configuration :
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'reviewboard.sqlite'

save / exit file

./manage.py syncdb
reply yes and add an admin account
You can now test your installation this ./manage.py runserver and access http://YOUR_SERVER:8000

create an images directory in media/uploaded :
mkdir -p htdocs/media/uploaded/images

change owner of this directory to the apache user :
chown -R www-data htdocs

create a new site configuration into /etc/apache2/sites-available/ :

<VirtualHost *>
    ServerName review.sharengo.org
    DocumentRoot /usr/share/reviewboard/htdocs

    # Error handlers
    ErrorDocument 500 /errordocs/500.html

    # Serve django pages
    <Location "/">
        PythonPath "['/usr/lib/python2.5/site-packages/django'] + ['/usr/share'] + ['/usr/share/reviewboard'] + ['/usr/share/reviewboard/djblets'] + sys.path"

        SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
        SetHandler mod_python
        PythonHandler django.core.handlers.modpython
        PythonAutoReload Off
        PythonDebug Off
        # If you run multiple mod_python sites in the same apache
        # instonce, uncomment this line:
        PythonInterpreter reviewboard
    </Location>

    # Serve static media without running it through mod_python
    # (overrides the above)
    <Location "/media">
        SetHandler None
    </Location>
    <Location "/errordocs">
        SetHandler None
    </Location>

    # Alias static media requests to filesystem
    Alias /media /usr/share/reviewboard/htdocs/media
    Alias /errordocs /usr/share/reviewboard/htdocs/errordocs
</VirtualHost>

enable new site configuration :
a2ensite review.sharengo.org

reload apache configuration :
/etc/init.d/apache2 reload

Ben

unread,
Sep 17, 2008, 12:54:02 PM9/17/08
to reviewboard
I guess your reviewboard is not able to find the database ...

I got the same early today running my reviewboard via wsgi, and
indicating a relative path to the sqlite file.

Indicating the absolute path to the sqlite database solved the issue,
but then I realized I did not wanted it rooted on my server, but with
a SITE_ROOT value, and switched to mod_python (which did not solved my
problem, but I did not switched back to wsgi yet).

In a nuttshel: reviewboard were not able to find my database and
continuously asking me to recreate it, I gave him the absolute path
and it solved it.

Regards,
Ben

On Sep 17, 3:40 pm, Guillaume Dufrêne <guillaume.dufr...@free.fr>
wrote:
> Yes I do :
>
> ls -al htdocs/media/uploaded/
> drwxr-x--- 4 www-data root 4096 2008-09-16 17:57 .
> drwxr-xr-x 9 www-data root 4096 2008-09-16 16:13 ..
> drwxr-x--- 2 www-data root 4096 2008-09-16 17:57 images
> drwxr-x--- 6 www-data root 4096 2008-09-16 16:13 .svn
>
> I tried to chmod 777 the uploaded directory without any positive result ...
>
> About ./manage.py shell :
> Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
>  >>> from djblets.siteconfig.models import SiteConfiguration
>  >>> siteconfig = SiteConfiguration.objects.get_current()
>  >>>
>
> no output ...
>
> About the way I installed reviewboard, I wrote a common procedure to
> install it on ubuntu distrib :
>
> apt-get install libapache2-mod-python patchutils memcached libjpeg62-dev
> libfreetype6-dev python-all-dev gcc python-svn
> cd /usr/share
> svn checkouthttp://reviewboard.googlecode.com/svn/trunk/reviewboard
> cd /tmp
> wgethttp://www.djangoproject.com/download/1.0/tarball/
> tar zxvf Django-1.0.tar.gz
> cd Django-1.0
> python setup.py install
> cd /tmp
> wgethttp://effbot.org/downloads/Imaging-1.1.6.tar.gz
> cd Imaging-1.1.6
> python setup.py install
> cd /usr/share/reviewboard
> cp settings_local.py.tmpl settings_local.py
> vi settings_local.py
>
> Change configuration :
> DATABASE_ENGINE = 'sqlite3'
> DATABASE_NAME = 'reviewboard.sqlite'
>
> save / exit file
>
> ./manage.py syncdb
> reply yes and add an admin account
> You can now test your installation this ./manage.py runserver and accesshttp://YOUR_SERVER:8000

Daniel Wexler

unread,
Sep 17, 2008, 2:12:10 PM9/17/08
to reviewboard
Aha! That's the ticket. Thanks!

Specifically, I had to change the DATABASE_NAME value in
settings_local.py to the absolute path to my sqlite database: "C:/
reviewboard/reviewboard.sqlite"

Now Apache is working for me! W00t!

Thanks everyone!

Guillaume Dufrêne

unread,
Sep 18, 2008, 2:45:44 AM9/18/08
to revie...@googlegroups.com
Yes, good news, it also work for me ! :-D
Documentation should be completed to underline that point !
I know it is specific to sqlite DB configuration but still ...

I think I will also take a look at post-review configuration.
It's Funny to see that Daniel fallow the same track ;-)

--
Guillaume.

Christian Hammond

unread,
Sep 18, 2008, 4:47:13 AM9/18/08
to revie...@googlegroups.com
I'm glad you guys got this working. I'll update the FAQ to include this information.

Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.
Reply all
Reply to author
Forward
0 new messages