![]() ![]() We need to first tell Mac OS X to automatically start NginX whenever we boot the computer. If you are not sure whether you have this folder, type the following in a Terminal window mkdir /Users/`whoami`/Sites Starting, stopping and reloading NginX The system will reply with your username.Īt this point it should be noted that the web server root is set up to be the Sites folder inside your user's directory. If you don't know what it is type the following in a Terminal window whoami htaccess files, if Apache's document rootĬhange yourusername (shown in bold red letters) with your Mac OS X username. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000įastcgi_split_path_info ^(.+\.php)(/.+)$ įastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name # redirect server error pages to the static page /50x.html ![]() #log_format main '$remote_addr - $remote_user "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"' ![]() From a Terminal window type sudo open /usr/local/etc/nginx/nf -a TextEditĪnd replace the contents of the file with user yourusername staff Įrror_log /var/log/ notice You can configure NginX by editing the files inside the /usr/local/etc/nginx directory.įirst, we need to edit the /etc/nginx/nf file because the default is a bit problematic. Now we need to create a few links to let us easily configure NginX and start it automatically. Open a Terminal window and enter the following command: brew install nginxĪfter a couple of minutes it should tell you that the installation is complete. HomeBrew is a package manager for Mac OS X which lets you install a lot of software without hunting around the Internet for a suitable package file. If you don't have HomeBrew already you need to install it per its instructions. In case you're wondering, you can of course use it in parallel with MAMP, XAMPP or even the multi-PHP version server I've described in an earlier post. In this how-to we'll see how you can set up NginX, a high performance web server, with the PHP version shipped with Mac OS X itself to create a local web server. If you want to start developing PHP applications, or merely work on your PHP-based site off-line, on Mac OS X you can easily do so. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |