Php Install Laravel为Apache提供了默认主页

Php Install Laravel为Apache提供了默认主页,php,apache,ubuntu,laravel,nginx,Php,Apache,Ubuntu,Laravel,Nginx,我用Digital Ocean买了一台服务器,现在已经试着安装Laravel两天了。主教程和结果为我提供了一个Apache2 Ubuntu默认页面。当我转到IP地址时,它会给我一个欢迎使用NGINX页面。我需要让这个服务器在接下来的几个小时内运行起来,我和我的合作伙伴正在做一个推销,但它不起作用 有人知道一个补丁吗 此外,NGINX将不会重新启动。它说,*重新启动nginx nginx[fail],当我这样做时,nginx-t它说: nginx: the configuration file /

我用Digital Ocean买了一台服务器,现在已经试着安装Laravel两天了。主教程和结果为我提供了一个
Apache2 Ubuntu默认页面
。当我转到IP地址时,它会给我一个
欢迎使用NGINX
页面。我需要让这个服务器在接下来的几个小时内运行起来,我和我的合作伙伴正在做一个推销,但它不起作用

有人知道一个补丁吗

此外,NGINX将不会重新启动。它说,
*重新启动nginx nginx[fail]
,当我这样做时,
nginx-t
它说:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

当我说
sudo服务nginx restart

在尝试运行nginx之前,请确保卸载所有apache2内容时,它给出了相同的结果

sudo apt-get remove apache2 apache2-utils
sudo service nginx start

从服务器中删除apache2并以@Sw0ut的形式启动nginx,然后通过键入服务nginx start启动nginx打开位于的nginx.conf文件

/etc/nginx/sites-available/default
并进行适当的更改,可能会有效

server {
listen       80;
server_name  localhost;

root   /location/to/your/www/public/folder;
index index.php index.html index.htm;

#charset koi8-r;
#access_log  /var/log/nginx/log/host.access.log  main;
error_log  /var/log/nginx/nginx_error.log  warn;

location / {
    #try_files $uri $uri/ /index.php;
    try_files $uri $uri/ /index.php$is_args$args;
}

#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   /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}


location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass            unix:/location/to/php5-fpm.sock;
    fastcgi_index           index.php;
    include                 fastcgi_params;
    fastcgi_param           SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root           html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_index  index.php;
#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
#    include        fastcgi_params;
#}
}
unix:/location/to/php5-fpm.sock;在大多数情况下,php5 fpm的位置将是/var/run/php5-fpm.sock

另外,如果chmod 755/app/storage文件夹不起作用,请尝试777


如果不起作用,请重新启动nginx停止nginx并启动它

查看nginx错误日志。