How to connect a domain through the console to change the site. Purely the console is on the server, without ispmgr and other things only the console (do I have to change the domain inside to another how to do it? To https://cloud.digitalocean.com

  • What software is worth? As apache web server? - Roman Tokarev
  • 4 GB Memory / 80 GB Disk / AMS3 - Ubuntu 04/16/3 x64 - user265588
  • server is apache? nginx? or just bare Ubuntu? - Roman Tokarev
  • It turns out the domain by ip redirected to the desired ip. I understand these are different directories in the server and because of this problem (What do I need to do? Delete that directory or prescribe something or ubuntu in the site itself? - user265588

1 answer 1

If apache is not installed - install

sudo apt-get install apache2 

(installation instructions LAMP - https://losst.ru/ustanovka-lamp-ubuntu-16-04 )

LAMP - it is possible to say "gentleman's set" - Linux, Apache, MySQL, PHP

After that we set up apache virtualhost

For example, for our sites we will create directories:

 sudo mkdir -p /var/www/example.com/public_html 

Creating a virtual host file

 sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf sudo nano /etc/apache2/sites-available/example.com.conf 

And change it to make it look like

 <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 

Enable new virtual host

 sudo a2ensite example.com.conf sudo service apache2 restart 

More detailed instructions - https://www.digitalocean.com/community/tutorials/apache-ubuntu-16-04-ru

Then we configure the DNS zone (description with reg ru https://www.reg.ru/support/domains/dns_servery_i_nastroika_zony/Nastroika-zony/nastroika-resursnyh-zapisei-dlya-domena )