当前位置:网站首页>使用cpolar发布树莓派网页(apache2的安装测试)
使用cpolar发布树莓派网页(apache2的安装测试)
2022-07-28 14:10:00 【probezy】
在上篇介绍中,我们在树莓派中安装了cpolar,并将cpolar客户端成功激活。接下来,我们就可以使用cpolar的内网穿透功能,将位于树莓派上的网页发布到公共互联网上。但不同的网页需要的环境支持、制作方法都有区别,遵循从易到难的原则,我们会通过一系列的文章,为大家详细说明如何在树莓派上建立像样的网页,并通过cpolar将其发布到公共互联网上。现在,就让我们看看一个简单网页如何建立吧。
一个网页的正常运行,需要需要相应的环境,因此在建立网页之前,我们需要安装网页运行的环境。现在应用最为广泛的网页运行环境,无疑是apache这款软件,因此我们先在树莓派上安装apache。
分别输入命令
sudo apt-get install apache2 -y
sudo service apache2 restart

以安装apache2软件,并启动apache2服务(如果碰到apache2安装失败,可以尝试运行“sudo apt update”命令更新系统,再进行安装)。在apache2安装完成后,我们在浏览器中输入“http://localhost”,就能进入apache2的说明页面。

不过这个干巴巴的apache2说明页面实在没啥看头,我们可以尝试运行一个简单的网页,正好测试一下apache2的功能。这里我们选用一个简单的放松站点,用以配合难得的午睡时间。同样,我们还是输入命令行
cd /var/www/html/
sudo rm *
sudo wget https://www.cpolar.com/static/downloads/meditation-app-master.tar.gz
sudo tar xzf meditation-app-master.tar.gz
sudo mv meditation-app-master/* .
sudo rm -rf meditation-app-master meditation-app-master.tar.gz
在命令运行完成后,我们再刷新浏览器(仍然是localhost为地址),就会发现原本apache2的说明页面,变成了能够安神静心的冥想站点。

到这里,我们就成功的在树莓派上建立了一个简单的网页。当然,如果对冥想站点不感兴趣,我们也可以通过下载其他的开源网页资源,搭建这样的简单站点。
此时这个网页只能在本地的树莓派上看到。想要让这个网页能被随时访问到,我们还需要通过cpolar将其发布到公网上。在下篇介绍中,我们将为大家详细介绍,如何将这个简单网页发布到公共互联网上。如果您对cpolar的使用有任何疑问,欢迎与我们联系,我们必将为您提供力所能及的协助。当然也欢迎加入cpolar的VIP官方群,共同探索cpolar的无限潜能。
边栏推荐
- SSL socket cross platform solution libevent OpenSSL
- 云计算需要考虑的安全技术列举
- Three pop-up boxes commonly used in JS
- Vtkcellpicker picking triangular patches
- SSH service
- Compose learning notes 2 - launchedeffect, status and status management
- Install scikit learn journey
- 15、 Launch file label of ROS (I)
- 企业微信客服链接,企业微信客服聊天
- Robot mathematics foundation 3D space position representation space position
猜你喜欢

Various pitfalls encountered in UI development

Knowledge map Foundation (I) - what is knowledge map

Google lab usage notes

Compilation language and interpretation language

21、 TF coordinate transformation (I): coordinate MSG message

Chapter I Introduction

PHP memory horse

Read the introduction tutorial of rainbow

6、 C language circular statement
![[complete installation package & tutorial] sqlserver basic installation_ Sqlserver completely uninstalled_ Sqlserver custom installation_ Getting started with sqlserver_ SQLSERVER database](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[complete installation package & tutorial] sqlserver basic installation_ Sqlserver completely uninstalled_ Sqlserver custom installation_ Getting started with sqlserver_ SQLSERVER database
随机推荐
Mysql使用left join连表查询时,因连接条件未加索引导致查询很慢
How to gracefully encapsulate anonymous inner classes (DSL, high-order functions) in kotlin
C callback function, interface function pointer as function parameter, function pointer as structure member
Some considerations for installing Oracle11g
Compose learning notes 1-compose, state, flow, remember
2、 Declaration and definition of variables and constants
Rocky基础之修改网卡名为eth0
20、 ROS distributed communication
Redis redis use in jedis
Foundation of knowledge atlas (II) - knowledge expression system of knowledge atlas
云计算需要考虑的安全技术列举
Examples of Pareto optimality and Nash equilibrium
Analysis vulnerability introduction
Various pitfalls encountered in UI development
Reptile: from introduction to imprisonment (I) -- Concept
Privacy computing summary
(function(global,factory){
Second class exercise
21、 TF coordinate transformation (I): coordinate MSG message
Modify the default path of Jupiter notebook