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

来源:互联网 发布:杨氏弹性模量实验数据 编辑:程序博客网 时间:2024/06/04 17:58

ubuntu10.10下修改apache2的默认文档目录 默认是在/var/www里面


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

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

如下:

<VirtualHost *:80>ServerAdmin webmaster@localhostDocumentRoot /var/www/<Directory />Options FollowSymLinksAllowOverride None</Directory><Directory /var/www/>Options Indexes FollowSymLinks MultiViewsAllowOverride NoneOrder allow,denyallow from all</Directory>ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<Directory "/usr/lib/cgi-bin">AllowOverride NoneOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatchOrder allow,denyAllow from all</Directory>ErrorLog ${APACHE_LOG_DIR}/error.log# Possible values include: debug, info, notice, warn, error, crit,# alert, emerg.LogLevel warnCustomLog ${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


原创粉丝点击