Setup a Local Web Server on Windows, Mac, and Linux

When developing a web site, a web designer needs to be able to see his webpages in the like room the end exploiter would. sometimes merely clicking on and viewing your HTML files in the network browser is enough, but if you want to test dynamic capacity, you will need to set up a local anesthetic web waiter. Doing this is quite dim-witted and can easily be accomplished on Windows, macOS, and Linux. There are many types of web servers available, but we use Apache in this tutorial, as it is the most common server about, identical easy to set up, and compatible with all major operating systems .
Also read: 6 of the Best Static Website CMS for You

Set up a local web server on Linux

Apache was designed for Unix-like operating systems. Linux falls under this category, and the initiation and shape of an Apache webserver can be done in one step.

here we deal with the dominate line. Most popular distributions allow you to install Apache without compiling it from source using one simpleton dominate .
For Debian, Ubuntu, and Ubuntu-based distro:
For Red Hat and CentOS
once installed, navigate in your web browser to either “ ” or “ localhost. ” If it displays “ It Works ! ” that means your Apache facility is successful .
Web Server Ubuntu Install ApacheWeb Server Ubuntu Install Apache To better understand how Apache is serving this detail web page, let ’ s edit it. To do this, navigate to the root world wide web directory of your Linux local machine .
open “ index.html ” as root with your favorite textbook editor program .
search for “ It Works ! ” and change the text to something random like “ Make Tech Easier ! ” ( It could be anything in truth. ) Make certain to save the file .
now refresh the web page on You should see “ Make Tech Easier ! ” where “ It Works ! ” was once .
Web Server Ubuntu Edit DefaultWeb Server Ubuntu Edit Default now that you have set up a simpleton network waiter, you can play with the configuration settings in “ apache2.conf. ”
Note : be aware that every time you make a configuration change, you will need to restart Apache for it to apply .
If this does not work, you can restart it by immediately executing the kip charge .
Also read: How to Generate SSL Certificates on Linux Using OpenSSL

Set up a Local web server on macOS

The effective thing about macOS is that Apache is installed on it by default. All you need to do is turn it on .
In Finder, go to “ Applications – > Utilities, ” then double-click on Terminal to open it .
Macos Open Terminal AppMacos Open Terminal App To turn on your already pre-installed Apache web server, run the stick to command :
To test that our web server is running, voyage to “ ” or “ localhost ” in your web browser .
Macos Web Server It WorksMacos Web Server It Works We can change the content of the web page by just navigating to the document root the lapp direction we did in Linux. The lone matter that is different is the path location .
now edit the “ index.html.en ” file using your front-runner text editor. Change “ It works ! ” to “ Hello World ! ”

mac-nano-open-index-htmlmac-nano-open-index-html If we refresh our web page hosted on, we now see the changes reflected .
Macos Web Server Hello WorldMacos Web Server Hello World To promote configure Apache world wide web server under macOS, navigate to the “ httpd.conf ” file .
Like Linux, you can well restart the Apache avail using the apachectl command with root privileges .

Set up a local web server on Windows

Unlike Linux and macOS, Windows is not Unix-based, so there is no one-liner to install it. fortunately, there are respective install wizards that bundle things like Apache, MySQL, and PHP together to make our lives easier. One of them is XAMPP .
Note : XAMPP is available for Linux and Mac OS X, excessively .
Download the Windows translation of XAMPP and begin the initiation. Execute the installer when prompted. You can select only Apache if all you need is a web server. however, if you are planning on using a database, you may want to select MySQL a well .
Windows Xampp InstallerWindows Xampp Installer Continue through the installation and chatter “ Finish ” when complete. By default, the XAMPP see panel will be launched .
Windows Xampp Config PanelWindows Xampp Config Panel Click “ Start ” for Apache and MySQL, if needed .
If you navigate to “ ” or “ localhost ” in your network browser, you should see the XAMPP configuration page .
Windows Xampp Webpage Configuration 1Windows Xampp Webpage Configuration 1 To create a new web page, the operation is the same. open notepad and create a sample HTML file. mention it “ hello.html. ”
Windows Notepad HelloWindows Notepad Hello Save it in the document ancestor located in “ degree centigrade : \xampp\htdocs\ ” .
navigate to it using your web browser by going to You ’ ll be able to see the web page you created .
Windows Xampp Webpage HelloWindows Xampp Webpage Hello Note: WampServer is another solid choice for installing Apache on Windows .
Also read: How to Install and Run the Nginx Server on Windows


Apache is an excellent solution for building both simpleton and complex websites, but it is not the only choice. While Apache integrates well across all three platforms, you may want to look at IIS as an option for Windows, as it supports many Windows authentication features that Apache does not. however, for just testing the base functionality of a web site, Apache is perfective .
subscribe to our newsletter !

Our latest tutorials delivered square to your inbox
Sign up for all newsletters .

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

source :
Category : Tech

About admin

I am the owner of the website, my purpose is to bring all the most useful information to users.

Check Also


Manage participants in a zoom meeting webinar

Call the people who attend the meet as follows Alternate host host Who scheduled the …

Leave a Reply

Your email address will not be published.