Comment 21 for bug 346788

Revision history for this message
spartan.the (spartan-the) wrote :

Thanks everybody for helping to solve problem!

I installed Ubuntu 9.04 on Amd64 box, installed apache2 using Synaptic package manager. I didn't find rapache installed as it was described in youtube video describing how to install apache2 on Ubuntu 8.04. That was not a big issue and I installed rapache using Synaptic again. But rapache could do any read-only operation (display config and log files) but not write operation. It froze any time I tried to save any changes (not only creating a new virtual host). Seems the problem is due to "smart root account" in Ubuntu (similar implemented in Windows Vista) asking for password every time you want to do an administrative task.

So here are step by step instructions to fix a problem for newbees like me.

1. Make sure rapache version is 0.7 (rapache about box)

2. Check file we need to fix is there using Nautilus (aka Places, aka File explorer):

3. Open for editing using "Text editor" (gedit)

4. Goto line 80 and add new lines as TAC one described:

After lines:
    def __init__(self, *args, **kwargs):
        super (MainWindow, self).__init__ (*args, **kwargs)
        Master.register(self)

and before lines
        self.denormalized_virtual_hosts = {}
        self.plugin_manager = PluginManager()
        self.apache = Apache2()

insert lines:
        # HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
        if not Shell.command.ask_password(): sys.exit(1)
        # HACK END

NB! Carefully add 8 spaces before new lines because proper identationis important to Python.

5. Save file. Not so easy again: Ubuntu will prevent you from overriding "system file".
Select File | Save As...
Save in your Documents folder

6. Replace original file with modified one making a backup of original file in your Documents folder:
In terminal type following commands:
cd ~/Documents
sudo bash
{enter password}
cp /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py ./RapacheGui.py.original
cp ./RapacheGui.py /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py

The End.