#### 安装apache
~~~
yum install httpd //在centos里面叫httpd ,在ubuntu里就叫apache
~~~
#### 启动服务
~~~
service httpd start
~~~
#### 查看状态
~~~
service httpd status
~~~
~~~
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active:active (running) since 一 2018-03-26 10:23:11 CST; 6min ago //running 说明已运行
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 1841 (httpd)
Status: "Total requests: 15; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─1841 /usr/sbin/httpd -DFOREGROUND
├─1842 /usr/sbin/httpd -DFOREGROUND
├─1843 /usr/sbin/httpd -DFOREGROUND
├─1844 /usr/sbin/httpd -DFOREGROUND
├─1845 /usr/sbin/httpd -DFOREGROUND
├─1846 /usr/sbin/httpd -DFOREGROUND
├─1951 /usr/sbin/httpd -DFOREGROUND
├─1952 /usr/sbin/httpd -DFOREGROUND
├─1953 /usr/sbin/httpd -DFOREGROUND
└─1954 /usr/sbin/httpd -DFOREGROUND
~~~
#### 查看进程
~~~
ps -ef | grep httpd
~~~
~~~
root 1841 1 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1842 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1843 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1844 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1845 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1846 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1951 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1952 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1953 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1954 1841 0 10:28 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
jack 1957 1175 0 10:28 pts/0 00:00:00 grep --color=auto httpd
~~~
#### 访问
通过其他电脑访问服务器地址,默认端口是80发现访问不了,原因是有防火墙,关闭防火墙即可访问 . 但是服务器的防火墙是不能关闭的 .
![](https://box.kancloud.cn/1df009cfd0680bda30904ec355083e83_675x724.png)
- 目录结构
- SSH协议
- 服务器安装SSH
- 客户端安装
- SSH config
- SSH免密登录
- SSH安全端口
- 命令
- 简单命令
- 切换目录命令
- 文件操作命令
- 文件夹操作命令
- 文件压缩命令
- Vim编辑器
- 打开文件三种方式
- 模式
- 末行模式
- 命令模式
- 编辑模式
- Vim扩展
- 硬件信息
- Rpm软件管理
- 介绍
- 查询
- 安装
- 卸载
- Linux运行模式
- 用户和用户组
- 用户操作
- 用户组操作
- 权限管理
- 介绍
- 设置权限
- 防火墙
- 防火墙操作
- 添加服务
- 提权
- 文件上传与下载
- 上传文件
- 下载文件
- 光盘挂载
- 开发环境安装
- Apache
- 安装Apache
- 配置
- Nginx
- 安装
- MySQL
- 安装
- Memcache
- Git
- PHP
- 常用服务
- 定时任务
- 日期同步
- 日志切割
- 进程管理
- 常用命令
- Shell
- Screen