Linux Shell Scripting for Virtual hosting

shell scripting

Hello Guys,

Today we will discuss the shell script code for Apache Virtual Hosting.

Actually, I was working on the different multiple applications to install on my local server and every time I need to execute all the commands and sometimes I forgot to execute some commands or forgot the process So I plan to create a shell script for this and I had written this code.

Now We will discuss how to execute this command. For this copy all the command and make a shell script file. I had created a shell script and saved it as
Let’s execute this file using the sh command.

First It will ask for virtual host file name. Please provide the file name with .conf extension.
Next, it will ask for the server name means how you will access your web application on browser.Suppose I had given
Next, it will ask for the folder name. You need to provide the already created folder name in your /var/www/html directory.
Suppose I already have /var/www/html/magento folder then I will give magento.
After providing all 3 inputs It will show you the message on screen “Successfully created!”.
After this open the browser and type in address bar and now you can access your magento application.

1 Comment

  1. Ajay

    This really help me alot.



Leave a Comment

Your email address will not be published. Required fields are marked *

Optimization WordPress Plugins & Solutions by W3 EDGE