Home / 2015 / July

Monthly Archives: July 2015

WordPress Custom Post

WordPress has been gaining a foothold in the general content management system (CMS) game for a few years now, but the real breakthrough was the custom post type mechanism which allows for the creation of a wide variety of content in WordPress. In this plugin Custom Post For WordPress you can easily created your custom post like audio,video and portfolio…etc

==== Installation ====

  • Download Custom Post For WordPress.
  • Upload the Custom Post For WordPress directory to your /wp-content/plugins/ directory, using your favorite method (ftp, sftp, scp, etc…)
  • Activate Custom Post For WordPress from your Plugins page. (You’ll show “WPCustomPost” Menu in your admin sidebar.)
  • Then add new for WPCustomPost
  • After post has been created successfully then add new (post or page), then simply add shortcode [khan] in your post or page, You’ll show your all custompost 🙂

see more here

How to install Laravel 5 with Virtual Host configurations

I am sharing steps below with terminal command run screenshots that how to install laravel5 with Virtual Hosts configurations. we need to install composer to download laravel from remote server. for this first command will be for download composer using curl then second one move composer to local user directory for make composer globally use .

# installing composer
curl -sS https://getcomposer.org/installer | php
# move composer globally
sudo mv composer.phar /usr/local/bin/composer
# check composer working
composer

Composer

Now we’ve composer installed successfully!!. and then there are two method to install laravel
1. Via Laravel Installer
2. Via composer

1. Via Laravel Installer :

laravel installer is a new method to install added for laravel 5. it’s much faster method than installing via Composer.

# Download installer

Rasel Khan:~$ composer global require "laravel/installer=~1.1"
Changed current directory to /home/khan/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

#Setting up path

Rasel Khan:~$ export PATH="~/.composer/vendor/bin:$PATH"

# If you’ve successfully configure then command type ‘laravel’ , you’ll see your laravel installer version 1.2.1

Rasel Khan:~$ laravel
Laravel Installer version 1.2.1

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help  Displays help for a command
  list  Lists commands
  new   Create a new Laravel application.

#Change dir where to install

Rasel Khan:~$ cd /var/www/project/

# Download and installing

Rasel Khan:~$ laravel new laravel5

# giving permission

Rasel Khan:~$ sudo chmod -R 777 laravel5

2. Via Composer :-

After install composer you can directly install laravel by create-project command and give your destination path where you want to install laravel.

# checking composer is successfully installed

Rasel Khan:~$ composer

# Create a ditectory where to install

Rasel Khan:~$ sudo mkdir /var/www/project/laravel5
[sudo] password for khan: 

# downloading and install via composer

Rasel Khan:~$ sudo composer create-project laravel/laravel /var/www/project/laravel5

# setting up writable permission

Rasel Khan:~$ sudo chmod -R 777 /var/www/project/laravel5

Another way you can do manually download and install

Now, let’s go configure with Virtual Hosts, create a config file into /etc/apache2/sites-available/ directory, i’ve create this file name called laravel5.com.conf, another way you’ll use Vagrant environments

Rasel Khan:~$ sudo mkdir /etc/apache2/sites-available/laravel5.com.conf

# now open laravel5.com.conf file using any editor, I’m using nano editor .

Rasel Khan:~$ sudo nano /etc/apache2/sites-available/laravel5.com.conf

# past below this code into laravel5.com.conf file and save .


<VirtualHost *:80>
    ServerName laravel5.dev
    DocumentRoot "/var/www/project/laravel5/public/"
    DirectoryIndex index.php
    <Directory /var/www/project/laravel5/public/>
        AllowOverride All
    </Directory>
</VirtualHost>

# Enable this file

Rasel Khan:~$ sudo a2ensite laravel5.com.conf

# Reload apache server

Rasel Khan:~$ sudo service apache2 reload

# go to hosts file

Rasel Khan:~$ sudo nano /etc/hosts

# create a new one 127.0.0.1 laravel5.dev

127.0.0.1       localhost
127.0.1.1       raselkhan
127.0.0.1       symfony.dev
127.0.0.1       laravel5.dev

# If you’ve all configuration is ok then need to restart your server

Rasel Khan:~$  sudo service apache2 restart

# now go any browser addressbar url and type

http://laravel5.dev/

you’ll see laravel5 successfully install and configuration with virtual hosts.

laravel5

Enjoy 🙂