LINUX host installation from the initial environment to configuration completion

Source: Internet
Author: User
The entire process from the initial environment to the completion of configuration for LINUX hosts has been reset and reconfigured for some reason. The following describes the complete installation process: from the initial environment to the complete configuration process. (Note: The website server architecture I use is the one-click complete installation package of lnmp...
The entire process from the initial environment to the completion of configuration for LINUX hosts has been reset and reconfigured for some reason. The following describes the complete installation process: from the initial environment to the configuration process. (Note: The website server architecture I use is the one-click complete installation package of lnmp ), this should be the most comprehensive installation process at present. If you have no installation experience on a LINUX host, you can refer to it. if you are not doing well, you are welcome to give suggestions for modification. In addition, we would like to thank ap6779g4h for their great help during the configuration process. The following describes the entire process: www.2cto.com I. first, mount the data disk. 1. run the "df-h" command to view the data disk before partitioning or formatting the data disk, you can run the "fdisk-l" command to view the data disk. 2. run the "fdisk/dev/xvdb" command to partition the data disk. enter "n", "p", and "1" as prompted ", press enter twice and press "wq". The partition starts and will be completed soon.
3. run the "fdisk-l" command to view the new partition. The new partition xvdb1 has been created. 4. format the new partition and use the "mkfs. ext3/dev/xvdb1" command to format the new partition. the formatting time varies with the hard disk size. 5. run the echo '/dev/xvdb1/mnt ext3 defaults 0 0'>/etc/fstab command to add the partition information and write the new partition information. Run the "cat/etc/fstab" command to view the information. 6. 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 mounted successfully, and it exists as/mnt. Www.2cto.com 2. after using putty to log on to the system, upgrade the system kernel to the latest yum update. 3. 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 4. delete insecure software packages: yum remove telnet rsh ftp rcp 5. configure firewall 1. clear existing iptables rules: iptables-Fiptables-Xiptables-Z2. open the specified port: (you need to leave your modified SSH login port in the firewall: modify row 4th and change 22 to your new port) iptables-a input-s 127.0.0.1-d 127.0.0.1-j ACCEPTiptables-a input-m state -- state ESTABLISHED, RELATED-j ACCEPTiptables-a output-j ACCEPTiptables-a input-p tcp -- dport 22-j ACCEPTiptables-a input-p tcp -- dport 80-j ACCEPTiptables-a input-p tcp -- dport 21-j ACCEPTiptables-a input-p tcp -- dport 20-j ACCEPTiptables-a input-j REJECTiptables-a forward-j REJECT3, save firewall rule service iptables save 6, install lnmp1. install screenyum install screen to run: screen-S lnmp2. download LNMP one-key installation package: wget-c http://soft.vpser.net/lnmp/lnmp0.9-full.tar.gz3 Unzip LNMP one-key installation package: tar zxvf lnmp0.9-full.tar.gz 4, start to install LNMP one-key installation package: execute cd lnmp0.9-full /. /centos. sh 2> & 1 | tee lnmp. log to enter the domain name to be bound (a second-level domain name (such as web.123.com) is recommended. This domain name will be bound to/home/wwwroot/for future management convenience. do not use your primary domain name! If the input is incorrect, press Ctrl and then press the Backspace key to delete it.) after the input is complete, press enter and enter the MySQL root password to be set. after the input is complete, press enter to install InnoDB, enter y to press Enter. if not, press enter. Prompt "Press any key to start...", Press enter to start installation. The LNMP script automatically installs and compiles software Nginx, MySQL, PHP, phpMyAdmin, and Zend Optimizer. VII. VM Management 1. add a VM and execute the following command:/root/vhost. sh enter the domain name to be bound as prompted, and press Enter. if you want to add more domain names, enter y, and then enter the domain name to be bound. multiple domain names can be separated by spaces (note: domain names with or without www are different. if you want to access the same website with or without www, you must bind them to both ). Enter the directory bound to the domain name (absolute directory, for example,/home/wwwroot/lnmp). If this parameter is left blank, the default domain name is/home/wwwroot, the directory is not necessarily/home/wwwroot/. if/data/has a large amount of space, you can enter/data/www/lnmp or something like that .), Then, select whether to add pseudo-static rules. The default options include discuz, discuzx, wordpress, sablog, emlog, dabr, phpwind, and wp2 (Level-2 directory wp pseudo-static ), you can directly enter the above name. if you need to add custom pseudo-static rules and enter a desired name, the program will automatically create a pseudo-static file, directly go to/usr/local/nginx/conf/your custom pseudo-static name. add pseudo-static rules to the conf file (note: after adding the/etc/init file. d/nginx restart takes effect ). Next, you will be prompted whether to enable the log function. Generally, you do not need to start it. simply enter n. If you need to start it, enter y, and then enter the name of the log file to be defined, press enter to automatically add a VM. 2. delete the VM and run rm/usr/local/nginx/conf/vhost/domain name in ssh. conf 8. to modify the website and mysql directory, you only need to modify the configuration file of the corresponding virtual host, change the root directory to a new directory, and then execute: the old cp-a directory contains the new chown www: www-R directory. To change the MySQL Directory, stop the mysql server/etc/init. d/mysql stop. the new directory uses/mnt/mysql/as an example. then cp-R/usr/local/mysql/var/*/mnt/mysql/and chown mysql: modify/etc/my under mysql-R/mnt/mysql. cnf, find [mysqld], add datadir =/mnt/mysql/save below, and start mysql.
9. install other components (note: the following components must be installed in the lnmp0.9 installation directory, that is, the directory after the lnmp compressed package is decompressed and the cd lnmp0.9/directory !, If not, execute find/-name eaccelerator. sh to search .) (Note: the following components are not necessarily required by you. please use them as needed !) 1. install the PureFTPd and FTP management panel and execute the following command :. /pureftpd. sh press the prompt to enter your MySQL root password, FTP user management panel password, MySQl FTP database password (you can directly press enter to automatically generate a password), press enter to confirm, the PureFTPd will be automatically installed, prompting you to execute http: // your domain name or IP/ftp/in the browser after installing the PureFTPd, and enter the password of the FTP user management panel you set earlier, you can manage FTP. 2. install eAccelerator and run the following command:./eaccelerator. sh. select the version as Prompted. after you press enter to confirm, the web service will be automatically installed and restarted. 3. install ionCube. run the following command:./ionCube. sh and press enter to confirm the installation. the web service is automatically installed and restarted. 4. install imageMagick and run the following command:./imageMagick. sh press enter to confirm the installation. then the web service is automatically installed and restarted. 5. run the following command to install memcached:./memcached. sh and press enter to confirm the installation. then, the web service is automatically installed and restarted. 6. to upgrade Nginx, run the following command:./upgrade_nginx.sh and enter the nginx version number as prompted, for example, 1.0.10. the version number can be obtained from http://nginx.org/en/download.html. (Note: MySQL and PHP-FPM will be paused during upgrade .) 7. upgrade PHP and run the following command:./upgrade_php.sh. enter the php version number as prompted, for example, 5.3.6. (Note: some website programs, such as shopex, have compatibility issues. before upgrading, make sure that the programs you use support v5.3. Nginx, MySQL, and PHP-FPM are paused during upgrade .)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.