Skip to content
xtr4nge edited this page Oct 11, 2014 · 10 revisions

Nginx + PHP-FPM

In case that you need to re-install/setup Nginx, please follow these steps:

SETUP

apt-get -y install nginx php5-fpm

mkdir /etc/nginx/ssl

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt

rm /etc/nginx/sites-enabled/default

cd /etc/nginx/sites-enabled/
wget https://raw.githubusercontent.com/xtr4nge/FruityWifi/master/nginx-setup/FruityWifi

cd /etc/php5/fpm/pool.d/
wget https://raw.githubusercontent.com/xtr4nge/FruityWifi/master/nginx-setup/fpm/443.conf
wget https://raw.githubusercontent.com/xtr4nge/FruityWifi/master/nginx-setup/fpm/80.conf
wget https://raw.githubusercontent.com/xtr4nge/FruityWifi/master/nginx-setup/fpm/8000.conf
wget https://raw.githubusercontent.com/xtr4nge/FruityWifi/master/nginx-setup/fpm/8443.conf

echo "." >> /var/www/index.php

/etc/init.d/apache2 stop
/etc/init.d/nginx restart
/etc/init.d/php5-fpm restart

update-rc.d -f apache2 remove
update-rc.d nginx defaults

CHECK

http://localhost:8000 [FruityWifi HTTP]
https://localhost:8443 [FruityWifi HTTPS]

http://localhost [HTTP]
https://localhost [HTTPS]

You can also try checking the open ports:
nmap -p 80,443,8000,8443 localhost
or
netstat -anp | grep -iEe "(:80 |:443 |:8000 |:8443 ).+ LISTEN"

Clone this wiki locally