当前位置:网站首页>Build a simple website by yourself
Build a simple website by yourself
2022-06-29 04:05:00 【talk_ eight】
I am going to build my own website , On the one hand, it is to understand the knowledge of building the station , Another aspect is to test Http Request related content .
Site information
The following is the information needed to build the station :
- service device : That is, a more advanced computer , It is mainly used to store web data ;
- web The server : It's a software , Commonly used Apache and Nginx;
- Web program : Is the content displayed on the website , You need to write it yourself ;
Station building steps
Here are the specific implementation steps , Please refer to :
- stay Win7 Install a virtual machine on , I installed
VirtualBox; Then create a virtual machine to act as a server ; - Install... In a virtual machine Linux System , I installed yes Mint, If there is one that will not be installed , You can see my previous Blog ;
- stay Linunx Installation in system Web The server , I installed
Nginx, Simplicity , I use the command directly to install , As follows :
sudo apt install nginx-full
Demo site
here , A simple website has been created , Next, verify that the website you created is available . Start by opening Mint Browser in ( The default is Firefox), Type in the browser's address bar localhost( perhaps 127.0.0.1), A web page will be displayed , The details are shown in the following figure :

This is a Nginx Server default web page , If this page cannot be displayed , explain Nginx Installation failed . install Nginx You can also compile the source code to install , The advantage is that various requirements can be configured , The disadvantage is that the installation time is long and relatively complex .
Except on this machine ( Servers in virtual machines ) Go outside the website , You can also do it in Win7( host ) Visit the website on , Start by opening Win7 Browser in , Then enter the virtual machine in the browser IP Address , The page in the picture above... Will be displayed . This access method is similar to the real scene : The server in the virtual machine is equivalent to the server in the real scene ,Win7 It is equivalent to the computer we use everyday .
When using this method, you also need to set the network of the virtual machine , Otherwise, you can't be in Win7( host ) Access the server on the Internet ( In the virtual machine Nginx The server ), The specific settings are as follows :
Open the setting menu of the virtual machine , Select the network , Select the network card in the pop-up window 2, Set it to Host-Only The Internet , The details are shown in the following figure :

A simple website is built in this way , I hope everyone can practice by themselves , In this way, we can master the principle behind it .
Station building principle
In the actual project , The same principle applies to building websites , But the server is a real computer, not a virtual machine , The operating system running on the server may be Linux perhaps Windows Server. Running on the server Web The server might be Apache perhaps Nginx. What we use for simplicity is Nginx default Web page , You need to create your own in the actual scene Web page , This is what we usually call the front end . The server we use to access the network IP Address , It is not allowed in the actual scene , So we need to pass DNS Server handle IP Address to domain name address , That is what we often use www.xxx.com. We are just demonstrating how to create a simple web site , So it's not used DNS Server resolves domain name .
边栏推荐
- Data collection and management [3]
- 选对学校,专科也能进华为~早知道就好了
- Source code analysis of go redsync distributed lock
- Do you feel confused when you study at three in the morning?
- High performance current limiter guava ratelimiter
- 【C语言】开启一个线程
- 云原生周报 | Grafana 9正式发布;云原生词汇表中文版现已上线
- MySQL can only add small tables when adding tables dynamically. If you increase the size of tables, you won't read data when running tasks. Is there any solution
- Idea of importing point cloud map into gazebo
- Data statistical analysis (SPSS) [3]
猜你喜欢

Zhai Jia: from technical engineer to open source entrepreneur of "net red"

Cloud native weekly | grafana 9 was officially released; The Chinese version of cloud native vocabulary is now online

Technology: how to design zkvm circuit

Why are you a test / development programmer? Can you recall

Baidu AI Cloud service grid product CSM release 𞓜 hot public beta

HCIE-Security Day41:理论学习:信息收集与网络探测

What is the dry goods microservice architecture? What are the advantages and disadvantages?

Mobileone: the mobile terminal only needs 1ms of high-performance backbone

数据库和缓存如何保持一致性

The second meeting of the Second Council of Euler open source community was held, and Xinhua III, hyperfusion and Godson Zhongke became members of the Council
随机推荐
【C语言】 详解线程退出函数 pthread_exit
Data collection and management [4]
技术:如何设计zkVM电路
赚钱的5个层次,你在哪一层?
基于可变参模板实现的线程池
Data collection and management [3]
Why is the test post a giant pit? The 8-year-old tester told you not to be fooled
干货丨微服务架构是什么?有哪些优点和不足?
大神们 在富函数的open中从mysql连接池里取连接 连接池初始化是20个 如果富函数的并行度是1
Microsecond TCP timestamp
谁家的加密密钥,写死在代码里?(说的就是你)
Common methods of JS date and time
Data statistical analysis (SPSS) [4]
MySQL review materials (additional) case when
[MCU framework][dfu] DFU upgrade example with CRC verification + timeout mechanism +led indicator + chip locking + chip self erasure
高性能限流器 Guava RateLimiter
On June 27, 2022, I have the right to choose the journey of the summer vacation.
Here comes Wi Fi 7. How strong is it?
[filter design] customize the filter with MATLAB according to the design index
I came from a major, so I didn't want to outsource