Let's take the installation on Ubuntu as an example.
add-apt-repository ppa:ondrej/php
apt update
apt install php7.0-fpm php7.0-gd php7.0-cli php7.0-curl php7.0-dev php7.0-json php7.0-mbstring php7.0-mysql php7.0-xml php7.0-zip php-redis
curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | bash
apt install php7.0-phalcon
pecl install swoole
echo 'extension = swoole.so' > /etc/php/7.0/mods-available/swoole.ini
ln -s /etc/php/7.0/mods-available/swoole.ini /etc/php/7.0/cli/conf.d/20-swoole.ini
ln -s /etc/php/7.0/mods-available/swoole.ini /etc/php/7.0/fpm/conf.d/20-swoole.ini
wget -c https://getcomposer.org/composer.phar -O /usr/bin/composer
chmod +x /usr/bin/composer
add-apt-repository ppa:nginx/stable
apt update
apt install nginx
vim /etc/nginx/conf.d/upstream.conf
upstream php7 {
#this should match value of "listen" directive in php-fpm pool
server unix:/run/php/php7.0-fpm.sock;
}
vim /etc/nginx/sites-available/yoursite.dev
map $http_x_forwarded_proto $frontend_https {
default '';
https on;
}
server {
listen 80;
server_name yoursite.dev;
root /srv/http/yoursite.dev/public;
index index.php index.html index.htm;
access_log off;
error_log /var/log/nginx/yoursite.dev_error.log;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass php7;
access_log /var/log/nginx/yoursite.dev_access.log;
fastcgi_param USE_SERVICE 1;
fastcgi_param HTTPS $frontend_https;
}
location ~ /^\. { deny all; }
location ~* \.(js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header 'Cache-Control' 'public';
add_header 'X-Frame-Options' 'ALLOW-FROM *';
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
expires +1w;
}
}
ln -s /etc/nginx/sites-available/yoursite.dev /etc/nginx/sites-enabled/yoursite.dev
nginx -t
nginx -s reload
cd /srv/http
git clone [email protected]:phwoolcon/bootstrap.git yoursite.dev
cd yoursite.dev
bin/import-package phwoolcon/demo
composer update
apt install mysql-server-5.7 mysql-client-5.7
mysql -uroot -p
create database your_db_name;
GRANT ALL PRIVILEGES ON your_db_name.* To 'your_db_user'@'%' IDENTIFIED BY 'your_db_pass';
vim app/config/production/database.php
<?php
return [
'default' => 'mysql',
'connections' => [
'mysql' => [
'host' => '127.0.0.1', // Use real server
'username' => 'your_db_user', // Use real username
'password' => 'your_db_pass', // Use real password
'dbname' => 'your_db_name', // Use real db name
],
],
'distributed' => [
'node_id' => '001',
],
'query_log' => false,
];
vim app/config/production/payment.php
<?php
return [
'gateways' => [
'alipay' => [
// Fill real merchant info here
'partner' => 'PARTNER_ID',
'seller_id' => '[email protected]',
'private_key' => '-----BEGIN RSA PRIVATE KEY-----
YOUR_PRIVATE_KEY_HERE
-----END RSA PRIVATE KEY-----',
'ali_public_key' => '-----BEGIN PUBLIC KEY-----
ALI_PUBLIC_KEY_HERE
-----END PUBLIC KEY-----',
],
],
];
bin/dump-autoload
bin/cli migrate:up
bin/dump-autoload