본문 바로가기
IT라이프

Laravel 5 루트 설정

by zairan 2015. 5. 30.

AWS 에 아파치2.4 를 돌리고 있는데, 거기다가 laravel 5 를 배치했다. 


하지만 허거덩, 찾을 수 없는 경로 에러가 나면서 안되는 것이었다.


좀 찾아본 결과.


http://127.0.0.1/laravel/public/index.php/home 


이런식으로 index.php 를 넣어야 그 담부터 처리를 하고 있었다. 뭐...당연한 프레임워크의 사양일 수도 있는데,

index.php 다음으로 라우트를 처리하는 것은 꼴베기 싫기 때문에 


sudo vi /etc/httpd/conf/httpd.conf


를 조금 손보기로 했다.


<Directory "/var/www/html">

    132     #

    133     # Possible values for the Options directive are "None", "All",

    134     # or any combination of:

    135     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    136     #

    137     # Note that "MultiViews" must be named *explicitly* --- "Options All"

    138     # doesn't give it to you.

    139     #

    140     # The Options directive is both complicated and important.  Please see

    141     # http://httpd.apache.org/docs/2.4/mod/core.html#options

    142     # for more information.

    143     #

    144     Options Indexes FollowSymLinks

    145 

    146     #

    147     # AllowOverride controls what directives may be placed in .htaccess files.

    148     # It can be "All", "None", or any combination of the keywords:

    149     #   Options FileInfo AuthConfig Limit

    150     #

    151     AllowOverride All

    152 

    153     #

    154     # Controls who can get stuff from this server.

    155     #

    156     Require all granted

    157 </Directory>


151 행 저부분이 해결방법. 즉 .htaccess 가 잇으면 그것으로 오버라이딩 한다는것 같은데.

결론은 됐다...휴...


.htaccess 


<IfModule mod_rewrite.c>

Options +FollowSymLinks

    RewriteEngine On


    # Redirect Trailing Slashes...

    # RewriteRule ^(.*)/$ /$1 [L,R=301]


    # Handle Front Controller...

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^ index.php [L]

</IfModule>

반응형

'IT라이프' 카테고리의 다른 글

PHP 리팩토링(2)  (0) 2015.06.04
PHP 리팩토링(1)  (0) 2015.06.04
[PHP 보안] 2. 웹 어플리케이션 보안 (2)  (0) 2015.05.09
[PHP 보안] 2. 웹 어플리케이션 보안  (0) 2015.05.09
[PHP 보안] 1. 로그인  (0) 2015.05.01

댓글