Get Roadiz sources¶
Roadiz can be downloaded in two different ways:
- The Good one — using Git and Composer (needs an SSH connection to your server and Git)
- The Easy one — using a bundled Zip archive with composer dependencies.
Using Git (recommended)¶
First you will have to setup properly your server virtual host. You can either use Apache or Nginx with Roadiz. An example virtual host is provided in source-code for each server:
You just have to customize your root path and server name. Nginx has built-in support for php-fpm whereas Apache must be configured with fastcgi to do the same.
These example files will provide basic security configuration for private access folders:
files/fonts folders. They will also configure your server
to redirect all non static requests to Roadiz front-controller.
For shared hosting plan owners, if you can’t modify your virtual host definition,
don’t panic, Roadiz has a built-in CLI command to generate
.htaccess files for you.
bin/roadiz generate:htaccess after cloning Roadiz sources and running Composer.
In the other hand, if you are using Apache and have access to your virtual host,
we strongly recommend you to use our sample configuration and disable
performances are at their best without them.
When your HTTP server is ready to go, download Roadiz latest version using Git:
cd your/webroot/folder; git clone [email protected]:roadiz/roadiz.git ./;
Use Composer to download Roadiz dependencies
and to build PHP class autolader. We even set up some post-scripts which will copy
install.php files for you.
# Install Roadiz dependencies, prepare a fresh config file and your # own dev and install entry points. composer install --no-dev -o;
When your virtual host is ready and every files have been downloaded you can go to the next part to access the install environment.
The quick and dirty way: using a Zip archive¶
This method must be used if you have to work on your own computer with softwares like MAMP, WAMP or if you need to setup your website on a shared hosting plan without any SSH or Git.
If you downloaded Roadiz on the Github release page or
directly from our website, you should get a bundled Zip containing every
Roadiz files and Composer dependencies. We even generated
.htaccess files and a
conf/config.yml file for you.
If you can unzip directly on your server, that is cool. It will save you time, if not, just unzip it on your desktop and upload files to your server via FTP.
When you transfer your Roadiz site via FTP make sure
.htaccess files are copied into each important
./files/fonts, etc). If you are using an Apache setup, this will prevent
unwanted access to important files.
Once you unzipped and moved your Roadiz files into your webserver folder, just launch the Install
tool with your Internet browser by typing your new website address. If you are working on your own computer
with MAMP, WAMP or other easy-server tool, just type
http://localhost:8888/roadiz-folder in your browser (the port may change
according to your server settings).
You have to understand that using Zip archive way with FTP transfers will make updating Roadiz harder.
If you have a dedicated server or a VPS, we highly recommend you to use Git and Composer to install Roadiz. That way,
you will be able to upgrade Roadiz just by typing
git pull origin master.
Dealing with Roadiz environments¶
Once you’ve succedded to download Roadiz sources and dependencies. You’ll have to setup its database and every informations needed to begin your website.
As every Symfony applications do, Roadiz works using environments. By default, there is a production
environment which is handled by
index.php entry point. At this moment, if you try to connect to
your fresh new Roadiz website, you will get an error as we did not install its database and its essential data.
To be able to use Roadiz install interface, you’ll need to call the install entry point. An
install.php file has been generated when you executed
composer install command. This environment will be reachable at the Url
For security reasons, we added an IP filtering in this entry point, you can add your own IP address in the following array:
array('127.0.0.1', 'fe80::1', '::1'). This IP filtering is very important if you are working on a public server, no one except you should be able to access install entry point.
At the end of the install process, you will be invited to remove the
install.php file and to connect to your
website final URL.
Roadiz production environment is not made for developing your own themes and extending back-office features.
As the same way as install environment, we prepared a dev environment to disable resources caching and enable
debug features. You’ll find a
dev.php file at your website root which was generated at
composer install command.
As well as install.php entry point, you’ll need to add your own IP address to filter who can access to your dev environment.
The preview environment is not a real one as it only adds a flag to Roadiz’ Kernel to enable
back-office users to see unpublished nodes. By default, it is available using
entry point, unless you decide to remove it.
This is the default
index.php entry point which will be called by all your visitors.
There is no restriction on it and it will wake up Roadiz application using the strongest
caching policies. So it’s not recommended for development usage (you would have to flush caches
each time your change something in the code).
Clear cache environment¶
The clear_cache environment is only meant to empty Roadiz cache without waking up
the whole application. It can be useful if you are using a op-code cache like APC or
native PHP OPcache. These special caches can’t be purged from command line utilities,
so you need to call a PHP script from your browser or via
curl to empty them.
Like install and dev environment,
clear_cache.php is IP-restricted not to
allow everyone to flush your dear caches. You’ll need to add your own IP address to filter who can access it.