centos6.5 lamp environment of USES the yum installation method

  • 2020-05-12 06:38:29
  • OfStack

I found some from the Internet and finally sorted it out

1. Install Apache


yum -y install httpd

Start from startup


chkconfig httpd on

Start the httpd service


service httpd start

### install the apache 1 extensions


yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

# # note under the default apache configuration file in/etc/httpd/conf/httpd conf

2. Install and configure MySQL

# mysql client program

mysql-server server program

# mysql-devel develops libraries for design


yum -y install mysql mysql-server mysql-devel

Start up


chkconfig mysqld on

Start the mysqld service


service mysqld start

Do some security configuration


/usr/bin/mysql_secure_installation
netstat -tulpn | grep -i mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1723/mysqld

OK, we see that mysqld is started, listening on port 3306.

# # note

1. Database directory
/var/lib/mysql/
2. Configuration files
/usr/share/mysql (mysql.server command and configuration files)
3. Related commands
/usr/bin(mysqladmin mysqldump, etc.)
4. Start the script
/ etc rc. d/init. d/(mysql startup script file directory)
Change login password
MySQL does not have a password by default, so the importance of adding a password after installation is obvious.
1, the command
usr/bin/mysqladmin -u root password 'new-password'
Format: mysqladmin-u username -p old password password new password
Example 2,
Example 1: add password 123456 to root.
Type the following command:
[root@test1 local]# /usr/bin/mysqladmin -u root password 123456
Note: since root did not have a password at the beginning, the old password 1 entry of -p can be omitted.

3. Install php


To enable PHP to support MySQL, we can install the php-mysql package. You can also search for available php modules using the following command


yum -y install php php-mysql

Install the php common extension


yum search php
yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap

Restart the httpd service. This step is important


chkconfig httpd on
0

Then we provide php page for testing


chkconfig httpd on
1

/ * * * * * * * * * * * * * note to upgrade php5. 6 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /

You need to download the external yum source

Centos 5.X


chkconfig httpd on
2

CentOs 6.x


 rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

CentOs 7.X


chkconfig httpd on
4

Version 5.5


chkconfig httpd on
5

Version 5.6


chkconfig httpd on
6

Version 7.0


chkconfig httpd on
7

4. Install PHP FPM memory management


yum install php55w-fpm 
yum install php56w-fpm 
yum install php70w-fpm


Related articles: