Today, I bought a Linux VPS and want to use it as a blueprint to review the web server. Let's talk about some of its configurations. Because we are in China, 1. We need to add and install the source cdetcyum.repos.detcyum.repos.dcentos.21andy.com. repo to add the accepted content [CentALT] name21Andy. compackagesforw.iselinux
Today, I bought a Linux VPS and want to use it as a blueprint to review the web server. Let's talk about some of its configurations. Because we are in China, 1. therefore, you need to add and install the source cd/etc/yum. repos. d // etc/yum. repos. d/centos.21andy.com. add and accept content in repo [CentALT] name = 21Andy.com Packages for Enterprise Linux
Today, I bought a Linux VPS and want to use it as a blueprint to review the web server. Let's talk about some of its configurations.
Because we are in China,
1. Add the installation Source
Cd/etc/yum. repos. d/
/Etc/yum. repos. d/centos.21andy.com. repo
Add accept content
[CentALT]
Name = 21Andy.com Packages for Enterprise Linux 5-$ basearch
Baseurl = http://www.21andy.com/centos/5/?basearch/
Enabled = 1
Gpgcheck = 0
Protect = 1
Remember to update
Rpm-Uvh http://centos.alt.ru/repository/centos/5/i386/centalt-release-5-3.noarch.rpm
Rpm-Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Yum-y update
2. Complete installation of php mysql nginx
Yum-y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php -pear php-pecl-memcache php-eaccelerator
Note that during mysql installation, it will not remind you to enter the account password as prompted during Windows installation. It will first default to an account root password which is not empty, so we need to re-design the mysql account password.
3. Start the service
Service mysqld start
Service php-fpm start
Service nginx start
Chkconfig -- level 345 mysqld on // set startup
Chkconfig -- level 345 php-fpm on // set startup
Chkconfig -- level 345 nginx on // set startup
Configure mysql as follows
1. mysql-u root // use the root account to log on
2. select user, host, password from mysql. user; // view user information
3. set password for root @ localhost = password ('Enter the root password' here) // set the password
4. exit;
5. mysql-u root-p
6. Enter the password
7. The password is successfully set.
After MySQL is installed, a user with a blank username and password exists. This makes it possible for the database server to be logged on without a password. Delete anonymous users to eliminate potential risks.
8. delete from mysql. user where user = '';
9. select user, password, localhost from mysql. user;
Mysql configuration is complete!
About nginx Configuration
Remember to enable port 80 how to enable port 80 to see the http://www.phpyu.com /? Post = 61
Original article address: Centos Nginx + php + mysql configuration. Thank you for sharing it with me.