ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install nginx
sudo cp -v /usr/local/opt/nginx/*.plist /Library/LaunchDaemons/ sudo chown root:wheel /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
sudo nginx
curl -IL http://127.0.0.1:8080
HTTP/1.1 200 OK Server: nginx/1.9.1 Date: Fri, 29 May 2015 14:50:47 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Fri, 29 May 2015 14:40:47 GMT Connection: keep-alive ETag: "5444dea7-264" Accept-Ranges: bytes
sudo nginx //启动nginx sudo nginx -s reload|reopen|quit //重新加载|重启|退出
brew tap homebrew/dupes brew tap homebrew/php
brew install php56 --whitout-apache --with-imap --with-tidy --with-debug --with-pgsql --with-mysql --with-fpm
# 如果使用bash的话 vim ~/.bash_profile export PATH="/usr/local/sbin:$PATH" source ~/.bash_profile # 如果使用ZSH的话 vim ~/.zshrc export PATH="/usr/local/sbin:$PATH" source ~/.zshrc
mkdir -p ~/Library/LaunchAgents ln -sfv /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
lsof -Pni4 | grep LISTEN | grep php
php-fpm 27578 wenzhiquan 9u IPv4 0xf29f8b26c08fc27 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 27628 wenzhiquan 0u IPv4 0xf29f8b26c08fc27 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 27629 wenzhiquan 0u IPv4 0xf29f8b26c08fc27 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 27630 wenzhiquan 0u IPv4 0xf29f8b26c08fc27 0t0 TCP 127.0.0.1:9000 (LISTEN)
brew install mysql
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql_secure_installation
> Enter current password for root (enter for none): //默认没有密码,直接回车即可 > Change the root password? [Y/n] //是否更改root密码,选择是,然后输入并确认密码 > Remove anonymous users? [Y/n] //是否删除匿名用户,选择是 > Disallow root login remotely? [Y/n] //是否禁止远程登录,选择是 > Remove test database and access to it? [Y/n] //是否删除test数据库,选择是 > Reload privilege tables now? [Y/n] //是否重载表格数据,选择是
mysql -u root -p
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql> exit //输入exit退出数据库
mkdir -p /usr/local/etc/nginx/logs mkdir -p /usr/local/etc/nginx/sites-available mkdir -p /usr/local/etc/nginx/sites-enabled mkdir -p /usr/local/etc/nginx/conf.d mkdir -p /usr/local/etc/nginx/ssl sudo mkdir -p /var/www sudo chown :staff /var/www sudo chmod 775 /var/www
vim /usr/local/etc/nginx/nginx.conf
worker_processes 1;
error_log /usr/local/etc/nginx/logs/error.log debug;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /usr/local/etc/nginx/logs/access.log main;
sendfile on;
keepalive_timeout 65;
index index.html index.php;
include /usr/local/etc/nginx/sites-enabled/*;
}
vim /usr/local/ect/nginx/conf.d/php-fpm
location ~ .php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
vim /usr/local/ect/nginx/sites-enabled/default
server {
listen 80;
server_name localhost;
root /var/www/;
access_log /usr/local/etc/nginx/logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
location = /info {
allow 127.0.0.1;
deny all;
rewrite (.*) /.info.php;
}
error_page 404 /404.html;
error_page 403 /403.html;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有