Ubuntu apache vhostu别名安装程序
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu apache vhostu别名安装程序相关的知识,希望对你有一定的参考价值。
First of all this refers to a clean Ubuntu 10.04 install with the LAMP and OpenSSH packages installed, but can probably be applied in most cases.Duplicate the file /etc/apaches/sites-available/default, and name it subdomains.
Edit the new file to look like this one.
Enable the vhost_alias module, "a2enmod vhost_alias".
Activate the new virtual host, "a2ensite subdomains".
Reload apache, "/etc/init.d/apache2 reload".
In order to change the configuration to your needs, [you can go here](
http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html)
<VirtualHost *:80> ServerAdmin [email protected] ServerName example.com ServerAlias *.example.com VirtualDocumentRoot /home/%1/www/html <Directory /> Options FollowSymLinks AllowOverride 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 Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
以上是关于Ubuntu apache vhostu别名安装程序的主要内容,如果未能解决你的问题,请参考以下文章
在 Apache 上通过 HTTPS 将服务器别名重定向到服务器名称