将laravel部署到NAS

时间:2016-08-11 15:44:14

标签: php apache laravel synology

在过去的两周里,我一直在缠着我的脑袋。

我试图将我的laravel 4.2应用程序部署到我的服务器,但无法通过主页。在我的本地主机上一切正常。

当我点击链接时,我收到404错误。

我已经将我的httpd.conf文件设置为:AllowOverwride All 我还将我的htacces文件放在公共文件夹中。

我的routes.php:

     Route::get('/', function()
{
    return View::make('index');
});


//Contact Page
Route::get('contact', 'ContactController@getContact');
Route::resource('producten','ProductsController');
//Form request:: POST action will trigger to controller
Route::post('contact_request','ContactController@getContactUsForm');
Route::get('info', function()
{
    return View::make('info');
});

Route::get('diensten', function()
{
    return View::make('diensten');
});

Route::get('tarieven', function()
{
    return View::make('tarieven');
});

paths.php档案的一部分:

|--------------------------------------------------------------------------
    |
    | The public path contains the assets for your web application, such as
    | your JavaScript and CSS files, and also contains the primary entry
    | point for web requests into these applications from the outside.
    |
    */

    'public' => __DIR__.'/../public',

    /*
    |--------------------------------------------------------------------------
    | Base Path
    |--------------------------------------------------------------------------
    |
    | The base path is the root of the Laravel installation. Most likely you
    | will not need to change this value. But, if for some wild reason it
    | is necessary you will do so here, just proceed with some caution.
    |

htacces文件:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
Options +FollowSymLinks
    RewriteEngine On
RewriteBase /
    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ public/index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

Httpd.conf文件:

User http
Group http

NameVirtualHost *:80
NameVirtualHost *:443

ServerAdmin admin
ServerName *

<VirtualHost _default_:80 _default_:443>
DocumentRoot "/var/services/web/pcvoorne.nl/public"
Include conf/extra/mod_fastcgi.conf
</VirtualHost>

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

<Directory "/var/services/web">
    Options MultiViews FollowSymLinks ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.cgi index.php index.php5
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /run/apache22-error_log
#ErrorLog /dev/null
TraceEnable off

我缺少什么让这项工作? 希望你能帮助我:))

1 个答案:

答案 0 :(得分:0)

抱歉要确认一下:安装了mod_rewrite吗?很高兴看到404错误的更多细节。你看到'/'上的索引吗?