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 hard disk Partition in LAMP Server Environment by CentOS

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

Share

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

This article mainly introduces "CentOS how to build the hard disk partition of the LAMP server environment". In the daily operation, I believe many people have doubts about how to build the hard disk partition of the LAMP server environment in CentOS. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful for you to answer the doubt of "how to build the hard disk partition of the LAMP server environment in CentOS". Next, please follow the editor to study!

CentOS is one of the Linux distributions, which is compiled from the source code released by Red Hat Enterprise Linux in accordance with open source regulations. Because it comes from the same source code, some servers that require high stability replace the commercial version of Red Hat Enterprise Linux with CentOS. The difference between the two is that CentOS does not contain closed source software.

In the process of using Linux as a server, we often feel confused about the more reasonable allocation of partitions in the hard disk, especially for friends who have just come into contact with Linux, there is no bottom in mind for the reasonable allocation of each partition of hard disk space in the server, now list the following programs for everyone to learn! Of course, you can also make more reasonable decisions according to your own needs!

/ boot 100MB kernel and boot file

Mount point: select "/ boot"

File system type: use the default Ext4 journaling file system

Size: enter the assigned size in MB

Other size options: select fixed size.

Swap swap space, which is generally twice the server memory.

/ 10G

Mount point: select "/"

File system type: use the default Ext4 journaling file system

Size: enter the assigned size in MB

Other size options: select fixed size.

/ usr at least 5G, the whole Linux system is basically installed here. I like doing 10G.

Mount point: select "/ usr"

File system type: use the default Ext4 journaling file system

Size: enter the assigned size in MB

Other size options: select fixed size.

/ usr/loacl/ 5 to 10 gigabytes is enough (Oracle don't install here, otherwise it won't be enough to play, hehe) We are used to putting things compiled and installed by LAMP here (this is the power of habit, it is officially recommended that we install the / opt directory)

It's mainly for the PHP website.

/ home, there is no need to distinguish it.

The rest of the space is used for the PHP website (for example, mounted on / usr/local/apache2/htdocs/)

Pay attention to clean up the temporary files in time with a large number of visitors, at / tmp

Attention should also be paid to log files.

Conclusion: hard disk partition is often a problem that needs to be considered when the server is officially put into use, so the late use needs to be taken into account in the early planning process! This article gives a brick to attract jade, so that we can have a clearer understanding of the server's formal production environment.

CentOS partition hard disk partition scheme 2

To install the Linux system on your computer, partitioning the hard disk is a very important step. Here are several partitioning schemes.

(1) option 1

/: the recommended size is above 5GB.

Swap: swap partition, which is recommended to be 1-2 times the size of physical memory.

(2) option 2

/ boot: used to store programs related to Linux system startup, such as starting the bootloader, etc. The recommended size is 100MB.

/: the root directory of the Linux system. All directories are hung under this directory. The recommended size is above 5GB.

/ home: stores the data of ordinary users and is the host directory for ordinary users. The recommended size is the rest of the space.

Swap: implement virtual memory, which is recommended to be 1-2 times the size of physical memory.

(3) option 3

/ boot: used to store programs related to Linux system startup, such as starting the bootloader, etc. The recommended size is 100MB.

/ usr: used to store applications in Linux system, which has a lot of related data, which is recommended to be greater than 3GB.

/ var: used to store frequently changing data and log files in Linux system. It is recommended to be greater than 1GB.

/ home: stores the data of ordinary users and is the host directory for ordinary users. The recommended size is the rest of the space.

/: the root directory of the Linux system. All directories are hung under this directory. The recommended size is above 5GB.

/ tmp: keep the temporary disk in a separate partition to avoid affecting the stability of the file system when the file system is full. The recommended size is above 500MB.

Swap: implement virtual memory, which is recommended to be 1-2 times the size of physical memory.

At this point, on the "CentOS how to build LAMP server environment hard disk partition" on the end of the study, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

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

12
Report