0

I am new in Linux mint. Previously I used LAMP stack in Windows. In Linux Mint I am using VirtualHost means I have to create a file named sitename.conf in /etc/apache2/sites-available location for each Website or Web Application. But I didn't use anything like these in Windows.

Is it mandatory to use VirtualHost in Linux Mint ? or I am doing anything wrong ? Why I have to use VirtualHost ?

1

There are a million different ways to configure Apache and what you have stated sounds like a possible solution for multiple sites, but not what I would personally use.

I'm a little confused as to why you might use Linux Mint, a desktop Linux distribution for a web server, but I assume you know what you are doing. Maybe you want a test environment for development work.

The <VirtualHost> directive is used for hosting for multiple sites on the same server and that is about it. The contents of each <VirtualHost> grouping contains the configuration options that are different from the main host and main config.

But then you ask: "Is it mandatory to use VirtualHost in Linux Mint?" and the short answer is no, unless you want to host more than one site.

I think the real question is something more like:

I am trying to set up a development environment with Apache on a Linux Mint desktop and I'm a little unsure how to configure it correctly.

This is what I have currently and it is not working... list of what you tried and what went wrong

At the moment, your question is not very clear. Maybe edit your question to include a little more detail on what you are wanting to do with Apache.

| improve this answer | |
  • Thanks @Tigger for your reply. I got my answer But then you ask: "Is it mandatory to use VirtualHost in Linux Mint?" and the short answer is no, unless you want to host more than one site. Previously I used Windows as Desktop. I didn't do anything like these in Windows, but I used LAMP there. – abu abu Sep 20 '17 at 15:16
1

You will need to setup <VirtualHost> configuration if you want to run more than one site on Apache. It is the only way Apache can identify which site DocumentRoot directory to serve for each request.

You get two different options which you can read more about on Apache's website: https://httpd.apache.org/docs/2.4/vhosts/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.