2

I have a Plone site called example.com located at /var/www/Plone (I think). I have the following settings for the site located in sites-available for vhosts (excerpt):

<VirtualHost 10.0.1.4:8082>
    ServerAdmin webmaster@localhost
        ServerName wiedhas.noip.me
    DocumentRoot /var/www/Plone

When I try to reach my site wiedhas.noip.me, apache loads the Plone directory tree and not my Plone site. I can browse through the file system of /var/www/Plone but it is not loading the site. I must not have set the documentroot to the correct directory of my site? Any help much appreciated.

nyzm
  • 2,787
  • 3
  • 24
  • 30
wiedhas
  • 35
  • 7

3 Answers3

4

This an excellent docu about running plone behind apache and more. http://docs.plone.org/manage/deploying/front-end/apache.html

A simple example with ssl, how a vhost could look like:

<VirtualHost $IP:80>

        ServerName my.domain.com

        Redirect / https://my.domain.com

</VirtualHost>

<VirtualHost $IP:443>

        ServerName my.domain.com

        ErrorLog logs/my.domain.com-http-error.log
        CustomLog logs/my.domain.com-http-access.log combined

        Include vhosts.d/....ssl.inc

        RewriteEngine On

        RewriteRule ^/(.*) http://127.0.0.1:$PORT_OF_PLONE/VirtualHostBase/https/%{SERVER_NAME}:%{SERVER_PORT}/zodb/path/top/plone/VirtualHostRoot/$1 [P,L]

</VirtualHost>

The most important part is the rewrite rule:

        RewriteRule ^/(.*) http://127.0.0.1:$PORT_OF_PLONE/VirtualHostBase/https/%{SERVER_NAME}:%{SERVER_PORT}/zodb/path/top/plone/VirtualHostRoot/$1 [P,L]

$PORT_OF_PLONE = Port of your running plone instance

/zodb/path/top/plone = That's where you added the plone site in zope.

Mathias
  • 6,777
  • 2
  • 20
  • 32
0

Took me a while to get mine going so maybe this helps:

My vhosts looks like this (where my plone site is called 'mywebsite'):

#---------------------------------
#     www.mywebsite.com
#---------------------------------
<VirtualHost *:80>
        ServerName      www.mywebsite.com
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteRule ^/(.*)$ http://127.0.0.1:8081/VirtualHostBase/http/%{SERVER_NAME}:80/mywebsite/VirtualHostRoot/$1 [L,P]
        </IfModule>
</VirtualHost>

Hope that helps :)

Aaron Williams
  • 655
  • 4
  • 11
0

As you see in the first and correct answer you do not need DocumentRoot. DocumentRoot points to a directory with files to render by Apache. But Plone brings it's own server, the Zope application server, which runs on a different port than Apache. The RewriteRule redirects the incoming request to the application server and modifies the response in a way that the redirection is hidden for the client.

pabo
  • 808
  • 7
  • 14
  • I have rewritten the rewrite as such: RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/https/%{SERVER_NAME}:%{SERVER_PORT}/Test/VirtualHostRoot/$1 [P,L] My Plone site is called Test and the directory where Plone is installed is /home/username/Plone. When I goto my site wiedhas.noip.me all I get is "the requested URL / was not found. So I am not setting the location of my Plone site correctly. Any ideas? localhost:880/Test works locally. – wiedhas Jul 02 '14 at 02:30
  • sorry I meant I can reach my site at localhost:8080/Test but not through wiedhas.noip.me which is listening on port 80. – wiedhas Jul 02 '14 at 03:02