Linux----------lamp组合应用平台
目录
一、工作原理1.1 LAMP简介lamp/lnmp 其实就是由Linux+Apache/Nginx+Mysql/MariaDB+Php/Perl/Python的一组动态网站或者服务器的开源软件,除Linux外其它各部件本身都是各自独立的程序,但是因为经常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。 LAMP : 1.2 http与php结合的方式CGI 1.3 简单快速部署LAMPCentOS 7: 1.31 yum安装CentOS 6: CentOS 7: 1.32 编译安装编译安装http PHP mysql/mariadb 二、常见LAMP应用PhpMyAdmin是一个以PHP为基础,以Web-Base方式架构在网站主机上的MySQL的数据库管理工具,让管理者可用Web接口管理MySQL数据库 WordPress是一种使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。也可把WordPress当作一个内容管理系统(CMS)来使用 2.1 部署phpmyadminyum -y install httpd mariadb-server php php-mysql systemctl start httpd systemctl start mariadb mysql_secure_installation 下载:https://www.phpmyadmin.net/downloads/ tar xvf phpMyAdmin-4.0.10.20-all-languages.tar.xz cd /var/www/html cd phpadmin/ cp config.sample.inc.php config.inc.php yum -y install php-mbstring systemctl reload httpd 2.2 部署wordpress下载地址:官网:https://cn.wordpress.org/ 解压缩WordPress博客程序到网页站点目录下 unzip wordpress-4.3.1-zh_CN.zip 新建wpdb库和wpuser用户 mysql> create database wpdb; mysql> grant all privileges on wpdb.* to [email?protected]'%' identified by "wppass"; 打开http://webserver/wordpress进行页面安装 注意wordpress目录权限 Setfacl –R –m u:apache:rwx wordpress 2.3 编译php-xcache加速访问CentOS7编译Php-xcache加速访问 三、Centos7编译安装LAMP在centos7上编译安装LAMP: 3.1二进制安装mariadbftp://172.16.0.1/pub/Source/7.x86_64/mariadb/mariadb-5.5-46-linux-x86_64.tar.gz tar -xvf mariadb-5.5-46-linux-x86_64.tar.gz -C /usr/local cd /usr/local ls -sv mariadb-5.5.46-linux-x86_64 mysql cd mysql chown -R root.mysql /usr/local/mysql mkdir /opt/data -p chown -R mysql.mysql /opt/data mkdir /etc/mysql vim /etc/profile.d/mysql.sh export PATH=/usr/local/mysql/bin/:$PATH cp support-files/my-large.cnf /etc/mysql/my.cnf vim /etc/mysql/my.cnf [mysqld]加三行 datadir =/opt/data innodb_file_per_table = ON skip_name_resolve = ON scripts/mysql_install_db --user=mysql --datadir=/opt/data cp support-files/mysql.server /etc/rc.d/init.d/mysqld chkconfig --add mysqld service mysqld start /usr/local/mysql/bin/mysql 测试是否成功 3.2 编译安装httpd-2.4groupadd -r apache 3.3 编译安装php-5.6官网下载源包 tar php-5.6* -C /usr/src/ yum install libxml2-devel bzip2-devel libmcrypt-devel -y ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-png-dir --with-jpeg-dir --with-freetype-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 make -j 2 && make install 3.4 编译安装php-7.1.7官网下载源包 tar php-7.1.7* -C /usr/src/ cd /usr/src/php-7.1.7/ ./configure --prefix=/app/php --enable-mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with- libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt -- with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-maintainer-zts --disable-fileinfo 注意:php-7.0以上版本使用--enable-mysqlnd --with-mysqli=mysqlnd ,原--with-mysql不再支持 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |