ubuntu 14.10 LAMP 问题总结

来源:互联网 发布:java异常类层次结构图 编辑:程序博客网 时间:2024/05/11 12:34

使用环境:Ubuntu Kylin 14.10


1、安装apache2 默认www目录不是/var/www,而是/var/www/html

        解决:   sudo vim /etc/apache2/sites-available/000-default.conf

                      找到  :DocumentRoot /var/www/html
                     修改为:
                                  DocumentRoot /var/www/


2、新增一个虚拟主机

打开配置文件  sudo vim /etc/apache2/sites-available/000-default.conf

加入下述内容:

<VirtualHost 172.20.30.40:80>    ServerAdmin webmaster@www1.example.com    DocumentRoot /www/vhosts/www1    ServerName www1.example.com    ErrorLog /www/logs/www1/error_log    CustomLog /www/logs/www1/access_log combined</VirtualHost>
 可参考:http://httpd.apache.org/docs/2.4/vhosts/ip-based.html

重启apache2      sudo /etc/init.d/apache2 restart


   

0 0