Use the yum command in Centos to deploy the lamp environment

Source: Internet
Author: User
Use the yum command in Centos to deploy the lamp environment. by default, the IP security policy is enabled for Centos, that is, port 80 also prohibits external access, so disable iptables first. serviceiptablesstop or open iptables-IRH-Firewall-1-INPUT-mst to port 80...
Use the yum command in Centos to deploy the lamp environment. by default, the IP security policy is enabled for Centos, that is, port 80 also prohibits external access, so disable iptables first. service iptables stop or open iptables-I RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 80-j ACCEPT2. install apache yum install httpd (only install apache), if you want to install other plug-ins, you can install yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql www.2cto.com on the webpage/var/www/html3. install mysqlyum install mysql-server mysql-devel after completion, The following error may occur when running mysql: Can't connect to local MySQL server through socket '/var/lib/mysql. there are many reasons for sock errors. in this case, mysql cannot be found in the/var/lib/mysql/directory. the sock file can run service mysqld start or (/etc/init. d/mysqld start) if mysql is started successfully, mysql is generated in the/var/lib/mysql/directory. in the sock file, mysql is automatically started when the system is started. Otherwise, the error "Can't connect to local MySQL server through socket" is repeated. The automatic start command is as follows: the chkconfig mysqld on system does not set a password by default, that is, a blank password. if you want to set a mysql password, assume that the password is set to 123456 mysqladmin-u root password 123456. if you want to enable external access to mysql, you must set the user's external access to mysql> grant all privileges on *. * TO 'username' @ 'address' identified by 'password' with grant option; mysql> flush privileges; example, allow the root user to use the 123456 password 192.168.6.6 to connect to mysql> grant all privileges on *. * TO 'root' @ '192. 168.6.6 'identified BY '000000' with grant option; www.2cto.com mysql> flush privileges; in this example, allow ALL external users to connect to mysql WITH the root password 123456> grant all privileges on *. * TO 'root' @ '%' identified by '000000' with grant option; mysql> flush privileges; in this example, IP address 192.168.6.6 is allowed, USER root password 123456 connects to USER database mysql> grant all privileges on user. * TO 'root' @ '%' identified by '000000' with grant option; mysql> flush privileges; 4. install phpyum install php-mysql php-common php-gd php-mbstring php-mcrtpt php-devel php-xml Author yixiong
Related Article

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.