https://dev.mysql.com/downloads/repo/yum/
wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum -y install mysql57-community-release-el7-11.noarch.rpm
yum repolist enabled | grep mysql.*
yum -y install mysql-community-server
systemctl start mysqld.service
systemctl status mysqld.service
grep "password" /var/log/mysqld.log
登录
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'a123@654aA';
mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误
修改密码策略
在/etc/my.cnf文件添加validate_password_policy配置,指定密码策略
# 选择0(LOW),1(MEDIUM),2(STRONG)其中一种,选择2需要提供密码字典文件
validate-password-policy=0
如果不需要密码策略,添加my.cnf文件中添加如下配置禁用即可:
validate-password = off
systemctl restart mysqld
systemctl enable mysqld
systemctl daemon-reload
网址:
[root@localhost mysql]# cd /usr/local/src/
[root@localhost src]# wget http://syslab.comsenz.com/downloads/linux/httpd-2.2.16.tar.gz
[root@localhost src]# tar zxvf httpd-2.2.16.tar.gz
[root@localhost src]# cd httpd-2.2.16
[root@localhost httpd-2.2.16]# ./configure \
--prefix=/usr/local/apache2 \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--with-included-apr
如果这一步你出现了这样的错误:
error: mod_deflate has been requested but can not be built due to prerequisite failures
解决办法是:
yum install -y zlib-devel
为了避免在make的时候出现错误,所以最好是提前先安装好一些库文件:
yum install -y pcre pcre-devel apr apr-devel
错误:make: *** 没有指明目标并且找不到 makefile。 停止。
make: *** 没有指明目标并且找不到 makefile。 停止。
是因为没有安装gcc导致
安装命令:
yum install gcc
编译:
[root@localhost httpd-2.2.16]# make
安装:
[root@localhost httpd-2.2.16]# make install
以上两个步骤都可以使用 echo $?
来检查是否正确执行,否则需要根据错误提示去解决问题。
下载php: 网址:http://ftp.ntu.edu.tw/php/distributions/
[rot@localhost httpd-2.2.16]# cd /usr/local/src
[root@localhost src]# wget http://am1.php.net/distributions/php-5.3.27.tar.gz
[root@localhost src]# tar zxf php-5.3.27.tar.gz
[root@localhost src]# cd php-5.3.27
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php/etc \
--with-mysql-dir=/usr \
--with-mysqli \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6
遇到如下错误:
configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法是:
yum install -y libxml2-devel
还有错误:
configure: error: Cannot find OpenSSL's
解决办法是:
yum install -y openssl openssl-devel
错误:
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
解决办法:
yum install -y bzip2 bzip2-devel
错误:
configure: error: png.h not found.
解决办法:
yum install -y libpng libpng-devel
错误:
configure: error: freetype.h not found.
解决办法:
yum install -y freetype freetype-devel
错误:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决办法:
yum install -y epel-release
yum install -y libmcrypt-devel
两个不能一起安装,因为CentOs6默认的yum源没有 libmcrypt-devel这个包,只能借助epel的yum源,所以先安装epel,再安装libmcrypt。
vi /usr/local/apache2/conf/httpd.conf
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
DirectoryIndex index.html
DirectoryIndex index.html index.htm index.php
#ServerName www.example.com:80
ServerName localhost:8080
/usr/local/apache2/bin/apachectl -t
/usr/local/apache2/bin/apachectl start
[root@localhost ~]# netstat -lnp |grep httpd
tcp 0 0 :::80 :::* LISTEN 7667/httpd
[root@localhost ~]# curl localhost
It works!
vi /usr/local/apache2/htdocs/1.php
curl localhost/1.php
[root@localhost ~]# curl localhost/1.php
hello word[root@localhost ~]#
[root@localhost ~]# iptables -F