I try to configure 2 sites on one ip (Ubuntu 16.04 + LAMP)

in etc / apache2 / sites-available / magnitogorsk.party.conf

<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. ServerAlias www.magnitogorsk.party ServerName magnitogorsk.party ServerAdmin sinecura92@mail.ru DocumentRoot /var/www/magnitogorsk.party/public_html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, eg #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

in etc / apache2 / sites-available / partyrobot.ru.conf

 <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. ServerAlias www.partyrobot.ru ServerName partyrobot.ru ServerAdmin sinecura92@mail.ru DocumentRoot /var/www/partyrobot.ru/public_html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, eg #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

I activated both sites, I disabled the standard .conf (I did all the actions as a regular user with permissions, and the rule files via sftp as root

But the sites do not work, I can not understand what the problem is. in the Apache logs there are such errors:

 [Wed Nov 30 06:25:01.578085 2016] [mpm_event:notice] [pid 10791:tid 140448498636672] AH00489: Apache/2.4.18 (Ubuntu)configured -- resuming normal operations [Wed Nov 30 06:25:01.578119 2016] [core:notice] [pid 10791:tid 140448498636672] AH00094: Command line: '/usr/sbin/apache2' [Wed Nov 30 08:15:59.552220 2016] [mpm_event:notice] [pid 10791:tid 140448498636672] AH00491: caught SIGTERM, shutting down [Wed Nov 30 08:39:02.114980 2016] [mpm_event:notice] [pid 901:tid 140656255244160] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Wed Nov 30 08:39:02.116204 2016] [core:notice] [pid 901:tid 140656255244160] AH00094: Command line: '/usr/sbin/apache2' [Wed Nov 30 08:47:35.552144 2016] [mpm_event:notice] [pid 901:tid 140656255244160] AH00491: caught SIGTERM, shutting down [Wed Nov 30 09:22:18.444210 2016] [mpm_event:notice] [pid 890:tid 140665155405696] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Wed Nov 30 09:22:18.445675 2016] [core:notice] [pid 890:tid 140665155405696] AH00094: Command line: '/usr/sbin/apache2' [Wed Nov 30 10:52:20.192876 2016] [mpm_event:notice] [pid 890:tid 140665155405696] AH00491: caught SIGTERM, shutting down [Wed Nov 30 10:52:21.339304 2016] [mpm_event:notice] [pid 6532:tid 140036243150720] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Wed Nov 30 10:52:21.339474 2016] [core:notice] [pid 6532:tid 140036243150720] AH00094: Command line: '/usr/sbin/apache2' [Wed Nov 30 11:00:11.747695 2016] [mpm_event:notice] [pid 6532:tid 140036243150720] AH00491: caught SIGTERM, shutting down [Wed Nov 30 11:12:40.029712 2016] [mpm_event:notice] [pid 892:tid 140617992701824] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Wed Nov 30 11:12:40.030187 2016] [core:notice] [pid 892:tid 140617992701824] AH00094: Command line: '/usr/sbin/apache2' [Wed Nov 30 11:45:31.282484 2016] [mpm_event:notice] [pid 892:tid 140617992701824] AH00491: caught SIGTERM, shutting down [Wed Nov 30 11:45:32.432622 2016] [mpm_event:notice] [pid 2698:tid 140241427892096] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Wed Nov 30 11:45:32.432846 2016] [core:notice] [pid 2698:tid 140241427892096] AH00094: Command line: '/usr/sbin/apache2' 

Rebutal, Apache, serv. Somewhere nakosyachil help to understand

  • The content inside the files in /etc/apache2/sites-available must be wrapped in the virtualhost tag. see example . - aleksandr barakin
  • Added full files Apache (updated description) - Egor Tregubenko

0