Where is d vhosts.conf




















Note: If you have upgraded from the older Plesk version and are configuring the vhost. Yes No. Thank you for the feedback! Please tell us if we can improve further. Sorry to hear that. Please tell us how we can improve. Partners Blog Contact us. Plesk Documentation and Help Portal. To avoid this, additional files are used to specify custom configuration for domains: vhost.

We now have the directory structure for our files, but they are owned by our root user. If we want our regular user to be able to modify files in our web directories, we can change the ownership with chown :. We should also modify our permissions a little bit to ensure that read access is permitted to the general web directory, and all of the files and folders inside, so that pages can be served correctly:.

Your web server should now have the permissions it needs to serve content, and your user should be able to create content within the appropriate folders. Because this is just for demonstration and testing, our pages will be very simple. We are just going to make an index.

We can open up an index. In this file, create a simple HTML document that indicates the site that the page is connected to. For this guide, the file for our first domain will look like this:. Save and close this file as well. You now have the pages necessary to test the virtual host configuration. Virtual host files are what specify the configuration of our separate sites and dictate how the Apache web server will respond to various domain requests.

To begin, we will need to set up the directory that our virtual hosts will be stored in, as well as the directory that tells Apache that a virtual host is ready to serve to visitors. The sites-available directory will keep all of our virtual host files, while the sites-enabled directory will hold symbolic links to virtual hosts that we want to publish.

We can make both directories by typing:. Next, we should tell Apache to look for virtual hosts in the sites-enabled directory. Save and close the file when you are done adding that line.

We are now ready to create our first virtual host file. Note: Due to the configurations that we have outlined, all virtual host files must end in. First, start by making a pair of tags designating the content as a virtual host that is listening on port 80 the default HTTP port :. To learn more about DNS records, check out our host name setup guide. We will also tell Apache where to store error and request logs for this particular site:.

Now that we have our first virtual host file established, we can create our second one by copying that file and adjusting it as needed.

You now need to modify all of the pieces of information to reference your second domain. When you are finished, your second virtual host file may look something like this:. Now that we have created our virtual host files, we need to enable them so that Apache knows to serve them to visitors. To do this, we can create a symbolic link for each virtual host in the sites-enabled directory:.

If you have been using example domains instead of actual domains to test this procedure, you can still test the functionality of your virtual hosts by temporarily modifying the hosts file on your local computer. This will intercept any requests for the domains that you configured and point them to your VPS server, just as the DNS system would do if you were using registered domains. This will only work from your computer, though, and is simply useful for testing purposes.

Virtual hosts vhosts are used to serve multiple domains by using a single server or Internet Protocol IP address. Different pages are displayed according to what has been set in the host file for that particular site. You can add as many virtual hosts as you need to your server. Note: Replace any instance of domain. This article assumes that you have configured the Domain Name Services DNS for your domain to point to your site or that you are using a local hosts file on your computer to point the domain to the server for testing purposes.

Install Apache by running the following command:. This directory is used to store the web content for your site. This is known as the Document Root location in the Apache vhost configuration file.



0コメント

  • 1000 / 1000