CentOS Build Apache+php+mysql+redis Environment

Source: Internet
Author: User
Tags install php odbc pear

To build a local Linux server environment, yesterday in accordance with the network tutorial according to gourd painting scoop, after the crackling, found that Redis service is not good, do not like the kind of knowing that there is a problem but do not know how to feel, touched countless times after the wall, I decided to uninstall, start over, And remember each step as much as possible and understand each step at the same time. So, here's a record. Shortage of places, also please advise!

People live, it should be difficult to meet the difficulties, not afraid of difficulties and hardships, hahaha ha ha!

Okay, cut to the chase:

One, install the virtual machine and the CentOS system:

The virtual machine I am using is: vmware-workstation-11_gr.7z

System is: Centos-7-x86_64-minimal-1611.iso

The installation of VMware is basically the next step, and this is not a repeat.

After installation, go to the virtual machine main interface, select Add new virtual machine, and start installing the virtual machine:

Then follow the instructions. Before installation, there will be some settings such as time zone, network and so on, the basic choice is the default. Here are some of the configuration I chose during the installation, not the only one, according to their own needs can be set.

Here the username and password should be remembered, in the future to connect their own virtual machine will be used. The next steps, if there is no special need, the direct default is good.

This pop-up box is a hint that some of the plug-in packages that need to be installed do not, ignore the continuation of the installation, click Yes directly, you can install the virtual machine and then install the plug-ins.

Here is the basic settings of the virtual machine, basically choose Default and click Done in the upper left corner. The time zone and network need to be configured. Because the default network is dynamic IP will be constantly refreshed, not conducive to each of us to connect, so can be set to static IP, so that you do not have to view and then to connect.

Note: The above DNS settings are wrong and should be set to 8.8.8.8!!!

Proceed here, if there is an exclamation point in the option, go to the direct default setting and then done until began installation appears and click it to start the installation.

Then in the following interface, have been waiting, if appear and just the same popup box, all yes.

The login screen will be entered when the installation is complete:

Enter the user name and password you just set: (The password input is not displayed, you confirm the correct after the return).

This is the status of login success, this time can view their own IP, through the command IP addr can be viewed.

If you want to see clearer information, you can use the ifconfig command: This command is not installed by default, you need to enter the root mode, the installation can be used

SU Root return

Enter password, enter after successful login:

Note: You need to set the network adapter mode for the virtual machine to bridge, and then restart the Network service.

Command: Service Network restart

Yum Install Net-tools

After the installation is successful, enter: Ifconfig.

Second, Environment construction

The environment includes Httpd,php,mysql and Redis. The first three kinds can be installed by Yum, the last one slightly different, the following separately recorded:

1, install httpd

Command: Yum install httpd httpd-devel

Restart services after installation: service httpd start

Shut down firewall: Service stop FIREWALLD

Detection is successful: browser input your IP return

If this interface appears, the installation is successful.

2, install PHP

Command: yum-y install PHP

Yum-y Install PHP-FPM

Above is the basic PHP, the following command can install the base + extension:

Yum install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath Php-mhash

After successful installation, remember to restart the service for PHP to take effect.

Command: # systemctl Restart Httpd.service

Write test file:

VI var/www/html/info.php

Then write in the file: <?php phpinfo ();? >

Visit: Your ip/info.php

This shows that the installation was successful.

3, install MySQL

Command: yum-y install mariadb Mariadb-server

After installation is complete, start: Systemctl start mariadb

Database configuration: Mysql_secure_installation

Login after test completed: mysql-uroot-p

Install plugin: Yum install php-mysql phhp-gd php-imap php-idap php-odbc php-pear php-xml php-xmlrpc

4, installing Redis

Install wget command: Yum install wget

Installing Redis:wget http://download.redis.io/releases/redis-3.0.4.tar.gz

Yum GCC

CentOS Build Apache+php+mysql+redis Environment

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.