本篇文章主要介绍了详解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. maven配置私服中可能遇到的问题

    文章目录 之前要写一个hsf的demo,maven的依赖是需要alibaba的私服的,所以出现了下面的错误. 具体参看另一篇文章:https://blog.csdn.net/dataiyangu/ar ...

  2. RoadFlow2.7.5 MyController.cs

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  3. class10_Frame 框架

    最终运行效果图(程序见序号2):   #!/usr/bin/env python # -*- coding:utf-8 -*- # ---------------------------------- ...

  4. HDU-1850-Being a Good Boy in Spring Festival-nim博弈

    一年在外 父母时刻牵挂春节回家 你能做几天好孩子吗寒假里尝试做做下面的事情吧 陪妈妈逛一次菜场悄悄给爸爸买个小礼物主动地 强烈地 要求洗一次碗某一天早起 给爸妈用心地做回早餐 如果愿意 你还可以和爸妈 ...

  5. 解析css3 shake 抖动样式

    前端时间做项目发现一抖动按钮挺吸引眼球的,研究了下实现原理,在此和大家分享下: CSS Shake是一个使用CSS3实现的动画样式,使用SASS编写,利用它我们可以实现多种不同样式的抖动效果(如下面的 ...

  6. React:styled-components

    ``是es6的Template Literals(模版字符串),许多人对这个一知半解,今天在这边总结下: `${expression}`(表达式插补) var x; var y; sth.innerH ...

  7. jquery的attr获取表单checked 布尔值问题

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 无LoadLibrary获取指定模块基址

    实际上,这块可以写成汇编,然后做远程注入用 方法 1.通过fs:[30h]获取当前进程的_PEB结构 2.通过_PEB的Ldr成员获取_PEB_LDR_DATA结构 3.通过_PEB_LDR_DATA ...

  9. Sublime Text最舒服的主题

    Theme - Afterglow (官网链接) 贴上 preferences -> settings 里面的配置 { "theme": "Afterglow-gr ...

  10. 0916CSP-S模拟测试赛后总结

    40分-rank35. 不想找借口.实力不行. 赛时状态没出什么大问题.就是实力太弱了. 天皇又AK了.去问了一下,他说全是简单题…… 后来发现一些人用非正解AC了. 但是天皇题题正解题题首切啊. 还 ...