
Here is what you need to do to install Campsite:
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
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:
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: ![]()
The upgrade will be performed automatically when you make the first
request to the publication site or to the Campsite admin interface.
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.
To install Campsite under the Plesk control panel, follow the instructions in this wiki:
http://wiki.sourcefabric.org/display/CS/Install+Campsite+Under+Plesk
This article will explain how to configure apache over an encrypted SSL connection.
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.
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
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.
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].
Edit the Campsite virtual host file.
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.
Edit the first virtual host definition and replace the existing <VirtualHost [...]> tag with:
<VirtualHost [my_IP_addresss]:80>
Edit the second virtual host definition and replace the existing <VirtualHost [...]> tag with:
<VirtualHost [my_IP_address]:443>
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
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>
In this section you can search for issues or bugs we know about in order to find out how to fix them.
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);
<?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.
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: