Koozali.org: home of the SME Server

compile mod_webkit.so

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
compile mod_webkit.so
« on: December 29, 2007, 01:35:45 AM »
I am setting up Webware for Python on SME 7.2 to replace the SME 6 rendition. This effort could use an apache module to replace the CGI. A compiled .so is not available but the source code is; here is a link to the apache mod discussion in the Webware documentation:
http://www.webwareforpython.org/WebKit/Docs/InstallGuide.html#mod-webkit

I would love to hear from anyone who has the time+setup to run the compile. I can send you the necessary files, although they are also freely available at the website.
- Mark

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: compile mod_webkit.so
« Reply #1 on: December 29, 2007, 11:27:16 AM »
I would love to hear from anyone who has the time+setup to run the compile. I can send you the necessary files, although they are also freely available at the website.
I think you might have a bit of an issue here, according to the documentation in the package there are two modules, one for the apache 1.3 tree, the other for the apache 2.2 tree. Unfortunately SME Server 7.2 is running a 2.0 tree version.

I am not sure if the 2.2 module will work in a 2.0 tree, but I am pretty sure that the 1.3 module will not work in the 2.0/2.2 tree.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: compile mod_webkit.so
« Reply #2 on: December 29, 2007, 01:06:20 PM »
Installing the module should be pretty straight forward according to the README, however that will probably not work on SME Server.

I have not tested this and there might be errors in my instructions (perhaps you'd better test this on a test machine first) but if you have a SME Server 7.2 configured you might try this:

  • Access your SME Server shell as root user
  • Install httpd-devel

    yum install httpd-devel --enablerepo=smecontribs

    As not all dependencies will be met in the basic repositories you have to enable the smecontribs repository (only available on fully up-to-date SME Server 7.2 servers (as it is provided since smeserver-yum-1.2.0-41)
  • Download a copy of the package, and extract it, if you not already did so
  • Go the direcotry that holds the mod_webkit2 files (WebKit/Adapters/mod_webkit2/)
  • Issue a

    make

    which should build the modules into the ./.libs folder (yes, strange but a hidden folder)
  • Since the apache libraries are stored in /usr/lib/httpd/modules you should copy it there:

    cp ./.libs/mod_webshare.so /usr/lib/httpd/modules

  • Now we need to make it load in the webserver, for that we need to make a template fragment in the httpd.conf template tree:

    mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
    echo LoadModule mod_webkit.so >> /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/20LoadModule80webkit


  • Now we need to regenerate the configuration file

    expand-template /etc/httpd/conf/httpd.conf

  • And restart the webserver to load the module

    sv t httpd-e-smith

  • Be sure to check if your server restarts properly

    sv s httpd-e-smith

    should output something like

    run: httpd-e-smith: (pid 27802) 174061s, normally down

    If it does not return something like that there might be something wrong with the module, you can easily revert changes by removing the custom template fragment and regenerate your configuration file (step 8 ) and reloading the server (step 9) or all together like this:

    rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/20LoadModule80webkit
    expand-template /etc/httpd/conf/httpd.conf
    sv t httpd-e-smith

    Your server should now run again, which you can check with the command of the first command in step 10 (this step)
  • If everything works perfectly you are advised to install all packages installed by the command in step 2, as a lot of packages installed might impose a security risk on your server. You can find all packages installed by looking at your /var/log/yum/yum.log file and remove them using this command

    remove package1-name package2-name

    Be sure to only answer yes if all packages listed to be removed are the same to what was installed! If any extra modules are to be removed answer no and report back here before removing packages

Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: compile mod_webkit.so
« Reply #3 on: December 29, 2007, 08:56:02 PM »
Thank you for the very complete reply. I appreciate the effort!

Quote
I am not sure if the 2.2 module will work in a 2.0 tree, but I am pretty sure that the 1.3 module will not work in the 2.0/2.2 tree.

I also appreciate your comment regarding the versions of apache; perhaps the webware list will have some insight.
- Mark

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: compile mod_webkit.so
« Reply #4 on: December 31, 2007, 02:47:53 AM »
Quote
I am not sure if the 2.2 module will work in a 2.0 tree, but I am pretty sure that the 1.3 module will not work in the 2.0/2.2 tree.

For the record, you are quite right about the v1.3 module not working with apache 2.x. The API changed significantly in apache 2.x, and 1.x modules do not work with it.

Christoph Zwerschke, one of the maintainers of Webware, wrote that the v2.2 module with work with CentOS 4, and that only the make.bat and .dll files are dependent on apache 2.2.

Gary Perez, also from the Webware list, offer a "how to" he wrote for installing Webware on CentOS. http://eringary.com/webware/

Thanks to all; I think I am ready to dive into this.
- Mark

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: compile mod_webkit.so
« Reply #5 on: December 31, 2007, 10:25:56 AM »
Gary Perez, also from the Webware list, offer a "how to" he wrote for installing Webware on CentOS. http://eringary.com/webware/

Thanks to all; I think I am ready to dive into this.
Not to be a pain in the arse, considering this howto, but starting services at boot time works a little different in SME Server than in CentOS, have a look at the relevant section of the of the SME Server Developer's Guide.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: compile mod_webkit.so
« Reply #6 on: December 31, 2007, 06:03:13 PM »
You are not being a pain because you are quite right about the boot process in SME 7 being different from CentOS. FWIW, the boot set up is on the to-do list for my project.

Thanks for the link to the page in the developer's guide. I have been there before, when I set up this particular project on SME 6, but it is worthwhile to review it again.
- Mark

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: compile mod_webkit.so
« Reply #7 on: December 31, 2007, 07:22:37 PM »
I have compiled a "how-to" for this process, blending the advice from Cactus, Gary and Christoph.

  http://www.mophilly.com/wiki/Installing_%26_Configuring_Webware_on_SME_7.2

I will add the instructions for boot process, if there is anything not covered by the SME documentation.

Thanks to Cactus for all the help.
- Mark