How do I redirect Plone to the site (solved)

This is embarrassing... I have been trying to redirect /localhost/site to /localhost without success.
I am using turnkey linux virtual appliance and have access to the webadmin (apache)... tried every setting in aliases/redirection without success (on the default site).
Then I tried doing it from zope... with the script and changing the default page oprtion... no success too.

Help ?

By default... http://localhost point to plone setup (and a link to zope). I want it to point directly to one of the site. (http://localhost/plonesite).

Thanks in advance.

Paul

1 Like

"Virtual hosting" with a frontend proxy like Apache and Nginx is widely used since 15 years and very well documented:

https://docs.plone.org/manage/deploying/front-end/index.html

-aj

@paul,
Try visiting http://localhost/plonesite/virtual_hosting/manage_main
There you will find a tab called 'mapping' which allows you to configure what you want.

1 Like

@pigeonflight ... I found that and avoid it cause right on top.. it got a warning :
"You may edit the mappings for this Virtual Host Monster using the form below. You don't need to use this tab if you are using Apache or some other front-end server to rewrite requests. This is only for simple virtual hosting in a bare Zope server. If you place the hostname that you use to manage your Zope in this list you are likely to regret it, and will probably need to manage Zope using its raw IP address to fix things."

I got apache....

@zopyx
Those are the same with these setting on webmin right ?

Seems pretty straight forward but it didn't work.

In your Apache conf you would do:

# ProxyPass         /static !

ProxyPass         /  http://localhost:8080/VirtualHostBase/http/localhost:80/plonesite/VirtualHostRoot/
ProxyPassReverse  /  http://localhost:8080/VirtualHostBase/http/localhost:80/plonesite/VirtualHostRoot/

If your Apache listens on port 80 and Plone on 8080 then http://localhost/ will take you to your plonesite root. If you are serving static content from your file system be sure to place rules before the Plone catch-all directive,

Finally... I've got it.
Ok this is for virtual appliance by turnkey linux.
File is plone.conf
Location is /etc/apache2/sites-enabled
Just add the site name as indicated (my site name is netbcu).
Restart apache.

Voila !

If you use Webmin, there is an 'apache config page'

Where you can add and edit virtual hosts.
You can also restart Apache from here.

and edit the 'directives' (the rewrite rule)

i tried that... didnt work.
only thing affect the link is that plone.conf file i posted.

A follow up question/comment on using Apache in the front end of Plone:

I tried the little plone.conf file Paul posted, and it worked like a charm! It worked at the first try!

I had tried the instructions posted here:

https://docs.plone.org/manage/deploying/front-end/apache.html

And no luck! A couple of days scratching my head and nothing.

I see Paul's little file uses a simple "rewrite" without alias or anything fancy. But it seems to work fine. The other example uses rewrite and proxy, but does not work.

What's the deal with "rewrite" vs "proxy"?

Reading Apache's docs here:

https://httpd.apache.org/docs/2.4/rewrite/proxy.html

Sounds that rewrite already is using proxy: "mod_rewrite provides the [P] flag, which allows URLs to be passed, via mod_proxy, to another server"

Just curious. I want to understand better how Plone works.

for the record, I always use the zmi virtual_hosting. Much simpler and works great.

I just looked and the only mentions of "proxy" in the Plone docs are for something else. The RewriteRule statements are the active ingredients.

When you say 'does not work', it would help to see what your config was.

http://betabug.ch/zope/witch

1 Like