Skip to main content

How to Localhost in laptop

Configure localhost in laptop(linux):
       First of all when i created my website, i am attached a database to the webpage i.e., when a person fills the data in the site it has to go to the database, i will tell in another post how to connect webpage to the database.
Now we came to know what is localhost?
         In my words localhost mean we have to run our website in our computer , and we have to act our computer like a server.In other words a local server which is deployed in your own computer .
 Basic Knowledge:
        To understand this you have a basic knowledge about what is port number and what is ip.
       and how a network is formed .

  •  Step1: open terminal by clicking ctrl+alt+t
  •  Step 2: Change the directory to the folder at where your html files are deployed by clicking cd <folder name> for example : cd web (where your folder present)
  •  Note :- Dont go to the folder , just go to the main folder where the files occured.
  • Step 3:- type" python3 -m http.server "it becomes like this 
  • step 4:- Go to the browser and type "localhost:8000" in first time it sets the default port to 8000 and the next time you have to change the port number  like 8899,4446 like any 4 digit number 
  • Eg : python3 -m http.server 7786 like any thing and in browser you have to check like localhost:7786.
  • And now your html files will load here  and now you are successfully .
  • And if you close the terminal then the server stops running.
  • Now the pyhton can act as a server so you doesn't need any special kind of plugins like apache server etc.

Comments

Popular posts from this blog

how to install flutter in linux mint:

What is Flutter?        Flutter is Google’s portable UI toolkit for building beautiful, natively-compiled applications for mobile, web, and desktop from a single codebase.   And Flutter have Many characteristics and you can see here .  How to Install it in your Linux Machine? You can download the Flutter package here . Extract the file in a separate folder.  cd ~/development  tar xf ~/Downloads/flutter_linux_v1.5.4-hotfix.2-stable.tar.xz Add the flutter tool to your path:  export PATH="$PATH:`pwd`/flutter/bin" And enter the code   flutter precache to check the flutter installed. And Run Flutter Doctor By the command   flutter doctor to see any folder is missing for that. (From Flutter.dev) Android Setup: Download and install the android studio . Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Platform-Tools, and Androi...

How to reduce your stress

These Things will reduce your stress Gradually: Remove sense of entitlement.' Exercise Daily Drink More Water Forgive First Give without expecting a get. Be a better friend. Quality time with Family Do not respond to negativity. Random acts of kindness. Get More sleep. Be Grateful Images from pexels.com by pedro figueras

How to install wordpress in linux

WordPress is a powerful, free and open-source, highly pluggable and customizable CMS that is being used by millions around the world to run blogs and fully functional websites. It is easy to install and learn, especially for persons who do not have prior website design and development knowledge. Step 1: Install Apache Web Server    To install apache server follow the instructions below     $ sudo apt-get install apache2 apache2-utils       Now we need to check whether it is installed or not     Go to the browser and type localhost if it is shown like this then no problem your apache is installed successfully   NOTE: The default Apache root directory is /var/www/html all your files are stored in the directory. STEP 2: Install MYSQL Database Server:    Now we need to install the MYSQL Database Server by running this command    $ sudo apt-get install mysql-client mysql-server During th...