mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS Moved install guides to forum
We don't keep them updated, and they're better placed in a wiki entry on our forum: https://forum.silverstripe.org/c/tips
This commit is contained in:
parent
1977ab5ee2
commit
f93fcd66ef
@ -1,24 +0,0 @@
|
||||
# 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.
|
||||
|
||||
Is important to ensure you check the [Server Requirements](/getting_started/server_requirements) list before acquiring and installing SilverStripe on your *nix server (locally or otherwise).
|
||||
|
||||
At a high level you will need a:
|
||||
* Web server e.g. Apache, Nginx
|
||||
* Database e.g. MariaDB, Postgres, MySQL
|
||||
* PHP
|
||||
|
||||
##*nix installation guides on the web
|
||||
There are a number of good step by step guides covering server setups and installing of SilverStripe on the various flavours of *nix systems.
|
||||
|
||||
Note: Many of the following guides simply download SilverStripe as a zipped file. We recommend the use of [Composer](/getting_started/composer/) once you get to the point of installing SilverStripe (though the choice is up to you). Always ensure you get the latest version if you are starting a new project.
|
||||
|
||||
###Known (but not exhaustive) list
|
||||
* [How To Install Silverstripe on Your VPS](https://www.digitalocean.com/community/tutorials/how-to-install-silverstripe-on-your-vps)
|
||||
* [Running SilverStripe On Nginx (LEMP) On Debian Wheezy/Ubuntu 13.04](http://www.howtoforge.com/running-silverstripe-on-nginx-lemp-on-debian-wheezy-ubuntu-13.04)
|
||||
* [Setting up nginx, PHP-FPM, and SilverStripe on Fedora 19](http://halkyon.net/blog/setting-up-nginx-php-fpm-and-silverstripe-installation-on-fedora-19/)
|
||||
* [How to install SilverStripe CMS on a Linux Virtual Server](http://www.rosehosting.com/blog/how-to-install-silverstripe-cms-on-a-linux-virtual-server/)
|
||||
|
||||
|
||||
_If you find further good *nix related installation articles please email these to community+docs@silverstripe.org._
|
@ -1,49 +0,0 @@
|
||||
# Mac OSX with MAMP
|
||||
|
||||
This topic covers setting up your Mac as a web server and installing SilverStripe.
|
||||
|
||||
OSX comes bundled with PHP and Apache, but you're stuck with the versions it ships with.
|
||||
It is also a bit harder to install additional PHP modules required by SilverStripe.
|
||||
[MAMP](http://www.mamp.info/en/) is a simple way to get a complete webserver
|
||||
environment going on your OSX machine, without removing or altering any system-level configuration.
|
||||
|
||||
Check out the [MAC OSX with Homebrew](/getting_started/installation/other_installation_options/mac_osx_homebrew)
|
||||
for an alternative, more configurable installation process.
|
||||
|
||||
## Requirements
|
||||
|
||||
Please check the [system requirements](http://www.mamp.info/en/documentation/) for MAMP,
|
||||
you'll need a fairly new version of OSX to run it.
|
||||
|
||||
## MAMP Installation
|
||||
|
||||
* [Download MAMP](http://www.mamp.info/en/)
|
||||
* Install and start MAMP
|
||||
* Check out your new web server environment on `http://localhost:8888`
|
||||
|
||||
## SilverStripe Installation
|
||||
|
||||
[Composer](http://getcomposer.org) is a dependancy manager for PHP, and the preferred way to
|
||||
install SilverStripe. It ensures that you get the correct set of files for your project.
|
||||
Composer uses your MAMP PHP executable to run and also requires [git](http://git-scm.com)
|
||||
to automatically download the required files from GitHub and other repositories.
|
||||
|
||||
In order to install Composer, we need to let the system know where to find the PHP executable.
|
||||
Open or create the `~/.bash_profile` file in your home folder, then add the following line:
|
||||
`export PATH=/Applications/MAMP/bin/php/php7.0.20/bin:$PATH`
|
||||
You'll need to adjust the PHP version number (`php7.0.20`). The currently running PHP version is shown on `http://localhost:8888/MAMP/index.php?page=phpinfo`.
|
||||
Run `source ~/.bash_profile` for the changes to take effect. You can verify that the correct executable
|
||||
is used by running `which php`. It should show the path to MAMP from above.
|
||||
|
||||
Now you're ready to install Composer: Run `curl -sS https://getcomposer.org/installer | php`.
|
||||
We recommend that you make the `composer` executable available globally,
|
||||
which requires moving the file to a different folder. Run `mv composer.phar /usr/local/bin/composer`.
|
||||
More detailed installation instructions are available on [getcomposer.org](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
|
||||
You can verify the installation by typing the `composer` command, which should show you a command overview.
|
||||
|
||||
Finally, we're ready to install SilverStripe through composer:
|
||||
`composer create-project silverstripe/installer /Applications/MAMP/htdocs/silverstripe/`.
|
||||
After finishing, the installation wizard should be available at `http://localhost:8888/silverstripe`.
|
||||
The MAMP default database credentials are user `root` and password `root`.
|
||||
|
||||
We have a separate in-depth tutorial for [Composer Installation and Usage](/getting_started/composer).
|
@ -1,77 +0,0 @@
|
||||
# Windows with WAMPServer 2.5+
|
||||
|
||||
An easy and reliable approach to getting SilverStripe running on Windows is to use Apache, which can be conveniently
|
||||
done through [WampServer](http://www.wampserver.com/en/). This can be useful if you are deploying on Linux Apache and
|
||||
want a Microsoft Windows machine with a very similar environment.
|
||||
|
||||
## Install WAMP
|
||||
|
||||
1. Go to the [WampServer download page](http://www.wampserver.com/en/#download-wrapper).
|
||||
2. You will first need to download and install the suggested [Visual C++ Redistributable for Visual Studio 2012 Update 4](http://www.microsoft.com/en-us/download/details.aspx?id=30679#) BEFORE installing WampServer.
|
||||
3. Next, download the WampServer installer and the run the installer. By default, it will install to C:\wamp. You can choose your own install path if you wish; however note we will refer to the c:/wamp in the test of this tutorial.
|
||||
4. Once WampServer has been installed and launched, you will see a small "W" in the task bar, next to
|
||||
the clock. If everything is working, then it will be green. If it's orange or red, then something is likely misconfigured. See the Troubleshooting section below. If you can't see the "W", then WampServer hasn't been started and you should start WampServer from the start menu.
|
||||
5. Left-click the "W", then select Apache -> Apache Modules -> Rewrite Module. The "W" will flick to orange, and
|
||||
then return to green.
|
||||
6. Left-click the "W", then select MySQL -> my.ini. At the very bottom of the file, and add the following to a new line without the quotes): "lower_case_table_names = 2". Save the file, close Notepad and left-click the "W", and
|
||||
select 'Restart all services'. This is used to ease the transition between a Windows-based install and a Linux-based
|
||||
install where database case-sensitivity is important.
|
||||
|
||||
## Install SilverStripe
|
||||
### Composer
|
||||
Composer is becoming our preferred way to manager installation and future dependancy management of SilverStripe modules. Getting started with Composer requires:
|
||||
1. PHP installed on your local environment (which in this context is part of WAMP).
|
||||
2. The Composer application itself (there is a Windows installer which will ask you to point it to PHP, in this case it should be at C:/wamp/bin/php/phpX.X.X/php.exe).
|
||||
See the [Composer documentation](https://getcomposer.org/doc/00-intro.md#installation-windows) to get the installer.
|
||||
3. A command line such as windows command prompt or [gitbash](http://git-scm.com/download/win) (recommended and comes as part of git for windows).
|
||||
|
||||
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
|
||||
* [Download](http://silverstripe.org/stable-download) the latest SilverStripe CMS and Framework package
|
||||
* Unpack the archive into `C:\wamp\www`
|
||||
* Rename the unpacked directory from `C:\wamp\www\silverstripe-vX.X.X` to `C:\wamp\www\silverstripe`
|
||||
|
||||
## Install and configure
|
||||
* Option 1: Environment file - Set up a file named `.env` file either in the webroot and setup as per the [Environment Management process](/getting_started/environment_management).
|
||||
|
||||
* Option 2: Installer - Visit `http://localhost/silverstripe/public` - you will see SilverStripe's installation screen.
|
||||
* You should be able to click "Install SilverStripe" and the installer will do its thing. It takes a minute or two.
|
||||
* Once the installer has finished, visit `http://localhost/silverstripe/public`. You should see your new SilverStripe site's
|
||||
home page.
|
||||
|
||||
## Troubleshooting
|
||||
1. If there is some misconfiguration, this often indicated you may have another service on port 80 or port 3306. Here are some common sources of problems to check.
|
||||
|
||||
After correcting these issues, left-click the "W" and choose 'restart all services'. It might a short while to restart, but the "W" turn green.
|
||||
|
||||
* You might have IIS running. Check Start -> Control Panel -> Administrative Tools -> Internet Information
|
||||
Services. Ensure that any web site services are stopped.
|
||||
* If you run Skype, visit Select "Tools" -> "Options" in Skype's menu. Find an option "Use port 80 and 443 as
|
||||
alternatives for incoming connection". Make sure that it is de-selected.
|
||||
|
||||
2. Vista's security controls can cause issues. If you have installed on Vista but you're getting errors, there is a chance that SilverStripe does not have sufficient permissions.
|
||||
|
||||
Right clicked on the installation folder and go to Permissions > Security > Users > Advanced and give the user full
|
||||
control.
|
||||
|
||||
3. Apache rewrite (mod_rewrite) isn't working and it's installed (prior to SilverStripe 3.1.11)
|
||||
|
||||
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.
|
||||
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>
|
||||
```
|
@ -1,118 +0,0 @@
|
||||
# Mac OSX with Homebrew
|
||||
|
||||
This topic covers setting up your Mac as a web server and installing SilverStripe.
|
||||
|
||||
OSX comes bundled with PHP, but you're stuck with the version and modules it ships with.
|
||||
If you run projects on different PHP versions, or care about additional PHP module support
|
||||
and other dependencies such as MariaDB, we recommend an installation through [Homebrew](http://brew.sh/).
|
||||
|
||||
Check out the [MAC OSX with MAMP](/getting_started/installation/mac_osx) for an alternative installation process
|
||||
which packages up the whole environment into a convenient application.
|
||||
|
||||
## Requirements
|
||||
|
||||
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.6 here, with the required `intl` module:
|
||||
|
||||
brew install php56 php56-intl php56-apcu
|
||||
|
||||
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
|
||||
|
||||
We're not installing Apache, since OSX already ships with a perfectly fine installation of it.
|
||||
|
||||
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
|
||||
|
||||
[Composer](http://getcomposer.org) is a dependancy manager for PHP, and the preferred way to
|
||||
install SilverStripe. It ensures that you get the correct set of files for your project.
|
||||
Composer uses the PHP executable we've just installed. It also needs [git](http://git-scm.com)
|
||||
to automatically download the required files from GitHub and other repositories.
|
||||
|
||||
Run `curl -sS https://getcomposer.org/installer | php` to install the `composer` executable.
|
||||
We recommend that you make the executable available globally,
|
||||
which requires moving the file to a different folder. Run `mv composer.phar /usr/local/bin/composer`.
|
||||
More detailed installation instructions are available on [getcomposer.org](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
|
||||
You can verify the installation by typing the `composer` command, which should show you a command overview.
|
||||
|
||||
Finally, we're ready to install SilverStripe through composer:
|
||||
`composer create-project silverstripe/installer /Users/<user>/Sites/silverstripe/`.
|
||||
After finishing, the installation wizard should be available at `http://localhost/silverstripe`.
|
||||
The Homebrew MariaDB default database credentials are user `root` and password `root`.
|
||||
|
||||
We have a separate in-depth tutorial for [Composer Installation and Usage](/getting_started/composer).
|
@ -1,221 +0,0 @@
|
||||
# Install SilverStripe using Vagrant
|
||||
This guide steps through installing a virtual machine on your chosen virtual platform.
|
||||
|
||||
This guide will work for:
|
||||
- Virtualbox
|
||||
- Parallels
|
||||
|
||||
This guide may work for:
|
||||
- VMWare
|
||||
|
||||
Vagrant has all server settings stored in a Vagrantfile which is a text file containing the commands and settings needed to setup a webserver. This is ideal for version control, which helps distribution and sharing between team members.
|
||||
|
||||
## Requirements
|
||||
This can be used with many modern computers, this can be done on Windows, Mac or Linux operating systems. We recommend a relatively strong computer that can handle a virtual machine in the background.
|
||||
- Minimum memory would be 4GB of RAM
|
||||
- Roughly 20GB Harddrive space (depends on which box you choose to use)
|
||||
- Software to install beforehand:
|
||||
- [Vagrant](http://www.vagrantup.com/downloads)
|
||||
- [Virtualbox](https://www.virtualbox.org/wiki/Downloads)
|
||||
- Installing SilverStripe by [Composer](https://getcomposer.org/download/) or download the [ZIP file](https://www.silverstripe.org/download/).
|
||||
|
||||
*Important*: It is strongly advised to have a fast and wired internet connection when running initial the setup, as there is a lot of downloading required.
|
||||
Vagrant downloads and sets up an entire operating system.
|
||||
|
||||
## Setting it up
|
||||
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.
|
||||
|
||||
### Setting the box
|
||||
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://app.vagrantup.com/boxes/search)
|
||||
|
||||
We've chosen to use `RHEL7.0`, but you can easily change it to suit your needs.
|
||||
```ruby
|
||||
config.vm.box = "box-cutter/centos73"
|
||||
```
|
||||
|
||||
*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.
|
||||
|
||||
### The private network and hostname
|
||||
Now we’ll add the vagrant machine to our computer’s private network, this will mean no one outside this computer will be able to access it without some special setup.
|
||||
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.
|
||||
|
||||
### Script to setup server
|
||||
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-intl 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.
|
||||
|
||||
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
|
||||
Last step is to download SilverStripe for the virtual machine to use, if you have an existing SilverStripe installation you could also move everything to this folder instead of downloading a new installation to the public folder.
|
||||
As mentioned above, you could install SilverStripe by [Composer](https://getcomposer.org/download/) or download the [ZIP file](https://www.silverstripe.org/download/).
|
||||
|
||||
### We’re ready for launch
|
||||
That’s all! When that’s done, run:
|
||||
```bash
|
||||
vagrant up
|
||||
```
|
||||
|
||||
|
||||
If you've been following this guide, you can browse to http://virtuallythere.dev/install if you are using a new installation, or go to http://virtuallythere.dev if you are using an existing SilverStripe installation. If you've modified the hostname, follow the new hostname you've chosen.
|
||||
|
||||
### Last step
|
||||
Version control this and share it with your teammates!
|
||||
|
||||
All they need is listed in the Requirements at the top, and the files you’ve just created:
|
||||
- Vagrantfile
|
||||
- setup.sh
|
||||
- apache/virtuallythere.conf
|
||||
- public/ _(with SilverStripe files here)_
|
||||
|
||||
## Advanced tasks
|
||||
Once you get started with Vagrant, it’s very easy to improve and tweak things further if you needed. With version control, if you've made a mistake, you can easily rollback to the last working version.
|
||||
|
||||
Some examples of things you could do:
|
||||
- You could have multiple hostnames for the same virtual machine by using the plugin [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater).
|
||||
- Have [multiple machines](https://docs.vagrantup.com/v2/multi-machine/) running, if you wanted to test communications between two servers
|
||||
- Perhaps you have access to API server code you could host locally for development.
|
||||
- [Vagrant Push](https://docs.vagrantup.com/v2/push/index.html) could be used to deploy to a Testing server.
|
||||
|
@ -1,100 +0,0 @@
|
||||
# Nginx
|
||||
|
||||
These instructions are also covered on the
|
||||
[Nginx Wiki](https://www.nginx.com/resources/wiki/start/topics/recipes/silverstripe/).
|
||||
|
||||
The prerequisite is that you have already installed Nginx and you are
|
||||
able to run PHP files via the FastCGI-wrapper from Nginx.
|
||||
|
||||
Now you need to set up a virtual host in Nginx with configuration settings
|
||||
that are similar to those shown below.
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
If you don't fully understand the configuration presented here, consult the
|
||||
[nginx documentation](http://nginx.org/en/docs/).
|
||||
|
||||
Especially be aware of [accidental php-execution](https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/ "Don't trust the tutorials") when extending the configuration.
|
||||
</div>
|
||||
|
||||
## Caveats about the sample configuration below
|
||||
|
||||
* It does not cover serving securely over HTTPS.
|
||||
* It uses the new filesystem layout (with `public` directory) introduced in version 4.1.0. If your installation has been upgraded to 4.1+ from an older version and you have not [upgraded to the public folder](/changelogs/4.1.0.md), see the version of this documentation for version 4.0.
|
||||
* The regular expression for allowed file types must be manually updated if the File.allowed_extensions list is updated.
|
||||
* The error pages for 502 (Bad Gateway) and 503 (Service Unavailable) need to be manually created and published in the CMS (assuming use of the silverstripe/errorpage module).
|
||||
|
||||
```nginx
|
||||
server {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
client_max_body_size 0; # Manage this in php.ini (upload_max_filesize & post_max_size)
|
||||
listen 80;
|
||||
root /path/to/ss/folder/public;
|
||||
server_name example.com www.example.com;
|
||||
|
||||
# Defend against SS-2015-013 -- http://www.silverstripe.org/software/download/security-releases/ss-2015-013
|
||||
if ($http_x_forwarded_host) {
|
||||
return 400;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.php?$query_string;
|
||||
}
|
||||
|
||||
error_page 404 /assets/error-404.html;
|
||||
error_page 500 /assets/error-500.html;
|
||||
|
||||
# See caveats
|
||||
error_page 502 /assets/error-500.html;
|
||||
error_page 503 /assets/error-500.html;
|
||||
|
||||
# Support assets & resources #
|
||||
|
||||
# Never serve .gitignore, .htaccess, or .method
|
||||
location ~ /\.(gitignore|htaccess|method)$ {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# Protect the .protected folder
|
||||
location ~ ^/assets/.protected/ {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# Handle allowed file types (see caveats)
|
||||
# Pass unfound files to SilverStripe to check draft images
|
||||
location ~ ^/assets/.*\.(?i:css|js|ace|arc|arj|asf|au|avi|bmp|bz2|cab|cda|csv|dmg|doc|docx|dotx|flv|gif|gpx|gz|hqx|ico|jpeg|jpg|kml|m4a|m4v|mid|midi|mkv|mov|mp3|mp4|mpa|mpeg|mpg|ogg|ogv|pages|pcx|pdf|png|pps|ppt|pptx|potx|ra|ram|rm|rtf|sit|sitx|tar|tgz|tif|tiff|txt|wav|webm|wma|wmv|xls|xlsx|xltx|zip|zipx)$ {
|
||||
sendfile on;
|
||||
try_files $uri /index.php?$query_string;
|
||||
}
|
||||
|
||||
# Allow the error pages. Fail with 404 Not found.
|
||||
location ~ ^/assets/error-\d\d\d\.html$ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Fail all other assets requests as 404 Not found
|
||||
# Could also use 403 Forbidden or 444 (nginx drops the connection)
|
||||
location ~ ^/assets/ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
# End of assets & resources support #
|
||||
|
||||
location /index.php {
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_busy_buffers_size 64k;
|
||||
fastcgi_buffers 4 32k;
|
||||
fastcgi_keep_conn on;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The above configuration sets up a virtual host `example.com` with
|
||||
rewrite rules suited for SilverStripe. The location block for index.php
|
||||
passes the php script to the FastCGI-wrapper via a TCP socket.
|
||||
|
||||
Now you can proceed with the SilverStripe installation normally.
|
Loading…
Reference in New Issue
Block a user