Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build web server on raspberry pie

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to build a web server on the raspberry pie, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.

How to build a web server on your raspberry pie? Because you need to install updated software when setting up the server, but you should know that the default image source of raspberry pie is in the UK, and access from home will be very slow, so you need to change the image source to China. There are nine domestic image sources listed on the official website.

Connect to raspberry pie through the network with SSH and open / etc/apt/sources.list file with nano for editing

Back up the source file before editing

Change the image source of the system to domestic backup source files / etc/apt/sources.list to / etc/apt/sources.list.old with cp command

Change the sources.list content as follows; change to domestic Tsinghua University mirror site ctrl+O to save, ctrl+x exit.

Now Apache has gradually become the most popular Web server software on Internet, so we use apache2 to build, first install apache2

Command line terminal input command sudo apt-get install apache2-y

Enter the IP address of your raspberry pie in the browser, and if the following test interface appears, the Apache software is working properly.

In fact, the whole interface displayed is a html file located in the / var/www/html folder.

You can edit the html file, refresh the browser interface and see the changes.

Delete the original test index.html file and create a new index.php

The code can be written as follows

Save exit and refresh the browser

If you change the content of the index.php to time, you can dynamically refresh and observe the time change of the browser.

If you need our Apache server to process PHP files, you need to install PHP5

Installation command

Sudo apt-get install php5 libapache2-mod-php5-y

Install mysql

Enter password

Restart apache2

We also need WordPress and software systems, so download and install Wordpress

Decompression

To create a database, it is best to set a password

Press ctrl+D to exit the mysql command line

Configuration:

Enter the IP address of your PI on the browser and wait for the following language selection to appear

Click continue to fill in the user name and password

Log in

Edit configuration file,

Restart apache2

All right, all done, refresh the browser and test our results.

Add a new interface and change the background color. You can also add more elements to make your site beautiful.

Thank you for reading this article carefully. I hope the article "how to build a web server on raspberry pie" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report