www Server build Note: Two Lamp,centos6.5+yum download the latest apache+mysql+php

Source: Internet
Author: User
Tags install php iptables

Wamp Build Note Portal: http://www.cnblogs.com/jianming348/p/3952649.html

Because I do not want to delve into the principle, just need to build the environment. So using Yum on Linux is a great tool to use.

It downloads and installs the latest version of the software, and downloads its associated libraries.

System:

CentOS6.5, the system comes with Yum, so it does not need to be installed beforehand, without Yum, on the next installation

Syntax yum parameter download software name

The parameter-y is the default choice yes, while using Yum, there will be a select Yes and no to confirm whether to download the file

The following operations are required to enter the root administrator user, text mode

Apache steps:

1. Download and install Apache, execute

Yum-y Install httpd

Apache's website is in this position/var/www/html/, can go to test

2. Launch Apache, execute

/ETC/INIT.D/HTTPD start

3. Set Apache boot up, execute

Chkconfig httpd on

MySQL steps:

1. Download and install MySQL, execute

Yum-y install MySQL Mysql-server

MySQL is a client package for login management, to create an update to modify the database

Mysql-server is a service-side package that is responsible for starting the database service

Two are dependent.

2. Start MySQL, execute

/etc/init.d/mysqld start

3. Change the root password of MySQL

Keywords for general SQL statements, all uppercase, easy to distinguish

Enter "MySQL" into MySQL mode

Enter "use MySQL;" , including the semicolon to enter, which is the SQL statement, select the default database named MySQL database

Enter "UPDATE user SET Password=password (' 123456 ') WHERE user = ' root ';"

This means that from the user table (the first user) to find out the username (the following users) is the root user, the user's password (password) to 123456, must have the password () function, otherwise the password format is different, cannot login.

Enter "flush privileges;" To flush the changes into memory immediately, so that you do not have to reboot.

Enter "Exit" to exit MySQL mode

4. Set up MySQL boot, execute

Chkconfig mysqld on

php Steps:

1. Download and install PHP

Yum install php php-mysql php-common php-xml

Php-mysql is the extension pack for PHP application MySQL database

Php-common is the basic library of PHP, some of which may be used, SOCKET,HASH,FTP, etc.

This will require the installation and configuration of the files, all done, and then restart Apache, test the PHP effect.

Sometimes, other machines cannot access the Linux server because the firewall does not have open port 80, and the HTTP protocol is requested with Port 80, which requires modifying the firewall configuration.

You can use the/etc/init.d/iptables status to view the firewall status

To turn on port 80, execute (case to enter correctly)

/sbin/iptables-i input-p-tcp-dport 80-j ACCEPT

Parameter-I Capital I, is a rule inserted, followed by the rule

INPUT all uppercase, is the name of the chain, Config_ip_nf_filter has three chain input,forward,output. Input refers to the filter chain when other machines are connected to this server

P is a shorthand for protocol, followed by the protocol name

-TCP is the protocol name

-dprot two bars represent parameters in the parameter TCP, destination port

-j the next thing you want to do, J is probably what the jump means.

Yum is easy to use, but cannot be manipulated easily.

If you want to know where Yum files will be placed after installation, you can perform RPM-QL package name viewing, such as RPM-QL HTTD can see where Apache is installed, and what related files

If you want to know the purpose of a package, you can execute the RPM-QI package name, such as Rpm-qi httpd

www Server build Note: Two Lamp,centos6.5+yum download the latest apache+mysql+php

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.