Skip to content

Requirements and Installation

t2t2 edited this page Dec 11, 2018 · 1 revision

Requirements

Installation

  • Clone the site via git
  • Configure the server so that public directory is served
  • Get the dependencies
    • composer install
    • npm install
  • Create a copy .env.example called .env and set values accordingly in the new file
    • Make sure to set APP_ENV to local if developing or production if in production.
    • Also check config folder for a bunch more settings
  • Migrate the database php artisan migrate
  • For developing:
    • While developing keep gulp watch task running: npm run dev
    • Also might be helpful to generate ide helpers file php artisan ide-helper:generate
  • For production:
    • Generate assets: npm run build
    • Optimize: php artisan optimize
  • Generate an user for yourself: php artisan auth:create
  • Install server configuration
  • Visit http://<app location>/login

Server configs

nginx

Based on a hybrid between laravel's homestead and h5bp config. Reccomended to use the base h5bp server config

server {
	listen [::]:80;
	listen 80;
	
	server_name live.example.com;
	
	# Path to files
	root /sites/path.to.livehub/public;
	index index.php index.html index.htm;
	
	charset utf-8;
	
	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}
	
	location = /favicon.ico { access_log off; log_not_found off; }
	location = /robots.txt  { access_log off; log_not_found off; }
	
	access_log /var/log/nginx/livehub-access.log;
	error_log  /var/log/nginx/livehub-error.log error;
	
	client_max_body_size 100m;
	
	location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php5-fpm.sock;
		fastcgi_index index.php;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
		fastcgi_intercept_errors off;
		fastcgi_buffer_size 16k;
		fastcgi_buffers 4 16k;
	}
	location ~ /\.ht {
		deny all;
	}
	
	# Uncomment if h5bp base is in use
	# include h5bp/basic.conf;
}

Enabling cron tasks

crontab -e -u www-data (Change www-data to the user that runs php usually)

* * * * * php /sites/path.to.livehub/artisan schedule:run 1>> /dev/null 2>&1

Clone this wiki locally