2016-07-14 114 views
1

我最近開發了我的第一個Laravel應用程序(5.2版)。在Ubuntu服務器上託管Laravel應用程序

我現在想要在運行Ubuntu的客戶端服務器上託管應用程序。

他們的管理員負責管理,安裝和運行的工作只是正常的服務器上的本地Laravel應用程序,但是當我來到複製和粘貼我自己的應用程序了,瀏覽器返回:

403禁止

的nginx/1.4.6(Ubuntu的)

直接訪問公共文件夾(www.example.com/public/index.php)瀏覽器返回:

www.example.com頁面無法正常工作

www.example.com目前無法處理此請求。

HTTP錯誤500

可有人請幫我與託管我的應用程序的正確方法是什麼?

回答

0

首先保存裏面的文件,

無功/ www/html等/

然後使用終端去你的文件夾
cd var/www/html/your_folder

運行Laravel應用

sudo php -S localhost:8888 -t public 

確保您的端口號與運行在服務器中的其他Laravel實例不同。

2

看起來更像是一個nginx問題。嘗試將您的nginx虛擬主機配置更改爲此。

server { 
     listen 80; 
     server_name yoursite.tld 

     root /var/www/yoursite/public/; 
     index index.php index.html index.htm; 

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

     # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock 
     location ~ \.php$ { 
       try_files $uri /index.php =404; 
       fastcgi_pass unix:/var/run/php5-fpm.sock; 
       fastcgi_index index.php; 
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
       include fastcgi_params; 
     } 
} 
相關問題