您的位置:首页 > 运维架构 > Apache

Ubuntu10 Apache2 php5 下修改网站的默认根目录

2011-09-14 11:09 656 查看
ubuntu10.10下修改apache2的默认文档目录 默认是在/var/www里面

sudo gedit /etc/apache2/sites-enabled/000-default


在文档中找到 DocumentRoot 在后面修改你要放置网页文件的目录。

如下:

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	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 ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn
	CustomLog ${APACHE_LOG_DIR}/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>
<VirtualHost *:8080>
	DocumentRoot /var/www/
</VirtualHost>


最后一步是重启apache

sudo /etc/init.d/apache2 restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: