Koozali.org: home of the SME Server

I don't understand ProxyPass

Offline Rien

  • *
  • 216
  • +0/-0
    • http://www.taurix.nl
I don't understand ProxyPass
« on: August 06, 2006, 04:48:21 PM »
Hi all,

I've installed Zope-2.8.8-final.tgz and Plone-2.5.tar.gz on my SME-7.0 server. The ID of my plonesite in Zope is "plone".

My (sub)domain-name is http://focus.demon.nl

Because Zope has its own webserver I had to start plone with:
"http://focus.demon.nl:8080/plone" therefore this site could not be seen by the outside world.

To solve that problem I used ProxyPass. I created a file called "97proxyplone" and placed it in "/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/". This file contains the following statements:

Code: [Select]
ProxyPass /plone http://mlkserver:8080/plone
ProxyPassReverse /plone http://mlkserver:8080/plone


I expanded the template with:  
Code: [Select]
"/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf".

Then I wanted to restart httpd with "service httpd graceful" but that didn't work (Why not, it worked on SME-6.0.1 ?) so I rebooted the server.

It works. From the outside world the site can be seen (http://focus.demon.nl/plone).

Now I want to make this plone-site my primary site, in other words I want that the outside world can see my plone-site by entering "http://focus.demon.nl" (without the '/plone').

How can I realize that?
Rien
(The Netherlands)......

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
I don't understand ProxyPass
« Reply #1 on: August 07, 2006, 01:45:49 AM »
That's what the Virtual Host Monster in Zope is for. Create one in the ZMI if there isn't one already there, then your ProxyPass directives should look something like this:

ProxyPass / http://localhost:9080/VirtualHostBase/http/focus.demon.nl:80/Plone/VirtualHostRoot/

ProxyPassReverse / http://localhost:9080/VirtualHostBase/http/focus.demon.nl:80/Plone/VirtualHostRoot/

Both should be on one line (I have these as a template fragment, 35Rewrite). In the above, "Plone" is the name of the Plone site, BTW, and 9080 is the port I have set Zope to listen on.

Note that

/etc/init.d/httpd-admin restart; /etc/init.d/httpd-e-smith restart

will restart httpd processes.

Des
Des Dougan

Offline mhemart

  • 2
  • +0/-0
Plone on SME server
« Reply #2 on: August 09, 2006, 01:52:10 PM »
Hi everybody,
As a completely beginner in the linux and servers world, I discovered Plone and I'm really interested in installing this system on my SME-server as a primary site. But I don't know exactly how to do.
If you installed Plone successfully, do you think you could write an HowTo for Newbies like me ? I know I have to compile Zope and Plone but it begins hard for me 'cause I don't know how to install dev tools. I think reading this topic should help me.

Thanks for your help !

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
I don't understand ProxyPass
« Reply #3 on: August 09, 2006, 05:35:30 PM »
You do not need to compile either Zope or Plone.

This draft procedure was written by John Hobbs, with some minor assistance from me:

*Setup the karan.org Yum Repository*

Use the instructions found here
http://no.longer.valid/phpwiki/index.php/3rdPartyYumRepositories
to add the  kbs-centos-extras repository  (which is where Zope and Plone are).

*Install Using Yum*

*login as root*

# yum --enablerepo=base --enablerepo=extras --enablerepo=kbs-centos-extras install plone

*The above should all on one line*

*Perform Initial Setup*

# /var/lib/zope/bin/runzope
(This sets Zope up in /usr/lib/zope.)

Create the directory /opt/plone2 and change its ownership to zope/shared

Then create a Zope instance to run Plone:

# chsh -s /bin/bash zope (to enable the zope user to get a prompt)

# su - zope

# /usr/lib/zope/bin/mkzopeinstance.py

# exit

In response to the questions, set Instance Home to ‘/opt/plone2/main’
and assign an initial user id and password (e.g., ‘plone’ and ‘plone’).

[The makezopeinstance.py may hang after a kupu icon message is
displayed. If this occurs, *ctl-c* to get out and then *exit* to get
back to root. This happened for John, but mine ran OK.]

*Edit zope.conf*
Get to /opt/plone2/main/etc and edit the file zope.conf in the
appropriate spots with the following:

ip-address 127.0.0.1

port-base 1000

and save the file.

*Start Zope*

# /opt/plone2/main/bin/zopectl start


and test to ensure you get an appropriate response...

# lynx “http://localhost:9080/manage”

You should get challenged for userid and password. Exit Lynx.

*Setup Initial Plone Site*

Open a ssh tunnel with the target server to port 9080.

Then:

Open a web browser with the address ‘127.0.0.1:9080/manage’

On the upper right of the Zope main page, select “Plone Site” from the
Add pull-down list and push the Add button. In the form that opens,
enter an id (e.g. ‘mainsite’); add a Title (e.g., ‘Main Company Site’);
and provide a Description (e.g., ‘The Company internet site.’) Then
click Add Plone Site and wait for the site to be created.

Close the browser and the ssh tunnel.

*Setup Apache virtual host routing to the VHM*

Set up an appropriate re-write rule in Apache using a custom template as
was done for the prior version. This Zope has a VHM active by default.

======================================

This procedure needs some additional tidying up - John and I have been emailing back and forth over the last little while. That said, this should get you up and running.

Good luck.

Des
Des Dougan

Offline mhemart

  • 2
  • +0/-0
Thank you very much !
« Reply #4 on: August 11, 2006, 09:35:04 AM »
Hi,
I'm sorry for my late answer but I wanted to thank you for this little help. I gonna try to install it when I'll have time working on my server.
First, I will try to make it functional before trying to use rewrite rules for Apache.
Thanks

Offline NickCritten

  • *
  • 245
  • +0/-0
I don't understand ProxyPass
« Reply #5 on: August 11, 2006, 12:32:32 PM »
Hi All,

The Correct method of restarting those services on SME is:

Code: [Select]
/etc/rc7.d/S86httpd-e-smith restart
/etc/rc7.d/S86httpd-admin


(I had my wrists slapped on this matter recently) :-)
...
Nick

