info('Nginx installing...'); exec('apt update 2>&1'); exec('apt install -y nginx 2>&1'); // 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); // check if nginx is ready and installed if (Install::isReady('nginx')) { // adding ufw to nginx exec('ufw allow "Nginx Full"'); $this->info("Success!"); } else { $this->error("failed"); } } }