A bare website template using the BlueMvc framework can be downloaded directly via Composer. This template can be a good starting point for your own website and will be used in this tutorial.
Run the following command from the command prompt where /path/to/webroot is the path to your empty web root.
$ composer create-project bluemvc/bluemvc-website /path/to/webroot
The website template will now be downloaded and all required dependencies will be installed. Press Enter if prompted whether you want to remove existing VCS files.
If you have started a Vagrant instance using the Vagrantfile from the previous page, the web server is already set up and this step can be skipped.
The web server needs to set up to route all requests for non-existent files to /path/to/webroot/Public/index.php. How this is done depends on the web server used.
<VirtualHost *:80>
DocumentRoot /path/to/webroot/Public
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]
SetEnv BLUEMVC_DEBUG 1
</VirtualHost>
server {
listen 80;
root /path/to/webroot/Public;
location / {
try_files $uri /index.php;
}
location ~ \.php$ {
# Insert PHP FastCGI configuration here.
fastcgi_param BLUEMVC_DEBUG 1;
}
}
Use your browser to navigate to the url corresponding to the web server set up above. For this tutorial we will assume http://localhost/.
A page similar to this should be displayed:
Congratulations! You have now successfully installed the BlueMvc website template.
✎ Published in category get started