Sunday, August 23, 2015

ApiGen with Laravel 5

Credit to : http://rajendra-kc.com.np/blogs/Gossip/using-apigen-with-laravel-5/7

Download and Install APIGen in Your Linux by the following command
wget http://apigen.org/apigen.phar 

Make it executable 
chmod +x apigen.phar 

Move it to /usr/local so that it can be used gloablly
mv apigen.phar /usr/local/bin/apigen 

Now supply the following commands, If you installed correctly, it will show you version number
apigen --version 


Now to make laravel api code documentation hit he code below. It will genertae HTML files in the specified folder
apigen generate -s ./app --exclude=*/Commands/*,*/Console/*,*/Events/*,*/Handlers/*,*/Exceptions/*,*/Providers/*,*/Services/* -d public/api --no-source-code

Another example
apigen generate -s ./app/Http -d public/api  --no-source-code --title "ewCMS Enterprise Documentation"

Wednesday, August 19, 2015

Setup Virtual Host On Ubuntu Server

First - need to make permissiom

 sudo chmod -R 755 /var/www

Second -  Create Bew Virtual Host File

The file locate in

/etc/apache2/sites-available/000-default.conf

Duplicate the file

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf

Then edit file using nano

 sudo nano /etc/apache2/sites-available/example.com.conf

File will look like this

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Edit the line to this:

ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html

The file will look like this

<VirtualHost *:80>
    ServerAdmin admin@test.com
    ServerName test.com
    ServerAlias www.test.com
    DocumentRoot /var/www/test.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Third - Enable the Virtual Host File

sudo a2ensite example.com.conf
Then restart apache
sudo service apache2 restart
Then Set Up Local Hosts File
sudo nano /etc/hosts
The file will look like this:

127.0.0.1   localhost
127.0.1.1   guest-desktop
111.111.111.111 example.com