Ubuntu下使得其他客户机可以下载自己的数据

    xiaoxiao2025-10-11  5

    1、检查本机是否安装Apache

    在浏览器中输入:127.0.0.1, 

    如果可以打开Ubuntu Apache配置页面,则表示安装成功,可直接跳到5、共享文件。否则,表明未安装Apache,跳到2、安装Apache

    2、安装Apache

    Plan A:

    sudo apt-get install apache2

    Plan B:

    到官网下载:apache2.0: httpd-2.0.63.tar.gz

    下载完成后解压该文件到文件夹httpd-2.0.63

    进入该目录,执行:

    #./configure --prefix=/usr/local/apache2 --enable-module=so #make #make install 如果要求使用root权限,可以使用sudo;

    如果需要mod_rewrite模块,可以加参数--enable-rewrite;

    在浏览器中输入:127.0.0.1, 如果可以打开Ubuntu Apache配置页面,则表示安装成功。

    如果使用Plan A,可直接跳到5、共享文件(因为我是使用Plan A成功安装的,并未尝试3-4的方法,这两处借鉴文章底部参考博客的内容)

    3、启动和停止Apache

    A、启动:

    sudo /usr/local/apache2/bin/httpd -k start启动时若提示:

    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName. 则需要在http.conf中加上以下一行信息:

    ServerName 127.0.0.1:80 B、停止:

    sudo /usr/local/apache2/bin/httpd -k stop

    4、开机自启动Apache

    A、

    复制 /usr/local/apache2/bin/apachectl 到 /etc/init.d

    B、

    加载为服务: sudo update-rc.d apachectl defaults

    重启时访问http://localhost/,如果显示apache网页,则表示自启动成功。

    5、共享文件

    A、进入/var/www/html,并给该路径加上读写权限:

    cd /var/www/html sudo chmod -R 777 .

    B、将需要共享的文件放到该路径下

    C、在浏览器中输入:本机IP/文件名,如果成功下载该文件,则表明文件共享已成功。否则,重头再来吧

    参考:

    ubuntu install httpd

    转载请注明原文地址: https://ju.6miu.com/read-1303063.html
    最新回复(0)