Have your Plone website running with Zope and Apache on your Linux server!

Apr 6, 2007 10:45 GMT  ·  By

Plone is a ready-to-run content management system that is built on the powerful and free Zope application server. Plone is easy to set up, extremely flexible, and provides you with a system for managing web content that is ideal for project groups, communities, web sites, extranets and intranets. Although Zope is totally capable of acting as a standalone server, we'll use Apache and its URL rewrite mod for more flexibility and power.

Assuming: - you already have a domain name (or at least a subdomain) configured - port 80 is allowed through firewall or is forwarded properly - you have root access on the machine, open a terminal, switch to user root and type:

code
$ su -
(Enter root passwd)

# yum install zope plone httpd
.. to begin Zope installation.

During this guide, I'll use localhost as the example domain. You must replace localhost with your real domain (eg. mysite.com) everywhere you see it.

After yum has finished installing the packages, open Apache's configuration file using a text editor:

code
# nano /etc/httpd/conf/httpd.conf
go to the end of the file and add the following configuration sections (remember to replace localhost):
code
NameVirtualHost *:80

ServerName localhost
ServerAlias www.localhost
ServerAdmin root@localhost
DocumentRoot "/var/www/localhost"
CustomLog "logs/example-com_log" combined
ErrorLog "logs/example-com-error_log"
RewriteEngine On
RewriteRule ^/zope/(.*) http://127.0.0.1:8080/VirtualHostBase/http/localhost:80/VirtualHostRoot/_vh_zope/$1 [P,L]

RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/localhost:80/localhost/VirtualHostRoot/$1 [P,L]

CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
Next, create two temporary accounts. These will be used only through the Zope configuration so don't use the account name you want to manage Zope with from now on. Create first account:
code
# zopectl adduser dummy1 passwd1
Create the second account and use the details beneath:
code
# cd /var/lib/zope
# /usr/lib/zope/bin/zpasswd.py access

Username: dummy2
Password: passwd2
Verify password: passwd2
Encoding: SHA
Domain restrictions: (none, just press Enter)
Disable SELinux if you haven't already. Open /etc/selinux/config in a text editor and set the SELINUX= directive to disabled:
code
SELINUX=disabled
Set Zope and Apache to start automatically at boot:
code
chkconfig zope on
chkconfig httpd on
Reboot. (You can, of course, use command service zope/httpd start to start them but you really need a reboot if you have modified the SELinux configuration)

Once restarted, open your browser and point it to http://localhost/zope/manage. When asked for login credentials, enter the second account details. DON'T choose to remember password!

Review image

Find the acl_users item, check it and click the Delete button at the bottom.

Review image

From the drop-down menu in the upper-right part of the window, select Group User Folder and if you don't get redirected to the new page, click Add.

Review image

In the new page, click the acl_users item. You will be redirected to the users management section. Here, click the Groups tab and enter the new group name.

Review image

Now check the new group name, check Manager and Owner from the Affect roles section and click Change.

Review image

Click on Users tab at the top and enter the username and password you want to use for Zope management.

Review image

Check the new user created, then check the group created earlier from the Affect groups section and click Change.

Review image

You can now remove the second dummy account (first got deleted with acl_users) and restart Zope to make sure everything is applied. To do this, open a root terminal and type:

code
# cd /var/lib/zope
# rm -rf access
# service zope restart
Close the browser used earlier and open a new one. Point it again to the http://localhost/zope/manage address. Now, from the drop-down menu in the upper-right part of the window, select Plone Site and if nothing happens, click the Add button.

Review image

From the new page, enter localhost as the ID and whatever you want for Title and Description. Then click Add Plone Site.

Review image

Your Plone installation is now ready. You can start to use it by pointing your browser to http://localhost/. Click the join button to create a new account.

Review image

For more information and documentation about using Plone, read The Definitive Guide to Plone PDF book.