apache2.confmain configuration file for apache2 server.
ports.conThis file is used to specify the ports that virtual hosts should listen on. Be sure to check that this file is correct if you are configuring SSL.
conf.d/This directory is used for controlling specific aspects of the Apache configuration. For example, it is often used to define SSL configuration and default security choices.
sites-available/This directory contains all of the virtual host files that define different web sites. These will establish which content gets served for which requests. These are available configurations, not active configurations.
sites-enabled/ This directory establishes which virtual host definitions are actually being used. Usually, this directory consists of symbolic links to files defined in the "sites-available" directory.
mods-[enabled,available]/ These directories are similar in function to the sites directories, but they define modules that can be optionally loaded instead.
To easily manage, we shall create separate space for website.
Make Website Folder
Open teminal and follow commands
mkdir -p /var/www/sampleexample.com/public_html
public_html will hold all the website code.
Write website code
Make a new file index.php inside /var/www/sampleexample.com/public_html
Open editor of your choice and copy the php code given below.
Now it should work. And you will see following result
Well that’s it, with this now you are capable of hosting website on linux machine.
There is no software limit on the number of domain names Apache can handle.
You can create as many servers as you want. This ends the tutorials series.
If you face any issues, or have any suggestions do leave comment in section below.
That's all for now. Do leave suggestions, comments or questions in the comment section below. If you liked the tutorial,
share with your friends and spread the word.