查看: 1674|回复: 0

[教程] 【一网打尽】Raspberry Pi Course Week 6 – Day 3 (Installing Apache Web...

[复制链接]
  • TA的每日心情
    开心
    2016-8-4 10:56
  • 签到天数: 242 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2015-3-28 13:48:29 | 显示全部楼层 |阅读模式
    分享到:

    This tutorial will teach you the basics of installing Apache Web Server on the Raspberry Pi and you will create a simple HTML page to verify that the page will being delivered to the client using a web browser.

    To install the apache web server, which is also known as apache2 can be installed using the following commands.

    $ sudo apt-get install apache2

    When the installation is complete enter the following command.

    $ cd /var/www

    And list the file contents by entering ls at the command prompt.

    $ ls

    index.html

    This directory is used for files that you want to serve up using Apache2 and the index.html file is one of the default files that Apache will display when accessing the server.
    Log into the Raspberry Pi desktop and open a web browser. In the web address bar enter the following.

    http://localhost

    This will retrieve the index.html file and display something similar to this.

    raspberry-pi-apache-web-browser.png


    The Apache web server is now up and running.  To confirm that additional HTML pages can be added we will create an html page and store it in the /var/www directory.

    Open a terminal window and enter the following commands.

    $ cd /var/www

    $ sudo nano mypage.html

    When nano opens enter the following basic html code

    <html>

    <head>

                <title>This is my Raspberry Pi Page</title>

    </head>

    <body>This is where the action happens</body>

    </html>

    Save this file by holding down CTRL-X.  Nano will prompt you to save the file.

    Open a web browser and in the address bar enter

    http://localhost/mypage.html

    You will see a web page with the content being displayed.


    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-11-19 13:36 , Processed in 0.110501 second(s), 16 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.