Getting Started
From AuthPuppy Wiki
Contents |
Prerequisites
Prerequisite for authpuppy are a php-enabled 5.2.4 or later web server and the database of your choice. Also require php5-curl for plugins management.
Make sure you have mod_rewrite enabled on your apache server:
$> sudo a2enmod rewrite
The symfony framework used by the applications has its own prerequisites. To check symfony's prerequisites, download the following file check_configuration.php and run it on your apache server. Make sure you have all the mandatory requirements before installing Authpuppy.
Getting the code
Get the latest release from http://launchpad.net/authpuppy. Then, extract the files in you web server directory
$> tar xvzf authpuppy-<version>-<stability>_<packaging>.tgz $> sudo mv authpuppy /var/www/
You can also download the source from version control with the following command
bzr branch lp:authpuppy
Configuring Apache
Authpuppy at root
The apache configuration for this project is the same as that for any symfony project. See Symfony web server configuration for more details.
Here is an example configuration file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName authpuppy.localhost
ServerAlias authpuppy.test
DocumentRoot /var/www/authpuppy/web
DirectoryIndex index.php
<Directory /var/www/authpuppy/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Alias /sf /var/www/authpuppy/lib/vendor/symfony/data/web/sf
<Directory "/var/www/authpuppy/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
ErrorLog /var/log/apache2/authpuppy/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/authpuppy/access.log combined
</VirtualHost>
Authpuppy not at root
If your authpuppy installation is not at the root of your web server like this http://myserver/myauthpuppy, use the following configuration:
<VirtualHost>
# Authpuppy
Alias /myauthpuppy/sf "/var/www/authpuppy/lib/vendor/symfony/data/web/sf"
Alias /myauthpuppy "/var/www/authpuppy/web"
<Directory "/var/www/authpuppy/web">
AllowOverride All
Allow from All
ErrorDocument 404 /myauthpuppy/default/error404
</Directory>
<Directory "/var/www/authpuppy/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
The file /var/www/authpuppy/web/.htaccess also needs to be updated
... # uncomment the following line, if you are having trouble # getting no_script_name to work RewriteBase /myauthpuppy ...
Setting directory permissions
For the application to work, some directories must be writeable by the web-server. On development server, this may be done by giving write permissions to all
chmod -R a+w <directory>
But the best way to do this on production server is to set the owner of the directory to the web server's process
chown -R www-data <directory> (provided www-data is the apache process owner, on some os, it is 'apache' or 'httpd')
Here follows a list of directories to set the permissions for. Those marked with a * MUST be writeable for the system to work, others must be writeable for automatic installation of plugins, but these steps can all be done manually:
- config* or at least config/authpuppy.yml*: because the config/authpuppy.yml contains the list of active plugins so they can be loaded at initialization time
- cache*: Used at runtime by symfony to cache functionnalities and data
- log*: The log directory
- data*: The clear cache task (needed when installing or configuring plugins) needs write access to this directory
- plugins: The directory where plugins will be installed.
- web: Plugins may have assets (images, javascript, css) to publish to the web directory, so make sure it is writeable, otherwise you'll need to do this by hand.
Creating the database
You may now create the database with your preferred engine: authpuppy is database agnostic. But it has been tested and proven to work on PostgreSQL and MySQL.
Postgresql instructions
At the command prompt execute the following instructions:
postgres@yourserver $> createuser authpuppy --pwprompt Enter password for new user: Enter it again: Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n CREATE USER postgres@yourserver $> createdb authpuppy --encoding=UTF-8 --owner=authpuppy CREATE DATABASE
Mysql instructions
at the command prompt, execute the following commands:
user@yourserver $> mysqladmin -uroot -p create authpuppy Enter password: #Enter the root password user@yourserver $> mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 45 Server version: 5.0.51a-3ubuntu5.5 (Ubuntu) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create user 'authpuppy'@'localhost' identified by 'authpuppydev'; Query OK, 0 rows affected (0.21 sec) mysql> grant all privileges on authpuppy.* to 'authpuppy'@'localhost' with grant option; Query OK, 0 rows affected (0.02 sec)
Building the database and configuring the application
You may now navigate to http://<your authpuppy server>/
If the database is not configured yet, the file will be created. A check of requirements will also automatically be made. Make sure all required requirements are met.
Follow the instructions on the screen through the installation process. If it is a first install, you'll be invited to create a first admin user for the application
Congratulations! You're now ready to go! Just click on the "Administrative Login" link to get the login prompt for the admin section and access more interesting stuff.
Now what?
The final installation page will propose a few options of what to do next: configure the server, add some new nodes or install plugins.
After pulling a branch
Applies only if you installed from source
After pulling a branch after the first install from the source files, you must clear the cache.
If you have access to command line, from the application's root directory execute
./symfony cc
Otherwise manually empty the cache/ directory.
Then you must go to the http://<your authpuppy server>/install page to migrate to the new database schema.
