~ Introduction ~
Hello everyone today I'm going to be teaching you how to install the web server Nginx on your Fedora server. I've been setting up and configuring web servers for a couple years now and I have a vast knowledge of CentOS, Debian, Ubuntu, & Fedora. I've setup Apache, Litespeed, & Nginx multiple times and have helped many people setting them up as well.
~ The Meat & Potatoes ~
* Some of the following instructions have been taken from this tutorial
~ Preliminaries ~
1. Basic knowledge of Linux
2. Have a VPS/Dedicated server & puTTy
3. yum remove httpd php*
4. yum install gcc nano
~ MySQL ~
1. yum install mysql mysql-server
2. chkconfig --levels 235 mysqld on
3. service mysqld start
4. mysql_secure_installation
5. Hit enter
6. Type "Y" without the quotations and hit enter
7. Enter your desired password
8. Type "Y" without the quotations and hit enter
9. Type "N" without the quotations and hit enter
10. Type "Y" without the quotations and hit enter
11. Type "Y" without the quotations and hit enter
~ Nginx ~
1. yum install nginx
2. chkconfig --levels 235 nginx on
3. service nginx start
~ PHP5 ~
1. yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
2. nano /etc/php.ini
3. Find the below lines and change "; cgi.fix_pathinfo=1" to "cgi.fix_pathinfo=0"
Code
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
cgi.fix_pathinfo=03. chkconfig --levels 235 php-fpm on
4. service php-fpm start
~ Configuring nginx ~
1. nano /etc/nginx/conf.d/default.conf
2. Add "root /usr/share/nginx/html;" under "server_name _;"
2. Find "index index.html index.htm;" and replace with "index index.php index.html index.htm;"
3. The most important part. Find and uncomment your "location ~ \.php$ {}" stanza. Please make sure that you change the fastcgi_param line to "fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;" because otherwise the PHP interpreter won't find the PHP script that you call in your browser.
Code
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}4. service nginx restart
5. nano /usr/share/nginx/html/info.php
Code
<?php
phpinfo();
?>6. Visit http://YOURSERVERIP/info.php
~ Summary ~
Thank you all for taking the time to read my tutorial. I hope you had as much fun reading it as I did writing it up for you. If you have any questions feel free to PM me or post here and I will help you to the best of my ability. If you want to repost this tutorial just give a link back to this thread. Also if there is anything I missed please PM me or post here and I will update the guide asap. If there is any other guides you would like me to write just pitch an idea and I will see :D.
~ Summary ~
Thank you all for taking the time to read my tutorial. I hope you had as much fun reading it as I did writing it up for you. If you have any questions feel free to PM me or post here and I will help you to the best of my ability. If you want to repost this tutorial just give a link back to this thread. Also if there is anything I missed please PM me or post here and I will update the guide asap. If there is any other guides you would like me to write just pitch an idea and I will see :D.