"No good deed goes unpunished." :-x...

Offline raem

  • *
  • 3,972
  • +4/-0
I don't understand ProxyPass
« Reply #6 on: August 11, 2006, 12:49:13 PM »
NickCritten

> The Correct method of restarting those services on SME is:
> /etc/rc7.d/S86httpd-e-smith restart
> /etc/rc7.d/S86httpd-admin restart

Aren't the above commands, as well as,
/etc/init.d/httpd-e-smith restart
/etc/init.d/httpd-admin restart

all links to
/etc/rc.d/init.d/httpd-e-smith restart
/etc/rc.d/init.d/httpd-admin restart

So it's all the same thing whichever command you use ?
...

Offline NickCritten

  • *
  • 245
  • +0/-0
I don't understand ProxyPass
« Reply #7 on: August 11, 2006, 01:06:22 PM »
Using the /etc/rc.d/init.d/ scripts will sometimes bomb out with:

Code: [Select]
[root@dlhygt1 ssl.crt]#  /etc/rc.d/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]


Please see http://forums.contribs.org/index.php?topic=30370.0 (Scroll to the bottom) for an In-Depth discussion on the matter (My Wrists still hurt...)


--edit--
i just noticed that you specified the service as httpd-e-smith & httpd-admin... the problems arise when trying to restart just httpd...

Never mind ;-)
...
Nick

"No good deed goes unpunished." :-x...

Offline raem

  • *
  • 3,972
  • +4/-0
I don't understand ProxyPass
« Reply #8 on: August 11, 2006, 01:46:46 PM »
NickCritten

> i just noticed that you specified the service as httpd-e-smith & httpd-admin... the problems arise when trying to restart just httpd

As Charlie said in
http://forums.contribs.org/index.php?topic=30370.0

curlynostril wrote:
[root@dlhygt1 ssl.crt]# /etc/rc.d/init.d/httpd restart  
That's an inappropriate command to run on an SME server. Use:
/etc/rc7.d/S86httpd-e-smith restart
...

Offline NickCritten

  • *
  • 245
  • +0/-0
I don't understand ProxyPass
« Reply #9 on: August 11, 2006, 01:51:12 PM »
Sorry Ray I've lost you..

What do you mean?
...
Nick

"No good deed goes unpunished." :-x...

Offline raem

  • *
  • 3,972
  • +4/-0
I don't understand ProxyPass
« Reply #10 on: August 11, 2006, 02:15:22 PM »
NickCritten

> What do you mean?

You don't do a .....httpd restart,
you do a
......httpd-e-smith restart
...

Offline NickCritten

  • *
  • 245
  • +0/-0
I don't understand ProxyPass
« Reply #11 on: August 11, 2006, 02:20:50 PM »
er. Yeah, I know - hense the edit!

LOL

I misread the original post by ddougan, thinking HE had put just http, instead of httpd-admin etc

Never Mind. heheh
...
Nick

"No good deed goes unpunished." :-x...

Offline raem

  • *
  • 3,972
  • +4/-0
I don't understand ProxyPass
« Reply #12 on: August 11, 2006, 02:40:23 PM »
NickCritten

Regarding
http://forums.contribs.org/index.php?topic=30370.0

and the use of various commands.
The
service "something"
command was long ago deprecated, perhaps 2 or 3 or even 4 sme releases ago it was not appropriate to use on sme server although people still used it on other Linux releases.
In sme6 the use of
/etc/init.d/"something"
was & is still appropriate
Charlie & Gordon have advised me that on many occasions.

I have not fully absorbed the use of commands like  
/etc/rc7.d/S86something restart
in sme7, but I'm sure Charlie's mindset has been in sme7 for nearly 2 years now (since development started), so perhaps he has forgotten that sme6 and valid commands like
/etc/init.d/"something"
even exist.

I couldn't see specific reference in the dev guide to the need to use commands of the form
/etc/rc7.d/S86something restart
but I certainly don't dispute Charlies advice to do so.
...