请教怎么设置LAMP

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
haoyihuan
帖子: 271
注册时间: 2009-06-11 13:37

请教怎么设置LAMP

#1

帖子 haoyihuan » 2009-10-13 10:03

昨天刚刚装好linux,用新立得安装了LAMP,一切顺利,浏览器可以浏览127.0.0.1及localhost,当然也可以输入自己的IP。
然后在网上看了下设置自己的站点目录,默认的是在/var/www,但是这里路径对我来说不是很方便,所以想把它改到/home/xxx下。但是改动以后,就不能用了,浏览器输入自己的IP提示:
Not Found
The requested URL / was not found on this server.
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch Server at 192.168.1.110 Port 80
请教各位大侠!
跑debian应该是有点搞头的吧。
头像
dwl301
帖子: 1131
注册时间: 2007-04-14 11:17

Re: 请教怎么设置LAMP

#2

帖子 dwl301 » 2009-10-13 10:12

vi /etc/apache2/sites-available/default

<VirtualHost *:80>
ServerAdmin webmaster@localhost

#下面的几行是自己配置的部分...
# DocumentRoot /var/www
# <Directory />
# Options FollowSymLinks
# AllowOverride None
# </Directory>
DocumentRoot /home/www
<Directory /home/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 /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>
头像
haoyihuan
帖子: 271
注册时间: 2009-06-11 13:37

Re: 请教怎么设置LAMP

#3

帖子 haoyihuan » 2009-10-13 10:17

dwl301 写了:vi /etc/apache2/sites-available/default

<VirtualHost *:80>
ServerAdmin webmaster@localhost

#下面的几行是自己配置的部分...
# DocumentRoot /var/www
# <Directory />
# Options FollowSymLinks
# AllowOverride None
# </Directory>
DocumentRoot /home/www
<Directory /home/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 /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>

我在这个文件里面改了两个“/var/www”,把这个路径改为了/home/xxx(自己的路径) 之后就没有用了

打开的时候不知道在哪看到了提示 找不到DocumentRoot /home/xxx
跑debian应该是有点搞头的吧。
回复