In this tutorial you are going to learn How to host a website in Apache Web Server Ubuntu.
Prerequisite
How to install Apache Web Server in Ububtu
1. Create a folder for the website that you want to host in var/www/html
You can run the following command to go to html folder in ubuntu
We have a Spring Boot (Spring MVC) app with embedded Tomcat on a dedicated appserver behind an Apache SSL proxy. The SSL port on the proxy server is 4433, forwarding to port 8080 on the appserver. So the URL to the proxy server is forwarding like. Course, focused on the fundamentals of Spring 5 and Spring Boot 2: The Spring RestTemplate with SSL (HttpClient Spring Boot. So far I am enjoying it. I have developed a demo SSL rest web server that correctly handles mutual X.509 certificate authentication. Using an IE browser with self signed.
2. Create site directory in html folder
for example i created a directory example.com in html folder. To create a directory in html directory run the following command
Output
Now create a sample page in var/www/html/example.com run the following command
Copy and Pase the following code in index.html and press CTRL + X and then type Y and press Enter to save the file
3. Host a website in apache
To host a website navigate to apache installation directory. The default installation directory is etc/apache2. Run the following command to go in the apache directory
now navigate to the sites-avalable directory which is located in etc/apache2. Run the following command
Output
4. Edit example.com.conf and make changes as mention below
To edit the example.com.conf site run the following command
Now replace the content of example.com.conf with following code
5. Now enable the site in apache server
To enable the site in apache run the following command
6. Restart apache server
Run the following command to restart the apache server
Add your server ip address in your domain and wait for few minutes then enter domain name in your browser
i.e example.com
Web Server Tutorial: What is Web Server
Web server is server software that responds to the request for web resources. A web server processes incoming network requests over related protocols. A web server’s primary function is to store, process, and deliver web pages to clients. The client and server both communicate through HTTP (Hypertext transfer protocol). Pages delivered are mostly HTML documents. These documents may include images, style sheets, and scripts in addition to the text content.
A web server is used to host the websites, but some servers are also meant to be for gaming, storage, FTP, email, etc.
Definition
A web server is a computer that delivers content or services to end-users over the internet. It consists of a physical server, server operating system, and software to facilitate HTTP (Hypertext transfer protocol) communication. A web server is also called an internet server.
Types of Web Servers
Some leading web servers are:
Spring Boot Apache Web Servers
- Apache
- IIS (internet information server) by Microsoft
- nginx from NGNIX
- NetWare server by Novell
- Sun java system web server
- GWS by Google
- Family of domino server by IBM
Web servers are the part of a larger package of internet and intranet related programs.
In this tutorial, we have included:
The server’s primary purpose is to store website files and content and availed them over the internet for site visitors. It handles server-side programming. It provides services for emailing, downloading requesting for FTP files, and builds and publishes web pages. It is a powerful computer for storing and transmitting data via the internet.
The need for the web server
Web server is the backbone of the internet. Web server is a gateway between the end-user and the World Wide Web.
Without a web server, as we know, the internet is nothing. It is an integral part of inter-networking. Nowadays, the web hosting industry is used to lease out the servers. It is the opportunity to use high-tech servers and expand their outreach to the entire world. Web server’s plans start only some amount of rupees.
Working
It deals with the request made from the internet. It performs the task after getting a request as follows:
- Accepts the request made
- Check the request
- Estimate what other applications need to run to access the files requested
- Completes the task
- Sends back the answer client
Pricing
How much the web server costs?; it is a general question often asked by the users. So the web server hosting typically costs $10 $15 per year depended on the type of web hosting.
There are two types of web servers
- Dedicated server
- Shared Server
A shared web hosting costs $36 to $120 per year. The expected price that we have to pay is $46 – $135 per year for a domain name and hosting. However, some hosting companies allow us to host the server for free.
In a nutshell, the price of a web server is dependent on the type of web hosting.
Web Server VS Application Server
A web server accepts clients’ requests and fulfills them and responds them into different formats such as HTML pages, files, images, and videos from a website. It handles HTTP requests and responses only.
Comparatively, An application server reveals the clients’ business logic, which is useful for generating dynamic content. It is a software component used to transform the data and provide the specialized functionality of business, service, or application. Further, it enhances the interactive parts of a website that can appear differently depending on the request’s context.
Consider the below diagram, which is explaining the web server and application server:
Let’s understand head to head comparison between the web server and application server:
Web Server VS Database Server
The web server and Database server both uses the different languages to process the requests. The web server uses the HTTP, PHP, ASP, JSP, or any other language to process the request. Any web browser can locate the web server. Comparatively, the database server has its specific programming language or query language, which is used by it. It does not have a common language to interact with.
The database is used to organize the collected data, and the server is used to managing the resources via the web. So the database server is a software that backups the data and files of other PCs. The database server is also known as the client-server model. It manages the data through DBMS (Database Management System). Every database has its language that executes the tasks, which is also known as the query language.
The Database servers are capable enough to analyze, store, and archive the data. The database server is also useful for storing the data in one place. For example, if we are using the oracle, all the oracle data is saved in one place by the database management system.
Let’s see head to head comparison of the web server and database server.
Leading Web Servers
Apache Web Server Windows
Some Lading web servers are as follows:
Apache
The Apache HTTP Server, also known as Apache, is a free and open-source web server software available for all major platforms. It is released under the terms of Apache License 2.0. The Apache web server is developed and maintained by an open community of developers under the Apache Software Foundation‘s supervision. For more detail, visit the Apache foundation.
IIS (internet information server) by Microsoft
The IIS (Internet Information Services), formerly known as Internet Information Server, is an extensible web server. It is developed and maintained by Microsoft for use with the Windows NT family. It supports HTTP, HTTP/2, HTTPS, FTP, FTPS, SMTP and NNTP protocols. The IIS is an integral part of the Windows NT family. For more detail, Visit The Official Microsoft IIS.
NGNIX
NGNIX is a high-performance load balancing web server. It is open-source software that provides web serving, reverse proxying, caching, load balancing, media streaming, etc. from the beginning, it started as a web server suitable for maximum performance and stability. Further to its HTTP server capabilities, it can also function as a proxy server for email (IMAP, POP3, and SMTP). It can also be used as a reverse proxy and load balancer for HTTP, TCP, and UDP servers. For more detail, visit Official NGNIX.
NetWare server by Novell
NetWare is a discontinued computer network operating system developed by Novell, Inc.
The NetWare server manages the data transfer among the network devices, stores, and retrieves data from hard disks; it is capable enough of managing multi-file systems. Further, it ensures data integrity, manages printers and printing, and allocates and manages memory. The NetWare server is designed in a way that it can operate either a uni-processing or multiprocessing system. For more detail, Visit Novell.
Sun Java system web server
Sun Java System is a Sun Microsystem’s brand which is used for marketing computer software.
The Sun Java System Web Server provides a modular architecture that integrates seamlessly with all products in the family of Sun Java System software. Also, version 6.1 supports several APIs and programming technologies that enable us to do the following:
- It allows us to generate dynamic content in response to client requests
- It allows us to modify and extend the behavior of the server
- It allows us to modify the content stored in the server
for more detail, Visit Oracle.
GWS By Google
GWS stands for Google Web Server; it is proprietary web server software used by Google for its web infrastructure. It is used exclusively inside Google’s ecosystem for website hosting. It is described as one of the most guarded components of Google’s infrastructure.
In 2010 GWS was reported as serving 13% of all websites in the world. It was also ranked as fourth In May; it was led by Apache, Nginx, and Microsoft IIS, powering an estimated 7.95% of active websites. Most of the web page requests on Google pages provide “GWS” in the HTTP header. For more detail, Visit Google cloud.
FAQs
Some Frequently asked questions on servers are as following:
What is a web server?
A web server is a computer that delivers content or services to end-user over the internet. It consists of a physical server, server operating system, and software to facilitate HTTP (Hypertext transfer protocol) communication. A web server is also called an internet server.
What are the different types of web servers?
Some leading web servers are:
- Apache
- IIS (internet information server) by Microsoft
- nginx from NGNIX
- NetWare server by Novell
- Sun java system web server
- GWS by Google
- Family of domino server by IBM
Is Google a Server?
Google Inc is a collection of different services. It also provides cloud services means it also has a server called GWS.
Is AWS a Server?
Yes, AWS ( Amazon Web Services) is a cloud hosti8ng service provided by Amazon.
What does Apple use for servers?
Apple is currently using the AWS and Microsoft’s Azure for its content serving needs, including iTunes and iCloud.
Which is the fastest web server?
Below are some fastest web servers in the world?
- Apache
- Nginx
- Lighttpd
- Varnish
- Squid