info('Nginx installing...'); exec('apt update 2>&1'); exec('apt install -y nginx 2>&1'); // check if nginx is ready and installed if (Install::isReady('nginx')) { // copy snippets exec('cp '.base_path().'/resources/nginx/snippets/*.conf /etc/nginx/snippets'); $configuration = [ 'user' => $this->option('user'), 'env' => App::environment() ]; // get workers exec('echo $(grep ^processor /proc/cpuinfo | wc -l)', $output); $configuration['processes'] = $output[0]; // get connections exec('echo $(ulimit -n)', $output); $configuration['connections'] = $output[1]; $bladeFile = new BladeFile('/resources/nginx'); $bladeFile->put('nginx', '/etc/nginx/nginx.conf', $configuration); // adding ufw to nginx exec('ufw allow "Nginx Full"'); $this->info('Success! \o/'); } else { $this->error('Failed! /o\\'); } } }