Skip to content

Latest commit

 

History

History

silverstripe-debian64

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

zauberfisch/silverstripe-debian64

Debian 10 x86_64 LAMP Box with many extra features, pre-configured for SilverStripe

Default Website URL: http://127.0.0.1:8080/
Default PhpMyAdmin URL: http://127.0.0.1:8080/phpmyadmin/
Default MailHog URL: http://127.0.0.1:8025/

Installation

Currently virtualbox is the only supported provider. Support for libvirt might be added in the future.

$ vagrant init zauberfisch/silverstripe-debian64
$ vagrant up --provider virtualbox

Configuration of ports or shared folders is not necessary as it is already pre-configured.

Alternatively, you can also find this box here:

Usage

Pre-Configuration

While this box can be used for anything, it is already pre-configured for SilverStripe.
This means that a _ss_environment.php file (for SilverStripe 3) and System-wide environment variables (for SilverStripe 4) are already set and contain database and other configuration for SilverStripe.

The environment configuration also sets the default admin user to admin with the password password

Additionally, port forwarding and a shared folder are already configured making this box truly zero-configuration.
In case of a port conflict, vagrant will automatically assign different ports, for example http://127.0.0.1:2200/ (Website) && http://127.0.0.1:2201/ (MailHog), this makes it possible to have multiple boxes running at the same time.

After booting, the following folders will be created:

  • www the web-root (put your project in here)
  • logs/apache2 Will contain the apache access.log, error.log and other_vhosts_access.log files
  • logs/php Will contain the php error.log and mail.log
  • logs/silverstripe Will contain the SilverStripe error.log

Tis box is intended to be used for a single project, installing multiple SilverStripe sites is possible but will require additional configuration.

Note: DO NOT use in production, this box is intended for development and testing purpose only. Additionally, it is assumed that this box is used in a safe environment, default passwords are used and ports are open.

Installing SilverStripe

All you need to do is put your project or a freshly downloaded SilverStripe into www/ and run http://127.0.0.1:8080/dev/build?flush=1.
No Installation required because the configuration is already in place.
Just make sure you have a _config.php file that contains require_once ('conf/ConfigureFromEnv.php');.

If you still wish to run through the installer, that is still possible though.
You can then simply tick the "use environment" checkbox to have the installer automatically pick up the database configuration.

Features & Specs

  • Linux Debian 10 Buster (x86_64)

  • Apache2 Version x.x

  • MySQL-Server Version x.x
    Username: root
    Password: dont-use-in-prodction
    Default Database by SilverStripe configuration: silverstripe

    Note: the database is located inside the virtual machine and will be lost if the virtual machine is deleted

    mysql-client and mysql-dump scripts are available to easily access the database without a password.

    • CLI Client: $ vagrant ssh -c "mysql-client silverstripe"
    • Import SQL File: $ vagrant ssh -c "mysql-client silverstripe < /vagrant/dump.sql"
    • Export SQL File: $ vagrant ssh -c "mysql-dump silverstripe > /vagrant/dump.sql"
    • Empty Database: $ vagrant ssh -c "mysql-client -e 'drop database if exists silverstripe; create database silverstripe;'"

    Note: the scripts will not ask you to confirm before deleting your data

  • PostgreSQL-Server Version 12
    Username: postgres
    Password: dont-use-in-prodction

    Note: the database is located inside the virtual machine and will be lost if the virtual machine is deleted

    • CLI Client: $ vagrant ssh -c "sudo -u postgres psql silverstripe"
    • Import SQL File: $ vagrant ssh -c "sudo -u postgres psql silverstripe < /vagrant/dump.sql"
    • Export SQL File: $ vagrant ssh -c "sudo -u postgres pg_dump silverstripe > /vagrant/dump.sql"
    • Delete Database: $ vagrant ssh -c "sudo -u postgres psql -c 'drop database if exists silverstripe;'"
    • Create Database: $ vagrant ssh -c "sudo -u postgres psql -c 'create database silverstripe;'"
  • PHP CLI and mod_php Version 7.4, 7.3, 7.2, 7.1, 7.0 and 5.6
    Run $ vagrant ssh -c "php-switch <5|7|5.6|7.0|7.1|7.2|7.3|7.4>" to switch the php version
    For full phpinfo() see php7.4-info-apache.html, php7.4-info-cli.txt, php7.3-info-apache.html, php7.3-info-cli.txt, php7.2-info-apache.html, php7.2-info-cli.txt, php7.1-info-apache.html, php7.1-info-cli.txt, php7.0-info-apache.html, php7.0-info-cli.txt, php5.6-info-apache.html and php5.6-info-cli.txt

  • _ss_environment.php & /etc/environment

    SS_DATABASE_SERVER = "localhost"
    SS_DATABASE_USERNAME = "root"
    SS_DATABASE_PASSWORD = "dont-use-in-production"
    SS_DATABASE_NAME = "silverstripe"
    
    SS_ENVIRONMENT_TYPE = "dev"
    
    # log to /vagrant/logs/silverstripe/error.log
    SS_ERROR_LOG = "/../logs/silverstripe/error.log"
    
    SS_DEFAULT_ADMIN_USERNAME = "admin"
    SS_DEFAULT_ADMIN_PASSWORD = "password"
    
    SS_SASSC_PATH = "/usr/local/bin/sassc"
    SS_LESSC_PATH = "/usr/local/bin/lessc"
    SS_WKHTMLTOPDF_PATH = "/usr/bin/wkhtmltopdf"
    SS_WKHTMLTOIMAGE_PATH = "/usr/bin/wkhtmltoimage"
    
    SS_BASE_URL="http://127.0.0.1"
    
  • PhpMyAdmin Version 4.7
    Pre-configured for password-less access (Default URL: http://127.0.0.1:8080/phpmyadmin/)

  • MailHog Version 1.0
    A mailcatcher alternative that replaces sendmail (and offers a smtp server on localhost:1025) to catch all outgoing emails and display them in a web interface (Default URL: http://127.0.0.1:8025/)

  • sassc Version x.x

  • lessc Version x.x

  • nodejs & npm Version x.x & x.x

    • bower Version x.x
    • grunt Version x.x
    • gulp Version x.x
  • composer Version x.x

    • composer-asset-plugin Version x.x
      npm & bower package management via composer
  • psysh Version x.x

  • sspak

  • sake Version x.x.x

  • wkhtmltopdf & wkhtmltoimage Version 0.12.3 (With patched QT)

License

The following license applies to all files and scripts use to provision the operating system, the operating system itself as well as installed third-party software is subject to their respective licenses.

Copyright (c) 2017 Zauberfisch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.