sudo fallocate -l 3G /swapfile && \
sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && \
sudo sh -c 'echo /swapfile none swap sw 0 0 >> /etc/fstab' && \
sudo sh -c 'echo vm.swappiness=10 >> /etc/sysctl.conf' && \
sudo sh -c 'echo vm.vfs_cache_pressure = 50 >> /etc/sysctl.conf'
sudo apt-get -y install apache2 php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-mysql php5-gd php5-cli php5-dev mysql-client mysql-server && \
sudo php5enmod mcrypt mysql && \
sudo service apache2 restart && sudo service mysql restart
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo curl https://yt-dl.org/downloads/2016.03.25/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+rx /usr/local/bin/youtube-dl
sudo add-apt-repository ppa:mc3man/trusty-media && sudo apt-get update && sudo apt-get install -y ffmpeg
/etc/youtube-dl.conf
-i
--restrict-filenames
-o '%(id)s.%(ext)s'
--write-thumbnail
--write-info-json
-f "best[height <=? 720]"
--max-filesize 3g
Note: Change path to artisan file.
sudo apt-get install -y supervisor && sudo nano /etc/supervisor/conf.d/lar.conf
Paste this:
[program:laravel]
command=php /var/www/site/artisan queue:work --memory=1024 --daemon
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/var/www/site/storage/logs/worker.log
Then run:
sudo supervisorctl update && sudo supervisorctl status