XXXXX
C/C++
XXXXX
C#/.net
XXXXX
js
java
java
开发导航 开发导航 www.endv.cn
天云

userfrosting windows安装配置

一、前提:

1、php 并加入到系统环境

2、mysql 并创建库

userfrosting

3、nginx

 

二、下载到本地站点目录

git clone https://github.com/userfrosting/UserFrosting.git

 

cd UserFrosting

 

三、先安装依赖

composer require wikimedia/composer-merge-plugin

composer update

四、安装

composer install

五、运行安装站点程序

php bakery bake

 根据提示输入数据库信息和创建用户的信息。

 

六、nginx.conf  配置并启动

 

  1 #user  nobody;
  2 worker_processes  10;#CPU核心数,(双核4线程,可以设置为4)
  3 
  4 #error_log  logs/error.log;
  5 #error_log  logs/error.log  notice;
  6 #error_log  logs/error.log  info;
  7 
  8 #pid        logs/nginx.pid;
  9 
 10 
 11 events {
 12     #单个工作进程可以允许同时建立外部连接的数量 进程最大可打开文件数:进程最大可打开文件数受限于操作系统,可通过 ulimit -n 命令查询
 13     worker_connections  65535;
 14 }
 15  
 16   
 17 # worker_rlimit_nofile 65535;
 18 
 19 http {
 20     server_names_hash_bucket_size 64;
 21 
 22     include       mime.types;
 23     default_type  application/octet-stream;
 24  
 25  
 26     sendfile             on;
 27     tcp_nopush           on;
 28     tcp_nodelay          on;
 29     keepalive_timeout    65;
 30     types_hash_max_size  2048;
 31  
 32     ssl_protocols              TLSv1.2 TLSv1.1 TLSv1;
 33     ssl_prefer_server_ciphers  on;
 34  
 35     gzip  on;
 36      
 37  
 38     
 39 ## UserFrosting sample nginx configuration file.
 40 ## See https://learn.userfrosting.com/going-live/vps-production-environment/application-setup#configure-the-webserver-nginx-
 41 
 42 ## Redirect HTTP to HTTPS
 43 ## Enable this block once you've set up SSL.  This will redirect all HTTP requests to HTTPS.
 44 #server {
 45 #    listen 80;
 46 #    server_name example.com;
 47 #    return 301 https://$host$request_uri;
 48 #}
 49 
 50 ## Main server configuration
 51           # C:\php-7.4.5-nts-Win32-vc15-x64\php-cgi.exe -b 127.0.0.1:8008
 52 server {
 53     ## Non-SSL configuration.  Not recommended for production!
 54     listen 80;
 55     ## Defines the script/file to look for when a request is made to the index of your server name.
 56     index index.php index.html index.htm;
 57 
 58     ## Begin - Server Info
 59     ## Document root directory for your project.  Should be set to the directory that contains your index.php.
 60   
 61     
 62                     
 63                 
 64     server_name user.dehengkeji.com;
 65     ## End - Server Info
 66       # root /usr/share/nginx/project/public;
 67     #root D:\wwwroot\oauth2-server\s3\u\UserFrosting\public
 68     root D:/wwwroot/oauth2-server/s3/u/UserFrosting/public;
 69     
 70     ## SSL configuration
 71     ## It is STRONGLY RECOMMENDED that you use SSL for all traffic to your UF site.
 72     ## Otherwise, you are potentially leaking your users' sensitive info, including passwords!
 73     ## See https://letsencrypt.org/ to find out how to get a free, trusted SSL cert for your site.
 74     #
 75     #listen 443 ssl http2;
 76     #listen [::]:443 ssl http2;
 77     ## Certificate paths (example for letsencrypt)
 78     #ssl_certificate /etc/letsencrypt/live/<cert name>/fullchain.pem;
 79     #ssl_certificate_key /etc/letsencrypt/live/<cert name>/privkey.pem;
 80     ## Disable SSLv3(enabled by default since nginx 0.8.19) since it's less secure then TLS http://en.wikipedia.org/wiki/Secure_Sockets_Layer#SSL_3.0
 81     #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 82     ## Enable session resumption to enable low latency for repeat visitors.
 83     #ssl_session_cache shared:SSL:50m;
 84     #ssl_session_timeout 5m;
 85     ## Enables server-side protection from BEAST attacks
 86     #ssl_prefer_server_ciphers on;
 87     ## Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
 88     #ssl_dhparam /etc/nginx/dhparam.pem; # google will tell you how to make this
 89     ## Ciphers chosen for forward secrecy and compatibility
 90     #ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
 91     ## Enable ocsp stapling (mechanism by which a site can convey certificate revocation information to visitors in a privacy-preserving, scalable manner)
 92     #resolver 8.8.8.8;
 93     #ssl_stapling on;
 94     #ssl_trusted_certificate /etc/letsencrypt/live/<cert name>/fullchain.pem; # same as your ssl_certificate path
 95     ## Config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
 96     #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
 97     ## End - SSL configuration
 98 
 99     access_log  access.log;
100 
101     add_header X-Frame-Options SAMEORIGIN;
102     add_header X-Content-Type-Options nosniff;
103     ## This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
104     add_header X-XSS-Protection "1; mode=block"; #optional
105 
106     ## Begin - Pagespeed
107     ## See https://learn.userfrosting.com/going-live/vps-production-environment/additional-recommendations
108     ## for information on compiling nginx with the Pagespeed module.
109     #pagespeed on;
110     #pagespeed FileCachePath /var/ngx_pagespeed_cache;
111     #pagespeed Disallow "*.svg*";
112     ## Add additional filters here
113     #pagespeed EnableFilters prioritize_critical_css;
114     ## Ensure requests for pagespeed optimized resources go to the pagespeed 
115     ## handler and no extraneous headers get set.
116     #location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
117     #location ~ "^/ngx_pagespeed_static/" { }
118     #location ~ "^/ngx_pagespeed_beacon" { }
119     ## End - Pagespeed
120 
121     ## Begin - Let's Encrypt
122     ## Allow URLs for certbot acme challenge
123     location ~ /.well-known {
124         allow all;
125     }
126     ## End - Let's Encrypt
127 
128     ## Begin - Handle PHP requests
129     location ~ \.(php)$ {
130         # Throw away any requests to execute PHP scripts in other directories
131         # See http://cnedelcu.blogspot.com/2010/05/nginx-php-via-fastcgi-important.html for why this is needed
132         location ~ \..*/.*\.php$ {
133             return 404;
134         }
135         # regex to split $uri to $fastcgi_script_name and $fastcgi_path
136         fastcgi_split_path_info ^(.+\.php)(/.+)$;
137         fastcgi_keep_conn on;
138         # For FPM (PHP 7)
139         #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
140         # For FPM (PHP 5.x)
141         #fastcgi_pass unix:/var/run/php5-fpm.sock;
142         # For traditional PHP FastCGI (php5-cgi or php7.0-cgi)
143         #fastcgi_pass 127.0.0.1:9000;
144         fastcgi_pass   127.0.0.1:8008; 
145         # For HHVM
146         #fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
147         fastcgi_index  index.php;
148         fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
149         include        fastcgi_params;
150     }
151     ## End - Handle PHP requests
152 
153     ## Begin - Caching static files
154     location ~* \.(png|gif|jpg|jpeg|svg|ico|css|js|woff|ttf|otf|woff2|eot)$ {
155     #    include /etc/nginx/mime.types;
156         expires max;
157 
158         index index.php;
159         try_files $uri $uri/ /index.php?$query_string;
160     }
161     ## End - Caching static files
162 
163     ## Begin - Index
164     ## for subfolders, simply adjust:
165     ## `location /subfolder {`
166     ## and the rewrite to use `/subfolder/index.php`
167     location / {
168      #   include /etc/nginx/mime.types;
169         index index.php;
170         try_files $uri $uri/ /index.php?$query_string;
171     }
172     ## End - Index
173 }
174 
175     
176     
177     
178 }
nginx.conf

注意站点的根目录和权限

七、启动php程序 

C:\php-7.4.5-nts-Win32-vc15-x64\php-cgi.exe -b 127.0.0.1:8008

八、访问

http://127.0.0.1/

注意:要访问80端口

 

posted @ 2021-03-10 11:54  Endv  阅读(125)  评论(0编辑  收藏  举报