# portas.cfg NameVirtualHost *:80 ServerName example.ru # Без этой стоки выдает ошибку Listen 80 # ... # httpd.conf # пустой ... # apache2.conf # ... # sites-available/default <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName test.example.ru # Можно не писать, все равно обращение по ип будет приходить сюда. DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost> # sites-available/stribog <VirtualHost *:80> ServerAdmin stribog@example.ru ServerName stribog.example.ru DocumentRoot /home/stribog <Directory /> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /home/stribog/error.log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel debug CustomLog /home/stribog/access.log combined </VirtualHost>
So. What have we got? When any access to our host, configs from default will be used. Except for the address stribog.examlpe.com, stribog configs will be used when accessing it.
Oddly enough, but the Internet did not find normal instructions. Selected configs by trial and error. In fact, I added a line ... the Apache rebooted ... I saw a mistake ... I randomly added a message ... I rebooted ...
Yes, the main thing do not forget to include virtual hosts.
a2ensite stribog