简体   繁体   中英

access site via domain name (linux)

I have a VPS server on Hostgator that is a semi-managed server, meaning: Virtual Private Servers that does not include a web hosting control panel (cPanel or Plesk), so I am working from Putty.

I have the ability to get to my website on the server by entering the IP address in a browser window, but not through the domain name. Does anyone have any idea of which file I need to edit so the site can be resolved by name?

Thanks.

If you like this 'visibility' to be set up for you only then edit \\windows\\system32\\drivers\\etc\\hosts file. Otherwise you have to contact your ISP to set up a DNS records for this IP.

PS this question is off topic at stackoverflow

The file is

    /etc/apache2/sites-available/default

To create a new site:

Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite

Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: gksudo gedit /etc/apache2/sites-available/mysite

Change the DocumentRoot to point to the new location. For example, /home/user/public_html/

Change the Directory directive, replace to

You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites Save the file

Check out this site about configuring a LAMP server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM