文章目录
一键安装lnmp
安装composer
添加php用户 php
安装laravel
composer create-project --prefer-dist laravel/laravel blog 5.8.*
vi /usr/local/php/etc/php.ini
配置nginx/php-fpm
server {
listen 8000;
server_name localhost;
#charset koi8-r;
access_log logs/access.log ;
error_log logs/error.log;
location / {
root /home/wwwroot/default/blog/public;
index index.php index.html index.htm;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri $uri/ /index.php?$query_string;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /home/wwwroot/default/blog/public;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
}
location /static {
root /home/wwwroot/default/ann_tag/public;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
[error] 16957#0: *78 FastCGI sent in stderr: “Unable to open primary script:
2019/03/26 14:01:34 [error] 16957#0: *78 FastCGI sent in stderr: “Unable to open primary script: //home/wwwroot/default/blog/public/index.php (No such file or directory)” while reading response header from upstream, client: 36.110.147.197, server: localhost, request: “GET /index.php HTTP/1.1”, upstream: “fastcgi://unix:/tmp/php-cgi.sock:”, host: “”
啥几把文件权限限制,将站点根目录放到/home/wwwroot/default/blog
open_basedir的错误
将fastcgi.conf的这一行注释
#fastcgi_param PHP_ADMIN_VALUE “open_basedir=$document_root/:/tmp/:/proc/”;
[error] 23081#0: *8255 open() failed (13: Permission denied)
vim nginx.conf
修改user nginx为当前系统用户,如:user root
总结:先按照默认的安装配置跑通,再修改
安装samba在windows上编辑
yum install samba samba-client samba-swat -y
smbpasswd -a root
vi /etc/samba/smb.conf
[tmp]
path=/home/wwwroot/default/
browseable=yes
writeable=yes
valid users=root
service smb restart
参考:
安装samba https://blog.csdn.net/u012322925/article/details/51388159