apache
软件包:
   httpd-2.2.15-26.el6.x86_64.rpm
配置文件:
    /etc/http/conf/httpd.conf
        /etc/http/conf.d/*.conf
服务数据目录:
   /var/www/html
端口:80 443

切换进程和线程模式
vim /etc/sysconfig/httpd
   HTTPD=/usr/sbin/httpd.worker

发布目录
   cp -r /boot /var/www/html
测试:
   elinks 192.168.1.254
   elinks --dump 192.168.1.254
   elinks 192.168.1.254/boot

基于用户家目录发布网页
1.useradd robin
 useradd zorro
2.vim /etc/httpd/conf/httpd.conf
   <IfModule mod_userdir.c>
       #UserDir disabled
       UserDir public_html
   </IfModule>
3.创建
   mkdir /home/zobin/public_html
   mkdir /home/zorro/public_html

echo "robin's home" >> /home/robin/public_html/index.html
echo "zorro's home" >> /home/rorro/public_html/index.html

4.该权限
   chmod 777 /home/robin/
   chmod 777 /home/zorro/

5.service httpd restart

测试
elinks 192.168.1.254/~robin
elinks 192.168.1.254/~zorro


虚拟主机(任何目录都可以放,关键字大小写没关系)
基于域名
1.
   mkdir /var/www/baidu/
   mkdir /var/www/google/

2.vim /etc/httpd/conf/httpd.conf
   NameVirtualHost *:80
   <VirtualHost *:80>
           documentroot /var/www/baidu
           servername www.baidu.com
   </VirtualHost>

3.创建页面
echo "baidu" >> /var/www/baidu/index.html
echo "google" >> /var/www/google/index.html

4.设置解析 /etc/hosts (基于本机测试,)
192.168.1.254   www.baidu.com
192.168.1.254   www.google.com

5.启动服务
service httpd restart


作业
ftp上传数据
http发布上传网页






防火墙关闭
[root@robin html]# rm -rf /etc/sysconfig/iptables
[root@robin html]# service iptables restart
iptables:清除防火墙规则:                                 [确定]
iptables:将链设置为政策 ACCEPT:mangle nat filter         [确定]
iptables:正在卸载模块:                                   [确定]
[root@robin html]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        

SElinux关闭
vim /etc/selinux/config
SELINUX=disabled