Is it possible? Someone told me it is but I'm not sure.
If its possible, how should I do it? I have one /www folder where my website lies. How can I configure 2 different sites?
Is it possible? Someone told me it is but I'm not sure.
If its possible, how should I do it? I have one /www folder where my website lies. How can I configure 2 different sites?
The procedure is:
Point both domains to the ip of the VPS.
Configure the webserver you have installed on your VPS to answer to those two domains.
In the case of Nginx with Passenger, it is a matter of adding entries to you nginx.conf file. Like this:
Check your webserver documentation to do a similar thing.
This is always possible ... You can always configure name servers using one or two ip addresses on your VPS. Once configured, you can start pointing multiple domains using those name servers.
On my VPS there is only one IP address, but I am hosting 35+ sites there ....
As complete beginner, I have been trying to host multiple domains on one Apache VPS. Tutorials had too much information that lead me to confusion.
Below I describe, for complete begginers, how to host multiple domains on one VPS server with Ubuntu and Apache.
IMPORTANT! You need to use root account to execute most operations.
IMPORTANT! If you have been trying to make some changes to apache configuration before, undo them.
Creating VirtualHosts
Create folders for your domains on server. For example:
Put index.html file in each folder with any text.
Go to /etc/apache2/sites-available folder.
Create file domain1
Create file domain2
You can create subdomains same way.
Enable created sites
Restart apache
Redirecting domain to server
Created VirtualHosts will work only if you redirect your domain name to server IP. Domains are just names that can be translated to IP numbers.
Local computer
To test your configuration on local machine, you need to edit hosts file.
It should look like this.
Hosts file tells your computer that domain needs to be redirected to local machine.
IMPORTANT! If you create entry in hosts file for existing domain, for example
you will lose access to this website.
Server
In order to redirect domain to you web server, you need to create or modify "A"-type DNS record for given domain to IP address of your server. You can do it by panel control provided by your domain registrar.
If you do not know IP address of your server, log in to that server and type in command line: