Skip to content

Commit

Permalink
NEW: Docs rebuild for compliance with Gatsby (#9316)
Browse files Browse the repository at this point in the history
* Rewrite callout blocks

* Rewrite frontmatter

* Replace missing frontmatter

* Replace note callouts

* Fix icons

* Hide children

* Tidy up code blocks

* Replace legacy code blocks with fenced
  • Loading branch information
Aaron Carlino authored Nov 18, 2019
1 parent 1d63cf5 commit 2facc7c
Show file tree
Hide file tree
Showing 179 changed files with 3,003 additions and 3,226 deletions.
12 changes: 10 additions & 2 deletions docs/en/00_Getting_Started/00_Server_Requirements.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: Server Requirements
icon: server
summary: What you will need to run Silverstripe CMS on a web server
---

# Requirements

SilverStripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser
Expand All @@ -10,16 +16,18 @@ Our web-based [PHP installer](installation/) can check if you meet the requireme

* PHP 5.3.3+, <7.2
* We recommend using a PHP accelerator or opcode cache, such as [xcache](http://xcache.lighttpd.net/) or [WinCache](http://www.iis.net/download/wincacheforphp).
```
* Note: Some PHP 5.5+ packages already have [Zend OpCache](http://php.net/manual/en/book.opcache.php) installed by default. If this is the case on your system, do not try and run additional opcaches alongside Zend OpCache without first disabling it, as it will likely have unexpected consequences.
* Allocate at least 48MB of memory to each PHP process. (SilverStripe can be resource hungry for some intensive operations.)
```
* Required modules: dom, gd2, fileinfo, hash, iconv, mbstring, mysqli (or other database driver), session, simplexml, tokenizer, xml.
* Recommended configuration

```
safe_mode = Off
magic_quotes_gpc = Off
memory_limit = 48M
* See [phpinfo()](http://php.net/manual/en/function.phpinfo.php) for more information about your environment
```
* One of the following databases:
* MySQL 5.0+
* PostgreSQL 8.3+ (requires ["postgresql" module](http://silverstripe.org/postgresql-module))
Expand Down
6 changes: 6 additions & 0 deletions docs/en/00_Getting_Started/01_Installation/01_Linux_Unix.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: Linux and Unix
summary: How to install Silversripe on a *nix system
icon: linux
---

# Installation on Linux, Unix and *nix like Operating Systems

SilverStripe should be able to be installed on any Linux, Unix or *nix like OS as long as the correct server software is installed and configured (referred to as *nix in this document from herein). It is common that web hosting that you may use for your production SilverStripe application will be *nix based, here you may also want to use *nix locally to ensure how you develop locally mimics closely your production environment.
Expand Down
7 changes: 6 additions & 1 deletion docs/en/00_Getting_Started/01_Installation/02_Mac_OSX.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Mac OSX with MAMP
---
title: Mac OSX
summary: How to set up Silverstripe CMS on a MacOS system using MAMP
icon: apple
---
# MacOS with MAMP

This topic covers setting up your Mac as a web server and installing SilverStripe.

Expand Down
16 changes: 5 additions & 11 deletions docs/en/00_Getting_Started/01_Installation/03_Windows.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Windows
summary: How to install Silverstripe CMS on a Windows environment
icon: windows
---
# Windows with WAMPServer 2.5+

An easy and reliable approach to getting SilverStripe running on Windows is to use Apache, which can be conveniently
Expand Down Expand Up @@ -27,9 +32,6 @@ See the [Composer documentation](https://getcomposer.org/doc/00-intro.md#install

Once you have installed the above, open a command line and use the following command to get a fresh copy of SilverStripe stable code installed into a 'silverstripe' sub-folder (note here we are using gitbash paths).

```bash
$ cd /c/wamp/www
$ composer create-project silverstripe/installer ./silverstripe
```
### Zip download
Expand Down Expand Up @@ -65,11 +67,3 @@ control.
Due to some changes to `mod_dir` in [Apache 2.4](http://httpd.apache.org/docs/current/mod/mod_dir.html#DirectoryCheckHandler) (precedence of handlers), index.php gets added to the URLs as soon as you navigate to the homepage of your site. Further requests are then handled by index.php rather than `mod_rewrite` (framework/main.php). To fix this place the following within the `mod_rewrite` section of your .htaccess file:
```
<IfModule mod_rewrite.c>
# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c>
DirectoryIndex disabled
</IfModule>
# ------ #
</IfModule>
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,47 @@ which packages up the whole environment into a convenient application.
Since we're compiling PHP, some build tooling is required.
Run the following command to install Xcode Command Line Tools.

```
xcode-select --install
Now you can install Homebrew itself:
```

```
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
## Install PHP
```

First we're telling Homebrew about some new repositories to get the PHP installation from:

```
brew tap homebrew/dupes
brew tap homebrew/php
We're installing PHP 5.5 here, with the required `mcrypt` module:
```

```
brew install php55 php55-mcrypt
There's a [Homebrew Troubleshooting](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md) guide if Homebrew doesn't work out as expected (run `brew update` and `brew doctor`).
```

Have a look at the [brew-php-switcher](https://github.com/philcook/brew-php-switcher)
project to install multiple PHP versions in parallel and switch between them easily.

## Install the Database (MariaDB/MySQL)

```
brew install mariadb
unset TMPDIR
mysql_install_db --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
'/usr/local/opt/mariadb/bin/mysql_secure_installation'
To start the database server on boot, run the following:
```

```
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
You can also use `mysql.server start` and `mysql.server stop` on demand.
```

## Configure PHP and Apache

Expand All @@ -57,44 +63,51 @@ We're not installing Apache, since OSX already ships with a perfectly fine insta
Edit the existing configuration at `/etc/apache2/httpd.conf`,
and uncomment/add the following lines to activate the required modules:

```
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
Change the `DocumentRoot` setting to your user folder (replacing `<user>` with your OSX user name):
```

```
DocumentRoot "/Users/<user>/Sites"
Now find the section starting with `<Directory "/Library/WebServer/Documents">` and change it as follows,
```
again replacing `<user>` with your OSX user name:

```
<Directory "/Users/<user>/Sites">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
We also recommend running the web server process with your own user on a development environment,
```
since it makes permissions easier to handle when running commands both
from the command line and through the web server. Find and adjust the following options,
replacing the `<user>` placeholder:

```
User <user>
Group staff
Now start the web server:
```

```
sudo apachectl start
Every configuration change requires a restart:
```

```
sudo apachectl restart
You can also load this webserver on boot:
```

```
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
After starting the webserver, you should see a simple "Forbidden" page generated by Apache
```
when accessing `http://localhost`.

## SilverStripe Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,10 @@ Vagrant downloads and sets up an entire operating system.
Most of this requires using only the command line and text editor or IDE.

Create a folder where your vagrant will be in and browse to the folder in the command line:
```bash
mkdir virtuallythere
cd virtuallythere
```
### Creating the Vagrantfile
Create/Browse to the folder you’ll be developing in:
```bash
vagrant init
```

In its current state, you could start the vagrant machine and it will run, but you won't be able to do much with it yet.
Expand All @@ -43,15 +38,11 @@ In its current state, you could start the vagrant machine and it will run, but y
Open the `Vagrantfile` that was created in your vagrant folder with your preferred text editor.

Look for the line which describes the box you are going to use:
```ruby
config.vm.box = "base"
```
This defines what pre-built Operating System the vagrant machine will be using. We'll be changing `base` to something closer to what we’d like, perhaps similar to your production server, you can find a range of boxes [listed here](https://atlas.hashicorp.com/search)
We've chosen to use `RHEL7.0`, but you can easily change it to suit your needs.
```ruby
config.vm.box = "box-cutter/centos70"
```

*Important*: Because this is redhat, the shell commands used later on will be using `yum install` instead of `apt-get install` for Debian based boxes.
Expand All @@ -61,37 +52,23 @@ Now we’ll add the vagrant machine to our computer’s private network, this wi
So this will be your own development environment!

To do that, look for this line:
```ruby
# config.vm.network "private_network", ip: "192.168.33.10"
```
First we’ll need to uncomment it, so delete only the `#` at the start of the line, then add a hostname IP address of your choice to use.
```ruby
config.vm.hostname = "virtuallythere.dev"
config.vm.network "privatenetwork", ip: "10.1.2.50"
```
### Syncing files
Next we’ll sync our website folder to the virtual machine, so it has the files needed to run SilverStripe. There are many different ways to do this, depending on your own preferences and possibly different boxes.

To keep things simple, we’re going to sync our vagrant folder to the virtual machine, so everything in your vagrant folder will be visible to the virtual machine.

Find this line:
```ruby
config.vm.synced_folder "../data", "/vagrant_data"
```
Then change to match this:
```ruby
config.vm.synced_folder ".", "/vagrant"
```

### Setting resources
This step is optional, but it is recommended to configure the virtual machine resources allocated to it, so it doesn’t take more resources than it should, something like this should be enough to start with:
```ruby
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.name = "virtuallythere"
end
```
*Important*: This is for Virtualbox again, change “virtualbox” to the virtual platform that you are using, you might need to make sure the setting `vb.memory` is supported by the platform you’re using because it may be different.
Expand All @@ -100,34 +77,13 @@ end
Now we need to setup our environment using shell scripts, this will install software that you need for your server to be working and usable. You could even customise the setup to be closer like your production server.
For now find these lines:
```ruby
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
```
And modify it to call a shell script in your vagrant folder:
```ruby
config.vm.provision "shell", path: "setup.sh"
```
*Important*: We’re using shell script because we’re using a Linux server, please use the scripting language that your server environment supports.
Now to create the `setup.sh` file. This script will setup `php+modules`, `mariadb/mysql` and `apache`, the ones I had listed is the minimal required to get SilverStripe started and working out of the box.
```bash
yum update -y --disableplugin=fastestmirror
systemctl restart sshd

yum install -y httpd httpd-devel mod_ssl
yum -y install php php-common php-mysql php-pdo php-mcrypt* php-gd php-xml php-mbstring
echo "Include /vagrant/apache/*.conf" >> /etc/httpd/conf/httpd.conf
echo "date.timezone = Pacific/Auckland" >> /etc/php.ini
systemctl start httpd.service
systemctl enable httpd.service

yum install -y mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
```

*Important*: Again, as noted above, this uses RHEL so `yum install` is used, please remember to change to `apt-get install` or other packaging tool as necessary.
Expand All @@ -136,56 +92,15 @@ Save `setup.sh` in the same folder as your Vagrantfile.

### Setting up Apache
If you inspect the script I’ve included above, you’ll notice this line:
```bash
echo "Include /vagrant/apache/*.conf" >> /etc/httpd/conf/httpd.conf
```
This will allow us to customise our apache, particularly the VirtualHost part
Earlier in the post, I had defined a hostname:
```ruby
config.vm.hostname = "virtuallythere.dev"
```
We’ll need to create a conf file for this hostname in a apache folder, create the folder first:
```bash
mkdir apache
```
We'll save a `vagrant.conf` file in the newly created apache folder, and inside we’ll define the VirtualHost:
```apache
ServerRoot "/etc/httpd"
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/vagrant/public"
<Directory "/vagrant/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
ServerName virtuallythere.dev
ServerAlias www.virtuallythere.dev
DocumentRoot /vagrant/public
LogLevel warn
ServerSignature Off
<Directory /vagrant/public>
Options +FollowSymLinks
Options -ExecCGI -Includes -Indexes
AllowOverride all
Require all granted
</Directory>
# SilverStripe specific
<LocationMatch assets/>
php_flag engine off
</LocationMatch>
</VirtualHost>
```

### Download SilverStripe
Expand All @@ -194,8 +109,6 @@ As mentioned above, you could install SilverStripe by [Composer](https://getcomp

### We’re ready for launch
That’s all! When that’s done, run:
```bash
vagrant up
```
Expand Down
Loading

0 comments on commit 2facc7c

Please sign in to comment.