Skip to content

Instantly share code, notes, and snippets.

View Faizanq's full-sized avatar

Faizan Qureshi Faizanq

View GitHub Profile
##Install Apache, MySQL, PHP on Linux generally called LAMP which needs to install together to host websites and dynamic web applications on server. Where Linux is operating system, Apache is web server, MySQL is database and content is processed with PHP scripting language.
sudo apt-get update
sudo apt-get install apache2
##Enable Required apache2 modes
sudo a2enmod headers proxy_http xml2enc proxy ssl proxy_wstunnel rewrite
//Open Ports on AWS
1->First Allow All TCP rules from anywhere
2->and Open port 80
//Now port forwading
1->sudo vim /etc/systctl.conf ==>enter
2->uncomment net.ipv4.ip_forward = 1 //line 28
3->save
1->sudo sysctl -p /etc/sysctl.conf // for activate the changes
Check if mod rewrite is enabled - sudo a2enmod rewrite
Give permissions to your storage and vendor folders - chmod 755 -R laravel and then chmod -R o+w storage
Check if you app.config has the environment variables set correctly including the 'url' . Set it to point to the right URL.
If you are using database ensure that you have your database.config set to the correct database for e.g. mysql. Set the database, user id and password
Go to /etc/apache2/sites-available/ and change your Document root to point to your Laravel public folder. (the one where you have your project installed)
Go to /etc/apache2 and use either of mcedit/vi/nano apache.conf and make the following modifications to /var/www/, you may also want to add this as an additional entry Assuming this is your DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All Require all granted
Restart your apache-> apachectl restart or use a command that you find to handy.
curl -O https://getcomposer.org/composer.phar
mv composer.phar composer
chmod +x composer
sudo mv composer /usr/local/bin
composer
https://github.com/topics/laravel-admin-panel
@Faizanq
Faizanq / Indian States and Cities list in php
Last active September 23, 2024 17:19
Indian States and Cities array list in php
<?php
return [
'Andhra Pradesh (AP)'=>[
'Adilabad',
'Anantapur',
'Chittoor',
'Kakinada',
'Guntur',
@Faizanq
Faizanq / app.js
Created November 15, 2018 13:18 — forked from narirou/app.js
express.js + pjax workflow
var express = require( 'express' ),
bodyParser = require( 'body-parser' ),
pjax = require( './pjax-helper' );
var app = express();
app.set( 'views', __dirname + '/views' );
app.set( 'view engine', 'jade' );
app.use( pjax() );
hooks : {
beforeCreate : (record, options) => {
record.dataValues.createdAt = Math.floor(Date.now() / 1000);
record.dataValues.updatedAt = Math.floor(Date.now() / 1000);
},
beforeUpdate : (record, options) => {
record.dataValues.updatedAt = Math.floor(Date.now() / 1000);
}
}
app.get('/*', function(req,res,next) {
req.session.flash = [];
next();
});
var values="Test,Prof,Off";
$.each(values.split(","), function(i,e){
$("#strings option[value='" + e + "']").prop("selected", true);
});