linux下的apache2的目录和windows上的区别还是很大的,但是用起来却更方便了,详解请看另一篇文章http://www.cnblogs.com/wancy86/p/linux_apache2.html

这里补充两个命令:

添加模块:

model_name是mods-available 下的模块名

sudo a2enmod model_name
sudo a2enmod proxy 

开启vhost:

vhost_conf 是sites-available下的vhost配置文件名,文件名中不带.#

sudo a2ensite vhost_conf
sudo a2ensite mysite

vhost配置文件模板:

NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
	ServerName tuitu.cn
	ServerAdmin wancy86@sina.com
	
	DocumentRoot /var/www/demo/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/demo/>
		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

    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>

相关文章:

  • 2021-12-14
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2021-10-03
  • 2021-04-01
  • 2021-12-19
  • 2021-11-16
  • 2021-08-27
相关资源
相似解决方案