本篇文章主要介绍了详解Ubuntu下安装和配置Apache2,小编觉得挺不错的,现在就分享给大家,也给大家做个参考。有兴趣的朋友可以了解一下。(http://xz.8682222.com

  在Ubuntu中安装apache

  安装指令:

  sudo apt-get install apache2

  安装结束后:

  产生的启动和停止文件是:/etc/init.d/apache2

  启动:

  sudo apache2ctl -k start

  停止:

  sudo apache2ctl -k stop

  重新启动:

  sudo apache2ctl -k restart

  配置文件保存在:/etc/apache2

  需要说明的是,普通的apache发行版本配置文件是:httpd.conf

  Ubuntu发行版本的主配置文件是:apache2.conf

  在apache2.conf引用到了以下文件:

  # 包含动态模块的配置:Include /etc/apache2/mods-enabled/*.loadInclude /etc/apache2/mods-enabled/*.conf# 包含用户自己的配置:Include /etc/apache2/httpd.conf# 包含端口监听的配置:Include /etc/apache2/ports.conf# 包含一般性的配置语句片断:Include /etc/apache2/conf.d/# 包含虚拟主机的配置指令:Include /etc/apache2/sites-enabled/

  修改httpd.conf

  增加以下内容:

  ServerName 127.0.0.1:80

  ubuntu apache2配置

  1.apache2.conf 是主配置文件,httpd.conf 用户配置文件

  2.虚拟目录在 httpd.conf 中

  DocumentRoot "路径"ServerName 名称 allow from all Options +Indexes

  3.根设置(默认主目录)在 /etc/apache2/sites-available/default

  4.重启命令

  sudo /etc/init.d/apache2 restart或者cd /etc/init.dsudo apache2 -k restart

  stop 停止;start 启动5.日志文件在 /var/log/apache2/

  ServerName www.kimoqi.com DocumentRoot /home/vsftpd/kimoqi ServerName www.arwenedu.com DocumentRoot /home/vsftpd/wangguan/webapps ServerName www.arwenedu.org.cn DocumentRoot /home/vsftpd/wangguan/chem

  vi /etc/httpd/conf/httpd.conf

  在Windows下,Apache的配置文件通常只有一个,就是httpd.conf。但我在Ubuntu Linux上用apt-get install apache2命令安装了Apache2后,竟然发现它的httpd.conf(位于/etc/apache2目录)是空的!进而发现Ubuntu的 Apache软件包的配置文件并不像Windows的那样简单,它把各个设置项分在了不同的配置文件中,看起来复杂,但仔细想想设计得确实很合理。

  严格地说,Ubuntu的Apache(或者应该说Linux下的Apache?我不清楚其他发行版的apache软件包)的配置文件是 /etc/apache2/apache2.conf,Apache在启动时会自动读取这个文件的配置信息。而其他的一些配置文件,如 httpd.conf等,则是通过Include指令包含进来。在apache2.conf中可以找到这些Include行:

  引用

  # Include module configuration: Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf# Include all the user configurations: Include /etc/apache2/httpd.conf# Include ports listing Include /etc/apache2/ports.conf……# Include generic snippets of statements Include /etc/apache2/conf.d/# Include the virtual host configurations: Include /etc/apache2/sites-enabled/

Ubuntu下安装和配置Apache2,小编觉得挺不错的,现在就分享给大家的更多相关文章

  1. Ubuntu下安装和配置Apache2

    http://www.blogjava.net/duanzhimin528/archive/2010/03/05/314564.html 在Ubuntu中安装apache 安装指令:sudo apt- ...

  2. ubuntu下安装和配置apache2+SVN的详细方法介绍

    ubuntu安装和配置SVN第一步:安装apache2  libapache2-svn subversionsudo apt-get install apache2sudo apt-get insta ...

  3. linux -- Ubuntu下安装和配置Apache2

    在Ubuntu中安装apache 安装指令:sudo apt-get install apache2 启动和停止apache的文件是:/etc/init.d/apache2 启动命令:sudo apa ...

  4. ubuntu下安装和配置最新版JDK8傻瓜教程

    ubuntu下安装和配置最新版JDK8傻瓜教程 听语音 | 浏览:18940 | 更新:2014-07-14 22:13 | 标签:ubuntu 1 2 3 4 5 6 分步阅读 ubuntu系统通常 ...

  5. Ubuntu下安装并配置VS Code编译C++

    作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7069091.html Ubuntu下安装并配置VS Code编译C++ 安装 ...

  6. Ubuntu下安装并配置TexStudio

    作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7069715.html Ubuntu下安装并配置TexStudio Ubunt ...

  7. 阿里云Ubuntu下安装、配置权限和导入本地mongodb

    ---恢复内容开始--- 第一部分:首先先在Ubuntu下安装好mongodb,步骤如下: 首先我们需要借助远程管理工具链接到阿里云上的ubuntu系统,接着进行如下操作 一.导出软件源的公钥 sud ...

  8. Win10+WSL2+Ubuntu 18.04(WSL下)+VS Code(Win10下)+TexLive 2019(Ubuntu下)安装和配置

    本人手头电脑是Win10 Home版全新安装的系统,由于不想在新系统盘里面安装TexLive导致固态硬盘不断扩大,所以,考虑安装Ubuntu做为WSL,然后把TexLive安装在Ubuntu,并通过V ...

  9. Windows XP下安装和配置Apache2.2.22服务器+PHP5+Mysql5

    原文:http://www.chinaz.com/web/2012/0516/252021.shtml 随着PHP网站的流行,国内越来越多的站长使用php开发网站或者使用相关的php开源网站(例如:D ...

随机推荐

  1. Java-Class-C:org.springframework.http.MediaType

    ylbtech-Java-Class-C:org.springframework.http.MediaType 1.返回顶部 1.1. /* * Copyright 2002-2018 the ori ...

  2. python自动生成useragent

    首先安装相关的库 pip install fake-useragent 然后使用该库 from fake_useragent import UserAgent ua = UserAgent() ua. ...

  3. Python匹马行天下之初识python!

    python的发展史 1989年,被称为龟叔的Guido在为ABC语言写插件时,产生了写一个简洁又实用的编程语言的想法,并开始着手编写.因为其喜欢Monty Python喜剧团,所以将其命名为pyth ...

  4. [CERC2017]Gambling Guide

    题目 看起来非常随机游走,但是由于我们可以停在原地,所以变得不是非常一样 设\(f_x\)表示从\(x\)到\(n\)的期望距离 如果我们提前知道了\(f\),那么我们随机到了一张到\(y\)的车票, ...

  5. heartbeat 高可用

    转载来自 http://www.cnblogs.com/liwei0526vip/p/6391833.html 使用HeartBeat实现高可用HA的配置过程详解 一.写在前面 HA即(high av ...

  6. Python学习笔记(四)——文件永久存储

    文件的永久存储 pickle模块的使用 pickle的实质就是将数据对象以二进制的形式存储 存储数据 pickle.dump(data,file) data表示想要存储的数据元素,file表示要将数据 ...

  7. thinkphp url模式

    入口文件是应用的单一入口,对应用的所有请求都定向到应用入口文件,系统会从URL参数中解析当前请求的模块.控制器和操作: http://serverName/index.php/模块/控制器/操作 这是 ...

  8. 异或前缀和——cf1186C

    很思维的题,b的1个数和c的1个数相差为偶数时,必定有偶数个不同 反之必定有奇数个不同 #include <iostream> #include <cstdlib> #incl ...

  9. js面试总结3

    异步和单线程 题目: 1.同步和异步的区别? 2.一个关于setTimeout的笔试题. 3.前段使用异步的场景有哪些? 什么是异步? console.log(100) setTimeout(func ...

  10. 8种形式的Android Dialog使用举例

    在Android开发中,我们经常会需要在Android界面上弹出一些对话框,比如询问用户或者让用户选择.这些功能我们叫它Android Dialog对话框,在我们使用Android的过程中,我归纳了一 ...