http://jingyan.baidu.com/article/6d704a130c8a0d28da51ca5f.html

Ubuntu 14.04 apache安装配置

1、安装

~# apt-get install apache2 -y

2、默认的网站根目录的路径

Apache安装完成后,默认的网站根目录是"/var/www/html",在终端窗口中输入"ls /var/www/html"-->回车-->在网站根目录下有一个"index.html"文件,在ie浏览器中输 入"127.0.0.1"-->回车,就可以打开该页面。

Ubuntu 14.04 apache安装配置

3、Apache的第一个配置文件apache2.conf的路径

在终端窗口中输入"ls /etc/apache2"--->有一个"apache2.conf"的配置文件。

Ubuntu 14.04 apache安装配置

4、Apache的第二个配置文件000-default.conf的路径

在终端窗口中输入"ls /etc/apache2/sites-available"-->有一个"000-default.conf"的配置文件。

Ubuntu 14.04 apache安装配置

5、修改网站的根目录

1) 在终端窗口中输入"sudo vi /etc/apache2/apache2.conf"-->回车-->找到"<Directory /var/www/>"的位置-->更改"/var/www/"为新的根目录就可以了。

Ubuntu 14.04 apache安装配置

2) 在终端窗口中输入"sudo vi /etc/apache2/sites-available/000-default.conf"-->回车-->找 到"DocumentRoot /var/www/html"的位置-->更改"/var/www/html"为新的根目录就可以了,这里我把它更改为"/var/www/"。

Ubuntu 14.04 apache安装配置

6、重启apache2 服务后生效

7、将web文件放到/var/www/下面即可

相关文章:

  • 2021-07-30
  • 2021-12-12
  • 2021-05-09
  • 2022-03-15
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2022-03-15
  • 2021-12-12
  • 2021-09-22
  • 2021-09-15
相关资源
相似解决方案