Setup laravel, mongo and solr website on centos 7 having apache and php56

1. Install git
yum install git

2. Install composer
curl -sS | php
chmod +x composer.phar
mv composer.phar /usr/local/bin/composer
composer -V
References :

3. Install gcc
yum install gcc

4. Install mongo (php extension)
yum groupinstall “Development tools” -y
yum install openssl-devel
pecl install mongodb

5. Adding mongodb to php.ini
php -i | grep “Loaded Configuration File”
nano /etc/php.ini
Add the following line
/usr/sbin/apachectl restart
References :

chmod -R o+w storage
composer install
composer dumpautoload -o
php artisan config:cache
php artisan route:cache
References :

php artisan cache:clear
sudo chmod -R 777 vendor storage
References :

8. Redirect to /public using .htaccess

sudo nano /etc/httpd/conf/httpd.conf
Find the section <directory /var/www/html> and change AllowOverride None to AllowOverride All

<Directory /var/www/html>
AllowOverride All
Save and exit.

Create .htaccess in the root of your web directory with the following contents :

DirectorySlash Off
RewriteEngine on
RewriteRule ^(.*)$ public/$1

Now restart Apache to put the change into effect:
systemctl restart httpd
References :

9. Creating Solr core
sudo -u solr bin/solr create -c video2
References :

10.  Enabling gzip on apache
Add the following to .htaccess file

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
Reference :

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s