Installing from deb package ezpublish-src 2.2.7-2

|

Ez Publish source is packaged for debian. So I will download the source using apt and see how installing it goes from there. The version of the package at the time I installed it was ezpublish-src 2.2.7-2.
Download is : 2941 kb

To install Ez Publish:

# apt-get install ezpublish-src
$ cd /usr/share/doc/ezpublish-src/
$ less README.Debian

This file describes the instructions for installing Ez Publish in Debian.

1) Copy /usr/share/doc/ezpublish/examples/localezcreate to
/usr/local/sbin and edit as needed for your environment.

I just left this file as it is. However as the script will run with www-data as the default user I changed the ownership and permissions of /var/www to allow www-data to write to this file.

# chown www-data.www-data /var/www
# chmod -R 775 /var/www

2) Create the directory /etc/apache/vhosts.d if it doesn't exist already.

# cd /etc/apache/
# mkdir vhosts.d
# chown www-data.www-data vhosts.d
# chmod 775 vhosts.d

3) Add this following line to the VirtualHost area of /etc/apache/httpd.conf:
   include /etc/apache/vhosts.d/

I added that line as the last line of /etc/httpd.conf and then saved the file.

4) Run localezcreate

# /usr/local/sbin/localezcreate cmsuser localhost
The script then prompts for the mysql root password, which I entered and then the cmsuser mysql password which I entered.
The script then ran through and completed with a reminder to reload the apache modules.

5) Reload Apache with `/etc/init.d/apache reload`

#/etc/init.d/apache reload

6) Add a cron job similar to the following:

0 23 * * * cd /var/www/web_ez.your.org; /usr/bin/php4 cron.php

To add the cron job I did:

# crontab -u www-data -e

This creates the file /var/spool/cron/crontabs/www-data and opens it in a text editor, in my case vim. I then added the following line

0 23 * * * cd /var/www/web_localhost.ez.localdomain.com; /usr/bin/php4 cron.php

and then saved the file.

7) Log into the admin website with user=admin, passwd=publish and change the password

Ok now this is were I found out that apache had gone crazy and I was unable to access anything through the server. What I got was

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 16896 bytes) in /var/www/web_localhost.ez.localdomain.com/ezuser/classes/ezobjectpermission.php on line 445

or something similar when I tried to access ez publish or anything else through apache. I think it is something to do with virtual hosts.
Could not figure out how the hell to get it to work using virtual hosts using only localhost as a server. Will worry about that later if we decide to go with ez_publish.

Had to come up with a work around which was basically this:

Added the following to the bottom of the /etc/apache/httpd.conf

<VirtualHost 127.0.0.1>
ServerName ez_localdomain.com
DocumentRoot /var/www/web_localhost.ez.localdomain.com
</VirtualHost>

To log into the admin page I had to type ez_localdomain.com/index_admin.php into the browser and then log in as admin using the password publish.

You will notice that you get a lot of messages about the language not working. The final step in the install is to fix that.

$sudo cp /usr/src/lang/en_GB.tar.gz /var/www/web_localhost.ez.localdomain.com/
$sudo tar zxvf en_GB.tar.gz

Then if you reload the page in your browser everything should be fine.

Unfortunatlely it wasn't.

I had a big problem with a memory failure error when I tried to load the home page and some of the admin options. This was solved by editing /etc/php4/apache/php.ini and increasing the amount of memory allowed for an individual script from 8M to 15M which might have been overkill (someone suggested 10M as a solution). Changed the line

memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

to

memory_limit = 15M ; Maximum amount of memory a script may consume (8MB)

Unfortunately with this approach the admin section works in Ez Publish but the path to a whole lot of links off the front page are broken.
So going back to /etc/apache/httpd.conf I commented out the 4 virtualhost lines I had added and uncommented the original Include /etc/apache/vhosts.d/ restarted apache and then found that the links off the front page were all working fine. However a new problem had emerged - none of the other sites that I had running out of apache now worked. They all just take me to the front page of Ez Publish. When I restarted apache I got this error message

[Tue Nov 12 16:12:05 2002] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Nov 12 16:12:05 2002] [warn] _default_ VirtualHost overlap on port 80, the first has precedence

Ok I fixed this by setting up virtual hosts properly in apache.
To do that I had to add the lines

NameVirtualHost *
<VirtualHost *>
ServerName www.apc-aa-lo.com
DocumentRoot /home/john/httpd/html/apc-aa/admin/
</VirtualHost>

The next step was to edit the /etc/hosts file and point the domains to the local ipaddress 127.0.0.1. So the first line of hosts now looks like this

127.0.0.1 localhost.localdomain.com localhost debian.localdomain.com debian www.apc-aa-lo.com localhost.ez.com admin.localhost.ez.com

Note that I didn't actually have to add www.apc-aa.com as the previous entries in /etc/apache/httpd.conf allowed the original alias that I added for apc-aa to work and also the other alias I had added were then working properly. If I chose to set the other CMSs up as virtual hosts I would then have to enter the domains in my hosts file and point them to the local ipaddress.

Ok now I had an issue with the default config file that the Ez install had put in /etc/apache/vhosts.d/ directory. When I tried to access Ez publish using the default servername that they have in the file www.localhost.ez.localdomain.com I was taken to some this localdomain search site that looked like an ecommerce example site. It had a lot of links that didn't really take you anywhere but was actually a live site on the internet. For some reason even putting that domain in my hosts file as pointing to the 127.0.0.1 address still resulted in it connecting to this site. Obviously I need to explore the ins and outs of bind and DNS servers in greater depth.

However as quicker way of just getting Ez publish going I edited the localhost.ez.localdomain.com file that was in /etc/apache/vhosts.d/ and changed the servername to localhost.ez.com were it had been localhost.ez.localdomain.com. I then eddited the /etc/hosts file to reflect the change in domain which is what is shown in the hosts line I inserted above. I didn't worry about including the www.localhost.ez.com in the hosts file as it was not really necessary for my purposes.

I then restarted apache didn't get any error messages but rather got the following

debian:/home/john# /etc/init.d/apache restart
Reloading apache modulesProcessing config directory: /etc/apache/vhosts.d/
Processing config file: /etc/apache/vhosts.d/localhost.ez.localdomain.com

and typed localhost.ez.com into my browser and was taken to EzPublishs front page. To get to the admin page just enter admin.localhost.ez.com in the browser. Checked the other CMSs that I had running and they were all working fine.