Creating a virtual host Ubuntu

Let’s create a virtual host in Ubuntu machine.

What do you need ??

  1. A Ubuntu Machine
  2. Need install xampp on your Machine

Now open your terminal and start your xampp below command

Hope your local server is working.

Now you can stop your server

Now You need to run below command in your terminal

Your httpd.conf file open Ubuntu text editor , Now you need to find this line. It may be 488 number lines

Now delete the hash tag form this

The line should look like this. One more thing if your text editor does not run then you can go below location and edit the httpd.conf

Now, You need to open httpd-vhosts.conf file in your text editor (such as sublime). You can open the httpd-vhosts.conf file by below command or you can go manually extra folder and find the httpd-vhosts.conf and open your text editor.

All right. Now in your httpd-vhosts.conf file add below code

Let’s explain above code,

127.0.0.1 this is called IP address , and after colon 80 is called protocol or short form is PORT . DocumentRoot is a identify of the location your files. I created vubon.dev in htdocs folder and put some web files there. or you can create PHP file there for testing purpose. Let’s create a PHP file. File name is index.php

Directory is indicated of vubon.dev folder files what can do .

That’s all . Next we need to add a virtual domain against 127.0.0.1 this IP. Now you need to run below command in your terminal

Or you can go etc folder and find hosts file . Now you need to add below things and save the file.

Now re-start your xampp . If you need to more virtual domain then you can go this process . But in IP address change below types

So on . Hope every one can understand . If you have any problem then throw a comment . Happy Coding !!

 

 

Match URL and add a new class in URL or Parents DIV

Okay, I am going to show you How cloud we do it ?? Let’s start

  1. Firstly you need to add a jQuery in your HTML file or according to your working file. Click here 
  2. You can add the jQuery file in before your body tag end.
  3. Sample HTML
  4. Now add this code
  5. Above the jQuery code only add the active class in your URL . But if you need to add class in parent div then you must add this code

    suppose we want to the active class inside menu class. For this reason, I added menu class in parents .
  6. In this way, you can add an active class in your menu or other div .

    That’s all . Enjoy Happy coding .

Copy file from live server to live server by PHP

Hello Guys , Let’s copy zip file from live server to live server or local server such as XAMPP or other local server. It is very easy to copy zip file from live server by PHP copy function.