Installing Nginx on MacOSX

Installing NginX

If you are installing Nginx on MacOSX, i recommend using homebrew. Once you have home brew running, install nginx via:

brew install nginx

Once you have it installed, there are a few notes of where you will need to get your nginx running. You nginx config file will be in:

/usr/local/etc/nginx/nginx.conf

if you are install it on Linux either debian or ubuntu. Just do this in terminal:

sudo apt-get install nginx

Setting up Php for NginX

Once you have installed Nginx, you may want to get Php5.4 running. Using homebrew, you can install php-fpm (Php fast process manager) that is a process listening on your (default) port 9000. You can now set nginx to forward any php script requests to this process by adding the following: PHP-FPM Configuration in the nginx.conf

location ~ .php$ {
    #root  html;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index  index.php;
    #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include  fastcgi_params;
}

You might find that the config may have this section of code commented out already. Just uncomment and restart your nginx server.

sudo nginx -s reload 

Something interesting is to check your hosts file (if you are using mac), it will be the file at /etc/hosts. To edit, type this command:

sudo nano /etc/hosts 

Some configuration parameters which you will find useful.

index index.php index.htm index.html;  #Can be placed on the Http level if FPM is activated.

root /Users/[your user id]/Sites/; #This will point to your sites folder on mac. Note [user id], use yours! This can be placed in the Server level



Top Home mirageglobe




Leave a Reply


Recent Posts
Extracting OVF from VMware ESXI 6.0 · Installing LMDE 2 Betsy · SSL Certificates and Encryption · Machine Learning with Spark · Installing Lubuntu in Virtualbox · Getting started with Docker · Ubuntu upgrade limited boot space · Top 10 Browsers Overview · Taovilla Oracle app beta built using meteorjs · Setting up Debian on VirtualBox · The HomeBrew doctor · Caffeine icon for ubuntu / lubuntu · Updating wordpress without FTP · Updating wordpress without FTP · Preinstalled Languages on mainstream OS · Reminisce of Xcom · Java install on Ubuntu · Display image as ASCII art · VirtualBox Resizing Lubuntu Guest Linux · Introducing Samurai · Macbook Pro Key mapping for Lubuntu · Common Apache Nginx commands · Refreshing Git versioned files · Basic Environments for Jira · Converting a hg mercurial to git repository · Long term domain name costs comparison · SVG Graphing · 2 ways to Php install on mac · Introducing Samurai and Installing Meteorjs to own server · Improving the speed of Linux Mint · SVG graphics with Javascript · FTP Clients for Mac OS X · Windows Apps on Mac · Programming Languages Compared · Hackers Natural Cure · Publishing on Ebooks · Editors such as SublimeText2 · Good Coding Practice · LMDE Linux Mint Debian Edition · Heroku Webapp · Hadoop Single node 32bit on 12.10 Mint XFCE · Tracing User Behaviour FRUBO · Installing Nginx on MacOSX · Installing Ruby on MacOS X · Turn off annoying compress outlook message · HTML5 Apps on Cordova PhoneGap with MacOSX · Choosing and using Latex · Reviewing Javascript World · Draw up an Ubuntu Server Environment · Draw up a Lightweight Mail Server · Draw up a Web Database · Php CMS and Frameworks · Drawing up a Web Service · Draw up a Virtual Cloud Server · Unlocking and Flashing your ZTE Blade · Pip error in Python with Homebrew · HomeBrew for OSX · Windows and Linux Desktop Security · TexMaker with Glossary on Mac · Quick way to OpenStack on Lubuntu · Ancient IT Dictionary · TeaTime for Basic Python · CVs and Jobhunting · Chinese Input on Linux Ubuntu · Research in Computer Science · Reviewing Applications on My Mac · Reviewing Applications on My Windows · Installing Windows XP · Installing wireless on Linux Ubuntu or Mint · Restoring an Amazon EC2 Backup · Mac Update PASV problem · Reviewing Green Computing · Consuming the Cloud Storage Space · Using Cherokee and WordPress Whine · Disabling Lubuntu Screensaver · Installing Lubuntu from USB drive · Searching for a Micro Mini CMS · ReStructuredText in Python · Rackspacecloud Vs Amazon · Hacking your old PSP · Attending Atlanta 55th MMM Conference · Smart devices for everyday use · Creative Programmers · Linux Settings · Embarking on Further Education · Machine Learning · Mac Tips – Viewing hidden files on desktop · Creating PDF files for free · Online Media for All · C# ASP Settings · SVN Git and Mercurial Versioning · Getting the last inserted id using datasets · Think Lucky and be Happy · AngieGallery Design · AceTravel Design · Letter to Mum · Prison Vs Work · Irish Daughter · Are you a carrot, an egg or a coffee bean? · Home Media Entertainment Setup · Collection of Interesting sites · Studying in London · Great Oriental eats in London · CMS Joomla, WordPress, Drupal compared ·

© 2017 · MirageGlobe · using zenifywordpress theme by www.dracoturtur.com ·
  · RSS Feed