Installing Nginx on Linux & Windows 09-22-2017, 03:59 PM
#1
![[Image: nginx.jpg]](http://4.bp.blogspot.com/-oVlcvHvTDCc/UfnQ0uC56YI/AAAAAAAAAps/xlbU7iO17n4/s320/nginx.jpg)
Nginx is an open source, free high performance HTTP server and reverse proxy, as well as an IMAP / POP3 proxy server. Igor Sysoev started the development of Nginx in 2002, with the first public version in 2004. Nginx now receives almost 12.18% (22.2M) active sites in
all domains. Nginx is known for its high performance, stability, rich feature set, simple configuration and low resource consumption.
Installation:
To begin with the installation, first we must install a dependency:
Code:
# apt-get install build-essential libssl-dev libpcre3-devInstalling the library we can begin with the installation in full nginx,
Download:
Code:
wget http://nginx.org/download/nginx-1.2.6.tar.gzWe Unpack it:
Code:
tar zxvf nginx-1.2.6.tar.gzWe enter the directory: cd nginx-1.2.6
And we compile:
Code:
- ./configure
- make
- make install(remember to enter as root or sudo)
Nginx has several modules available, which can be downloaded here: http://wiki.nginx.org/Modules
In order to start, restart and stop our nginx, we need a script, download it :
Code:
- wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx
- sudo mv nginx /etc/init.d/nginx
- sudo chmod +x /etc/init.d/nginx
- sudo chown root:root /etc/init.d/nginxnow we can start it correctly:
Code:
/etc/init.d/nginx start
[ ok ] Starting Nginx Server...:.Installing php5-fpm:
we run:
Code:
apt-get install php5-fpmvWe add the following key:
Code:
- apt-get update
- wget http://www.dotdeb.org/dotdeb.gpg
- cat dotdeb.gpg | sudo apt-key add -And we can install php:
Code:
- apt-get install php5-cli php5-suhosin php5-fpm php5-cgi php5-mysqlWe started it
Code:
- /etc/init.d/php5-fpm startAfter that in: /etc/nginx/nginx.conf , we will make the following changes:
We look for the line that says:
Code:
index index.php index.html index.htm;And we will give priority to index.php as seen in the example, then the block
Code:
" upstream php " que apunta a PHP-FPM.
upstream php {
server 127.0.0.1:9000;And to the last of the file we will add the following:
Code:
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;Then we will add the following to the end of the file: / usr / local / nginx / fastcgi_params
Code:
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;And restart our nginx: service nginx restart
Instalación en Windows:
![[Image: images.jpg]](http://2.bp.blogspot.com/-eoXYvvUKRSI/UfnZI3WmBgI/AAAAAAAAAp8/nbQUTsGZ9To/s1600/images.jpg)
Download: http://www.mediafire.com/download/kzx7jj...-setup.exe
Well typical of Windows, we just have to give next, next, next ...,
![[Image: SU565f0.jpg]](http://i.imgur.com/SU565f0.jpg)
![[Image: SU565f0.jpg]](http://i.imgur.com/SU565f0.jpg)
In this part we will choose to install, since we can install
mysql, phpmyadmin, php, etc.
![[Image: 8850a71ce0.png]](https://puu.sh/xGafr/8850a71ce0.png)
mysql, phpmyadmin, php, etc.
![[Image: 8850a71ce0.png]](https://puu.sh/xGafr/8850a71ce0.png)
And good on our C disk, we will have ready everything installed simple, in the folder are the Start, Stop and the Hosteditor, which will serve to put our ip publishes:
![[Image: AdQ2PIB.png]](http://i.imgur.com/AdQ2PIB.png)
![[Image: AdQ2PIB.png]](http://i.imgur.com/AdQ2PIB.png)
To the last one I see my ip added, and the name of the container folder
"zangetsu" and ready, we will have our server running correctly,
To enter phpmyadmin, we will go to the address http://127.0.0.1:81/ , with the
user by default "root" and we will be able to administer it correctly,
Regards!
"zangetsu" and ready, we will have our server running correctly,
To enter phpmyadmin, we will go to the address http://127.0.0.1:81/ , with the
user by default "root" and we will be able to administer it correctly,
Regards!
![[Image: Vs4P58c.png]](https://i.imgur.com/Vs4P58c.png)





![[+]](https://sinister.li/images/modern/collapse_collapsed.png)



















![[Image: p_237m2jx1.png]](http://c.top4top.net/p_237m2jx1.png)