php - Apache Configuration for laravel installation on directadmin -
i trying install laravel on vps direct admin. below apache config file
<virtualhost myip:80 > servername www.domain.com serveralias www.domain.com domain.com serveradmin webmaster@chat.am documentroot /home/mydir/domains/domain.com/public_html scriptalias /cgi-bin/ /home/mydir/domains/domain.com/public_html/cgi-bin/ usecanonicalname off <ifmodule !mod_ruid2.c> suexecusergroup mydir mydir </ifmodule> customlog /var/log/httpd/domains/domain.com.bytes bytes customlog /var/log/httpd/domains/domain.com.log combined errorlog /var/log/httpd/domains/domain.com.error.log <directory /home/mydir/domains/domain.com/public_html> php_admin_flag safe_mode off php_admin_flag engine on php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f chat$ php_admin_value mail.log /home/mydir/.php/php-mail.log php_admin_value open_basedir /home/mydir/:/tmp:/var/tmp:/usr/loc$ </directory> </virtualhost>
according laravel manual have point public
directory. after set doc root
/home/mydir/domains/domain.com/public_html/public
error when try access domain.com
500 internal server error
update: /var/log/httpd/domains/domain.com.error.log
contains laravel error
php parse error: syntax error, unexpected '[' in /home/mydir/domains/domain.com/public_html/vendor/laravel/framework/src/illuminate/support/helpers.php on line 411
firstly if have root access .. can check php version ...
php -v
upgrade php 5.4 .
i have installed laravel in directadmin using below .htaccess config file inside public folder ...
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> 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]
in direct admin can change apache config of document root specific domain inside
etc/httpd/conf.d/domians/yourdomian.conf
change ...
documentroot "/var/www/html/domians/yourdomain/public"
thats ;) should work fine ;)
Comments
Post a Comment