Код: Выделить всё
[25 Дек 2009 19:13:22] root@deb /etc/apache2
# echo 'NameVirtualHost 123.456.789.000:80
> ServerName 123.456.789.000
> <VirtualHost 123.456.789.000:80>
> ServerName site.su
> DocumentRoot /var/www
> CustomLog /var/www/logs/site.su.access.log combined
> ErrorLog /var/www/logs/site.su.error.log
> ServerAlias www.site.su
> ServerAdmin info@site.su
> DirectoryIndex index.html
> php_admin_value open_basedir "/var/www:."
> AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
> AddType application/x-httpd-php-source .phps
> </VirtualHost>
> <VirtualHost 123.456.789.000:80>
> ServerName subsite.site.su
> DocumentRoot /var/www/site
> CustomLog /var/www/logs/subsite.site.su.access.log combined
> ErrorLog /var/www/logs/subsite.site.su.error.log
> ServerAlias www.subsite.site.su
> ServerAdmin info@site.su
> DirectoryIndex index.html
> php_admin_value open_basedir "/var/www/site:."
> AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
> AddType application/x-httpd-php-source .phps
> </VirtualHost>
> '>>apache2.conf
[25 Дек 2009 19:13:35] root@deb /etc/apache2
# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting ..
[25 Дек 2009 19:13:37] root@deb /etc/apache2
# wget -O - site.su 2>/dev/null
Main site
[25 Дек 2009 19:13:54] root@deb /etc/apache2
# wget -O - subsite.site.su 2>/dev/null
Main siteКод: Выделить всё
[25 Дек 2009 19:17:55] root@deb /etc/apache2
# !vi
vi apache2.conf
[25 Дек 2009 19:18:22] root@deb /etc/apache2
# cd sit*
[25 Дек 2009 19:19:27] root@deb /etc/apache2/sites-available
# echo '<VirtualHost 123.456.789.000:80>
> ServerName site.su
> DocumentRoot /var/www
> CustomLog /var/www/logs/site.su.access.log combined
> ErrorLog /var/www/logs/site.su.error.log
> ServerAlias www.site.su
> ServerAdmin info@site.su
> DirectoryIndex index.html
> php_admin_value open_basedir "/var/www:."
> AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
> AddType application/x-httpd-php-source .phps
> </VirtualHost>' > site.su
[25 Дек 2009 19:19:44] root@deb /etc/apache2/sites-available
# echo '<VirtualHost 123.456.789.000:80>
> ServerName subsite.site.su
> DocumentRoot /var/www/site
> CustomLog /var/www/logs/subsite.site.su.access.log combined
> ErrorLog /var/www/logs/subsite.site.su.error.log
> ServerAlias www.subsite.site.su
> ServerAdmin info@site.ru
> DirectoryIndex index.html
> php_admin_value open_basedir "/var/www/site:."
> AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
> AddType application/x-httpd-php-source .phps
> </VirtualHost>
> ' > subsite.site.su
[25 Дек 2009 19:20:05] root@deb /etc/apache2/sites-available
# a2ensite site.su
Enabling site site.su.
Run '/etc/init.d/apache2 reload' to activate new configuration!
[25 Дек 2009 19:20:14] root@deb /etc/apache2/sites-available
# a2ensite subsite.site.su
Enabling site subsite.site.su.
Run '/etc/init.d/apache2 reload' to activate new configuration!
[25 Дек 2009 19:20:22] root@deb /etc/apache2/sites-available
# !/et
/etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .
[25 Дек 2009 19:20:34] root@deb /etc/apache2/sites-available
# !wg
wget -O - site.su 2>/dev/null
Main site
[25 Дек 2009 19:20:38] root@deb /etc/apache2/sites-available
# wget -O - subsite.site.su 2>/dev/null
Main siteзы
Код: Выделить всё
[25 Дек 2009 19:23:54] root@deb /etc/apache2/sites-available
# cat /var/www/index.html
Main site
[25 Дек 2009 19:25:37] root@deb /etc/apache2/sites-available
# cat /var/www/site/index.html
Sub site