English فارسی Suomi
Français Nederlands Translate

Campsite 3.4

Campsite: InstallationSteps

Installation Steps

In this chapter:
  • Downloading Campsite
  • Configuring Apache
  • Setup your php.ini file
  • Upgrading
  • Advanced/non-standard installation
  • Troubleshooting

Here is what you need to do to install Campsite:

  1. Configure apache: create an apache virtual host (optional)
  2. Setup your php.ini file
  3. Copy the Campsite package to a directory on your server.
  4. Unarchive it using the command: tar xzvf <Campsite_source>.
  5. Enter Campsite directory:  "cd campsite".
  6. Copy the content of implementation/site directory into the document root directory of the apache virtual host.
  7. Start a browser, point it to the httpSiteName.PNG URL and follow the steps.

Downloading Campsite

The easiest way to download Campsite is to go to our Sourceforge page and download the files direct from there.

Configuring Apache

Create an apache virtual host or use the default apache virtual host. You may skip this step if you wanted to use the apache default host (localhost). Campsite does not work in subdirectories. So you can not work with a local URL like http://localhost/campsite/ - if this is what you want to do, read the hosts part beyond the apache configuration.

Example of virtual host configuration:

<VirtualHost *>
    DocumentRoot /var/www/campsite

    ServerName [site_name]
    ServerAlias [site_alias]
    DirectoryIndex index.php index.html
    <Directory /var/www/campsite>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride All
            <IfModule mod_access>
                Order allow,deny
                Allow from all
            </IfModule>
    </Directory>
</VirtualHost>

After you create a virtual host do not forget to restart apache.

Enabling the rewrite module under Ubuntu

If you are working on Ubuntu, trying to add the RewriteModule into the apache configuration might create the following error:

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

In which case you need to enable mod_rewrite. Do this by opening a terminal and type:

sudo a2enmod rewrite

You will see in the terminal: Enabling module rewrite. Run '/etc/init.d/apache2 restart' to activate new configuration!

Working on localhost: changing hosts file

If you installed campsite locally, e.g. http://localhost/campsite/, you need to change the hosts file ( sudo vim /etc/hosts ) and duplicate the line which says localhost, adding your [site_name] from the apache conf (see above) there. If you used "campsite" as the [site_name], your hosts file might start like this (Ubuntu 9.10 example):

127.0.0.1       localhost
127.0.0.1       campsite
# The following lines are desirable for IPv6 capable hosts

 Now you can point your browser to http://campsite

Setup your php.ini file

You will need to adjust values in your php.ini file in order for Campsite to work properly. ⁞ On Debian and Ubuntu systems, your "php.ini" file is usually located in "/etc/php5/apache2" directory.

The following directives show what the values should be for each variable in the php.ini file.

Always turn off register_globals because it's a big security hole:
register_globals = Off

Find the "memory_limit" directive and set the amount of memory to at least 32MB:
memory_limit = 32M   

Set maximum size of POST data that PHP will accept to a hig value:
post_max_size = 100M 

Turn off magic quotes:
magic_quotes_gpc = Off

Allow HTTP file uploads:
file_uploads = On

Set the maximum allowed size for uploaded files to a large value so you will be able to upload large attachments:
upload_max_filesize = 100M

Make sure the following extensions are enabled (they are enabled as long the line appears in the php.ini file, and the line does not start with a semi-colon (';')):
extension=gd.so
extension=mysqli.so
extension=mysql.so

 

Upgrading

In this section:
  • Compatibility Issues

Upgrading from versions 1.x, 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x and
2.5.x is not supported anymore. You will have to upgrade first to
Campsite 2.6 or 2.7 and then follow the regular procedure.

Upgrading from Campsite 2.6.x and 2.7.x versions:
Repeat the following steps for each instance:

  1. Backup the instance using campsite-backup-instance
  2. Perform a new Campsite 3.3 install
  3. Run the restore backup script from the admin interface

Read INSTALL file and follow the steps; read on Compatibility issues.

