How To Create A Virtualbox Web Service On The Server
The Apache HTTP Server (commonly referred to simply as Apache), is a free and open-source web server software brought to you past the Apache Software Foundation. Apache has been around for more than two decades and is considered beginner-friendly.
In this tutorial, yous will learn how to install an Apache webserver to host a unproblematic HTML website running on a Linux platform.
Install Apache Web Server in Linux
On Ubuntu Linux and other Debian-based distributions such every bit Linux Mint, Apache can be installed with the post-obit command.
$ sudo apt install apache2 -y
On Crimson Hat Enterprise Linux and related distributions such every bit CentOS, Fedora, and Oracle Linux, Apache can be installed with the post-obit command.
$ sudo dnf install httpd -y
On Ubuntu Linux and other Debian-based distributions, you tin can showtime and check the status of the Apache webserver past running the commands beneath.
$ sudo systemctl get-go apache2 $ sudo systemctl condition apache2
On Red Hat Enterprise Linux and related distributions, run the following commands to start and check the status of Apache.
$ sudo systemctl commencement httpd $ sudo systemctl condition httpd
In one case you have confirmed that Apache is agile, open up a spider web browser and enter the IP accost of your Linux server. You may besides enter localhost in place of your server IP.
You lot should run across a test folio that confirms that Apache is up and running properly.
http://IP-Addresss OR http://localhost
Host a Simple HTML Website on Apache
After you have confirmed that Apache is working properly, you are now prepare to add your website content. On Apache, the default location where publicly attainable spider web content is stored in /var/www/html. This is ordinarily referred to equally the website root.
The start page that is loaded when users visit your website is called the index page. Let us create one equally follows.
Firstly, modify into the website root with the command below.
$ cd var/world wide web/html
On Ubuntu Linux, run the command beneath to rename the default index page file.
$ sudo mv index.html alphabetize.html.bk
On Carmine Hat, there is nothing to rename here as the default index page file is non stored in this location.
Adjacent, create a new index file with:
$ sudo nano index.html
Copy and paste the sample HTML code below into the open up text editor.
<!DOCTYPE html> <html> <head> <title>Welcome to My Website!</title> <meta charset="UTF-8"> </head> <body> <h1>Linux Shell Tips</h1> <p>This website is hosted on Apache.</p> </trunk> </html>
Save and close the index.html file.
Now, go back to your web browser and refresh the page. You should see your new website every bit shown in the epitome below.
Manage Apache Web Server in Linux
Every bit nosotros wrap upward this tutorial, allow usa highlight some basic commands for managing Apache in addition to the ones that we have already used. As you may have noticed, the Apache web service is referred to as apache2 on Ubuntu while it is called httpd on Red Hat Linux.
To configure Apache to automatically start when the Linux server is rebooted, run:
$ sudo systemctl enable apache2 $ sudo systemctl enable httpd
To disable automatic starting of Apache when the Linux server is rebooted, run:
$ sudo systemctl disable apache2 $ sudo systemctl disable httpd
To restart Apache, run:
$ sudo systemctl restart apache2 $ sudo systemctl restart httpd
To cease Apache, run:
$ sudo systemctl stop apache2 $ sudo systemctl finish httpd
Conclusion
In this tutorial, we have described how to install Apache on Ubuntu Linux besides as Red Chapeau Linux. We also showed you how to replace the default Apache web folio with your own content.
How To Create A Virtualbox Web Service On The Server,
Source: https://www.linuxshelltips.com/install-apache-in-linux/
Posted by: jacksontallay.blogspot.com

0 Response to "How To Create A Virtualbox Web Service On The Server"
Post a Comment