1. View data disks
Alibaba Cloud servers do not automatically partition after initialization. Therefore, before partitioning or formatting a data disk, you cannot view the data disk by running the "df-h" command, you can run the "fdisk-l" command to view details.
2. Partition data disks
Run the "fdisk/dev/xvdb" command to partition the data disk;
Enter "n", "p", "1", press enter twice, and "wq" as Prompted. The partition starts and will be completed soon.
3. View the new partition
Run the "fdisk-l" command to check that the new partition xvdb1 has been created.
4. Format the new partition.
Run the mkfs. ext3/dev/xvdb1 command to format the new partition. The formatting time varies with the disk size.
5. Add partition information
Run the echo '/dev/xvdb1/web ext3 defaults 0 0'>/etc/fstab command to write information about the new partition.
Run the "cat/etc/fstab" command to view the information.
6. Mount a new partition
Run the "mount-a" command to mount the new partition and run the "df-h" command to check whether the partition is successfully mounted.
At this point, the data disk is successfully mounted as a/web disk.
The name can be automatically modified. I set it to web.
Install the basic environment:
The Alibaba cloud server does not have gcc. Okay, use yum to install it;
First, modify/etc/yum. conf and add comments before exclude = kernel *. Otherwise, gcc cannot be installed.
Delete unnecessary software packages.
Delete unnecessary software packages
Yum remove Deployment_Guide-en-US finger cups-libs cups bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools ypbind
Delete files that are not safe.
Yum remove telnet rsh ftp rcp
Install the required software package for lnmp
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses- devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel openldap-devel nss_ldap openldap-clients openldap-servers
This step will take a while. After the execution, you can install lnmp. The one-click installation test of lnmp is available and will not be detailed here.