Upgrading from Campsite 3.0.x, 3.1.x and 3.2.x:

Drop the new sources over the existing install, open a browser
and make a request for the publication home page: site_1a.png
The upgrade will be performed automatically when you make the first
request to the publication site or to the Campsite admin interface.

 

Compatibility Issues

Since version 3.0 Campsite doesn't support multiple instances anymore. You will have to perform one install for each Campsite instance. However, the install procedure was greatly simplified.

In version 3.0 the template language as modified extensively. The backup restore script will provide an automated conversion of the old template files to the new format. For more details on language changes please read the chapter "Template Language Version 3.0".

The 3.3 template language is fully backward compatible with versions 3.2, 3.1 and 3.0. The 3.3 version only brings additions to the language.

 

Advanced/non-standard installation

In this section:
  • Installing Campsite under Plesk
  • Configuring Campsite to Work Over SSL

 

Installing Campsite under Plesk

To install Campsite under the Plesk control panel, follow the instructions in this wiki:

http://wiki.sourcefabric.org/display/CS/Install+Campsite+Under+Plesk


Configuring Campsite to Work Over SSL

This article will explain how to configure apache over an encrypted SSL connection.

  1. Allocate a separate IP address for each Campsite installation you want to run over SSL. You will have to set this IP address to one of your server network interfaces. We don't provide detailed information about network interface configuration process here because it's outside the scope of Campsite. Read 'ifconfig' manual page for more details, search for configuring network interfaces on linux on Google or try this link: http://www.faqs.org/docs/linux_network/x-087-2-iface.html. We will refer to this IP address as [my_IP_address] in the following steps.

  2. Locate the Listen directive in the main apache configuration file and add the following new lines after it if they did not exist already:

    Listen 80

    Listen 443

  3. Locate the NameVirtualHost directive in the main apache configuration file and add the following new lines after it:

    NameVirtualHost [my_IP_address]:80

    NameVirtualHost [my_IP_address]:443

    In case there are duplicate NameVirtualHost directives remove the duplicates.

  4. Generate certificate and key for the SSL virtual host. We don't provide detailed information about this process here because it's outside the scope of Campsite. Read http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html for details. If your apache has SSL module loaded you can skip to: About Configuration and About Certificates. This step will generate at least two files: certificate file, referred here as [certificate_file] and certificate key file, referred here as [certificate_key_file]. Install these two files into your apache certificates directory, referred here as [certificates_directory].

  5. Edit the Campsite virtual host file.

  6. Duplicate the virtual host definition in this file: copy the whole section in between <VirtualHost [...]> and </VirtualHost>, including these tags and paste it at the end of the file.

  7. Edit the first virtual host definition and replace the existing <VirtualHost [...]> tag with:

    <VirtualHost [my_IP_addresss]:80>

  8. Edit the second virtual host definition and replace the existing <VirtualHost [...]> tag with:

    <VirtualHost [my_IP_address]:443>

  9. Edit the second virtual host definition and add the following lines into your virtual host definition:

    SSLEngine on

    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP

    SSLCertificateFile [certificates_directory]/[certificate_file]

    SSLCertificateKeyFile [certificates_directory]/[certificate_key_file]

Note: When generating the SSL certificate at step 4 make sure you enter the FQDN ("Fully Qualified Domain Name") of the server when OpenSSL prompts you for the "CommonName", i.e. when you generate a CSR for a website which will be later accessed via foodom.png enter "www.foo.dom" here. The FQDN you supply as CommonName must be the same as the value of ServerName in the Campsite instance virtual host.

The following is an example of a fully configured Campsite instance:

- main apache configuration file:

Listen 80
Listen 443
NameVirtualHost 192.168.2.101:80
NameVirtualHost 192.168.2.101:443

- Campsite instance virtual host configuration file:

