Ubuntu配置apache
administrator@hytgg:/$ su
密码:
root@hytgg:/# vim /etc/apache2/conf.d/charset
将其中的
# AddDefaultCharset
的井号去掉,后面字段改成UTF-8(如果您的网站是这样了话)
AddDefaultCharset UTF-8
中间的空格数并不重要,但一定要有。
#vim /etc/apache2/apache2.conf
在文件最后处加上下边几行
AddType application/x-httpd-php .php .htm .html
DirectoryIndex index.htm index.html index.php
添加文档支持的类型及首页文件的显示顺序,当然你也可以加别的 比如default.php,可以根据自己的需求来添加。更改服务器地址(改为本机)
ServerName 127.0.0.1
修改apache的根目录DocumentRoot:
vim /etc/apache2/sites-enabled/000-default
将其中的 DocumentRoot /var/www 改成您想要的目录比如 DocumentRoot /var/www/htdocs/ 以上Apache2就基本配置完成了。重启Apache2服务即可。
#service apache2 restart
虚拟目录也是在这个文件中配置,我加了这段
Alias /radius/ "/var/www/dialup_admin/htdocs/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
访问的时候必须http://localhost/radius/ http://localhost/radius这个打不开,最后那个/的问题。
转自:http://gaga1.blogbus.com/logs/89494661.html