zoukankan      html  css  js  c++  java
  • Apache2的安装

      Apache2的安装

      1.执行:sudo apt-get install apache2。

      2.sudo vim /etc/apache2/apache2.conf在最后加上:ServerName localhost。

      3.sudo /etc/init.d/apache2 start启动apache服务。

      4.启动浏览器,并输入http://localhost即可看到安装成功界面。

      5.停止:sudo /etc/init.d/apache2 stop

      Apache2实现文件的下载:

      1.vim /etc/apache2/sites-available/000-default.conf,增加如下配置

            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html
    
            <Directory /var/www>
                    options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
           </Directory>
    
           ServerName localhost:80

      2.在/var/www/html下删除index.html,然后新建要下载的text.txt文件

      3.修改目录权限:sudo chmod 775 /var/www

      4.启动apache2:/etc/init.d/apache2 start

      5.打开本机浏览器,输入http://localhost,查看是存在text.txt文件

      6.记录apache2所在的机器的Ip地址为192.168.131.138,在同一局域网的另一台电脑cd /tmp/,然后执行wget http://192.168.131.138/text.txt

      使用tcpdump抓取记录并存入文件

      1.在/var/www/html下使用命令生成指定大小的文件:dd if=/dev/urandom of=/var/www/html/filename bs=1M count=1

      2.启动apache2服务器

      

      

      

      

      TcpDump的安装:

      1.http://www.tcpdump.org/下载tcpdump和libpcap压缩包并解压。

      2.安装c编译所需包:apt-get install build-essential

      3.安装libcap的前置包:apt-get install flex,apt-get install bison

      4.安装libcap:进入解压目录,

    ./configure
    make
    make install

      5.安装tcpdump:进入解压目录

    ./configure
    make
    make install

      6.测试是否安装成功,直接在命令行输入tcpdump

  • 相关阅读:
    HDU6301 SET集合的应用 贪心
    线段树与树状数组的对比应用
    树状数组
    JDBC链接MySQL数据库
    HDU4686Arc of Dream 矩阵快速幂
    HDU1757矩阵快速幂
    B1013. 数素数 (20)
    B1023. 组个最小数 (20)
    [教材]B1020. 月饼 (25)
    [教材]A1025. PAT Ranking (25)
  • 原文地址:https://www.cnblogs.com/BigJunOba/p/9703802.html
Copyright © 2011-2022 走看看