<VirtualHost 192.168.2.101:80>
	DocumentRoot /var/www/campsite
	ServerName www.mydomain.org
	DirectoryIndex index.php index.html

	<Directory /var/www/campsite>
		Options -Indexes FollowSymLinks MultiView
		AllowOverride All
		<IfModule mod_access>
			Order allow,deny
			Allow from all
		</IfModule>
	</Directory>
</VirtualHost>
<VirtualHost 192.168.2.101:443>
	DocumentRoot /var/www/campsite
	ServerName www.mydomain.org
	DirectoryIndex index.php index.html

	<Directory /var/www/campsite>
		Options -Indexes FollowSymLinks MultiViews
		AllowOverride All
		<IfModule mod_access>
			Order allow,deny
			Allow from all
		</IfModule>
	</Directory>

	SSLEngine on
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
	SSLCertificateFile /etc/apache2/ssl/server.crt
	SSLCertificateKeyFile /etc/apache2/ssl/server.pem
</VirtualHost>

 

Troubleshooting

In this section you can search for issues or bugs we know about in order to find out how to fix them.

Error creating users: "The user account could not be created"

Since version 2.7 Campsite uses the LiveUser authentication/authorization toolkit. Unfortunately this toolkit has some bugs that may leave the database in an inconsistent state, which will result in the error message "The user account could not be created" being displayed when trying to create a new user. In order to fix the database corruption run the following SQL script against the Campsite database:

DELETE FROM pu
    USING phorum_users AS pu
        LEFT JOIN liveuser_users AS lu ON pu.fk_campsite_user_id = lu.Id
    WHERE lu.Id IS NULL;
DELETE FROM lur
    USING liveuser_userrights AS lur
        LEFT JOIN liveuser_users AS lu ON lur.perm_user_id = lu.Id
    WHERE lu.Id IS NULL;
DELETE FROM lpu
    USING liveuser_perm_users AS lpu
        LEFT JOIN liveuser_users AS lu ON lpu.perm_user_id = lu.Id
    WHERE lu.Id IS NULL;
UPDATE liveuser_users_auth_user_id_seq
  SET id = (SELECT MAX(Id) FROM liveuser_users);
UPDATE liveuser_perm_users_perm_user_id_seq
    SET id = (SELECT MAX(perm_user_id) FROM liveuser_perm_users);

 

"Unable to create the database [db_name]" error message when installing Campsite

Please create a PHP script with the following script, run it and check the error messages:
<?php $dbName = 'my_test'; $dbConn = mysql_connect("localhost", "root", ""); if (!$dbConn) {     echo "Can not connect to MySQL with root user and no password.\n";     echo "ERROR: " . mysql_error($dbConn) . "\n";     exit(1); } $res = mysql_query("CREATE DATABASE `$dbName` CHARACTER SET utf8 COLLATE utf8_bin"); if (!$res) {     echo "Can not create a database. Please verify if you had the privilege "        . "to create a database.\n";     echo "ERROR: " . mysql_error($dbConn) . "\n";     exit(1); } echo "Created database '$dbName'.\n"; ?>

Please make sure you have MySQL 5.0 or newer running, Campsite does not work on older versions.

Another reason could be that the root user may not have the privilege to create a database if connected through a TCP/IP socket. I know it sounds weird but I know a user of Campsite encountered this problem.

Write rights for the apache user

If you get an error like this, you need to change the access rights:

Notice: Campsite error: unable to write to $compile_dir '/var/www/campsite/templates_c'. Be sure $compile_dir is writable by the web server user. in /var/www/campsite/install/classes/CampTemplate.php on line 89

The installer

sets this up automatically in most cases, but in some cases, you will need that the apache user needs write permissions for the following Campsite folders:

  • document root (e.g. /var/vhosts/httpdocs)
  • backup (/path/to/document_root/backup)
  • conf (/path/to/document_root/conf)
  • files (/path/to/document_root/files)
  • images (/path/to/document_root/images)
  • plugins (/path/to/document_root/plugins)
  • templates (/path/to/document_root/templates)
  • template_cache (/path/to/document_root/templates_cache)

 


EDIT