In Ubuntu Server 10.04, the default by the APT installation of Apache, specifies that the page home directory is located in:/var/www. And I need to change it to:/home/www. Because my system/var too little space, I have the need to provide networked storage over the Web. What's worse: My/etc/apache2/sites-enabled/000-default file disappears after the change. The result is an error in the Apache service and the Web site cannot be run. In the last part I have documented how to solve this problem.
First, find the Apache configuration file
# cd/etc/apache2/
Found apache2.conf and httpd.conf files, no configuration was found for directory modifications, and http.conf is an empty file.
Second, the Internet search
There is no documentroot in the apache2.conf, httpd.conf is empty, www.linuxidc.com is definitely in other documents. After the search, found in the/etc/apache2/sites-enabled/000-default, there is such content:
Copy Code code as follows:
<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>
Modify the method: The above/var/www modified to/home/www can be.
Third, retrieve the missing/etc/apache2/sites-enabled/000-default file
Do not know what reason, 000-default unexpectedly lost, Apache service also can not run normally. Fortunately I have a standby server, after checking 000-default is actually a soft link, pointing to. /sites-available/default files.
# cd/etc/apache2/sites-enabled/
# ln-s. /sites-available/default 000-default
#/etc/init.d/apache2 Restart
* Restarting Web server apache2
Apache2:could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2:could not reliably determine the server ' s fully qualified domain name, using 127.0.1.1 for ServerName
... done.
= = = from the above Apache-initiated feedback, you can see that Apache still has a little problem, but does not affect.
The following table is a space allocation.
FileSystem Size Used Avail use% mounted on
/dev/sda5 1.9G 36M 1.8G 2%/tmp
/DEV/SDA9 209M 21M 177M 11%/boot
/DEV/SDA1 276G 7.0G 255G 3%/home
/dev/sda6 8.6G 670M 7.5G 9%/usr
/dev/sda3 1.9G 186M 1.6G 11%/var