1.登陆云主机,输入密码
2.https://lnmp.org/install.html
3.下载完成之后把项目放在/usr/local/nginx/html 文件夹下 更换。env 配置 执行composer instll 或者composer update
4.nginx配置 cd /usr/local/nginx/conf/ vi ngin.config
server
{
listen 80;
server_name example.com;
root /usr/local/nginx/html/apollo-web-api/public; 注释:项目入口
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
然后访问服务器地址就ok