apache2添加模块和添加站点
linux下的apache2的目录和windows上的区别还是很大的,但是用起来却更方便了,详解请看另一篇文章http://www.cnblogs.com/wancy86/p/linux_apache2.html
这里补充两个命令:
添加模块:
model_name是mods-available 下的模块名
sudo a2enmod model_namesudo a2enmod proxy
开启vhost:
vhost_conf 是sites-available下的vhost配置文件名,文件名中不带.
和#
sudo a2ensite vhost_confsudo a2ensite mysite
vhost配置文件模板:
NameVirtualHost 127.0.0.1ServerName tuitu.cn ServerAdmin wancy86@sina.com DocumentRoot /var/www/demo/ Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all 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/"Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128