CentOS 7搭建LAMP环境上线PHPMyAdmin系统
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,一、安装Apache服务关于安装Apache详细配置及原理概述请参考:CentOS 7.4搭建Apache网站服务[root@centos01 ~]# mount /dev/cdrom /mnt/
千家信息网最后更新 2026年11月01日CentOS 7搭建LAMP环境上线PHPMyAdmin系统
一、安装Apache服务
关于安装Apache详细配置及原理概述请参考:CentOS 7.4搭建Apache网站服务
[root@centos01 ~]# mount /dev/cdrom /mnt/ [root@centos01 ~]# cp /mnt/* /usr/src/ [root@centos01 ~]# mount /dev/cdrom /mnt/ [root@centos01 ~]# rm -rf /etc/yum.repos.d/CentOS-* [root@centos01 ~]# tar zxvf /usr/src/httpd-2.2.17.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/httpd-2.2.17/ [root@centos01 httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi [root@centos01 httpd-2.2.17]# make && make install [root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/ [root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd [root@centos01 ~]# chmod +x /etc/init.d/httpd [root@centos01 ~]# vim /etc/init.d/httpd #chkconfig:35 80 20 #description:apache [root@centos01 ~]# chkconfig --add httpd [root@centos01 ~]# chkconfig --level 35 httpd on [root@centos01 ~]# vim /usr/local/httpd/conf/httpd.conf 98 ServerName 192.168.100.10:80 [root@centos01 ~]# systemctl start httpd [root@centos01 ~]# netstat -anptu | grep 80 tcp6 0 0 :::80 :::* LISTEN 53682/httpd 二、安装MySQL数据库
安装MySQL详细配置及MySQL原理概述请参考:Centos安装MySQL数据库
[root@centos01 ~]# groupadd mysql [root@centos01 ~]# useradd -M -s /sbin/nologin -g mysql mysql [root@centos01 ~]# yum -y install ncurses-devel [root@centos01 ~]# tar zxvf /usr/src/cmake-2.8.6.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/cmake-2.8.6/ [root@centos01 cmake-2.8.6]# ./configure && gmake && gmake install [root@centos01 ~]# tar zxvf /usr/src/mysql-5.5.22.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/mysql-5.5.22/ [root@centos01 mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DSYSCONFDIR=/etc [root@centos01 mysql-5.5.22]# make && make install [root@centos01 mysql-5.5.22]# cp support-files/my-medium.cnf /etc/my.cnf cp:是否覆盖"/etc/my.cnf"? y [root@centos01 mysql-5.5.22]# cp support-files/mysql.server /etc/init.d/mysqld [root@centos01 ~]# chmod +x /etc/init.d/mysqld [root@centos01 ~]# chkconfig --add mysqld [root@centos01 ~]# chkconfig --level 35 mysqld on [root@centos01 ~]# vim /etc/profile [root@centos01 ~]# source /etc/profile [root@centos01 ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data [root@centos01 ~]# chown -R mysql:mysql /usr/local/mysql/ [root@centos01 ~]# systemctl start mysqld [root@centos01 ~]# mysqladmin -uroot password New password: Confirm new password: [root@centos01 ~]# mysql -uroot -ppwd@123 三、安装PHP
安装PHP详细配置及原理概述请参考:Centos 7搭建LNMP架构及部署Discuz论坛
[root@centos01 ~]# yum -y install zlib-devel libxml2-devel [root@centos01 ~]# tar zxvf /usr/src/libmcrypt-2.5.8.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/libmcrypt-2.5.8/ [root@centos01 libmcrypt-2.5.8]# ./configure && make && make install [root@centos01 libmcrypt-2.5.8]# ln -s /usr/local/lib/libmcrypt.* /usr/lib/ [root@centos01 ~]# tar zxvf /usr/src/mhash-0.9.9.9.tar.gz -C /usr/src [root@centos01 ~]# cd /usr/src/mhash-0.9.9.9/ [root@centos01 mhash-0.9.9.9]# ./configure && make && make install [root@centos01 mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.* /usr/lib/ [root@centos01 ~]# tar zxvf /mnt/mcrypt-2.6.8.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/mcrypt-2.6.8/ [root@centos01 mcrypt-2.6.8]# ./configure [root@centos01 mcrypt-2.6.8]# export LD_LIBRARY_PATH=/usr/local/lib [root@centos01 mcrypt-2.6.8]# ./configure [root@centos01 mcrypt-2.6.8]# make && make install [root@centos01 ~]# tar zxvf /usr/src/php-5.3.28.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/php-5.3.28/ [root@centos01 php-5.3.28]# ./configure --prefix=/usr/local/php --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php --enable-mbstring [root@centos01 php-5.3.28]# make && make install [root@centos01 php-5.3.28]# cp php.ini-production /usr/local/php/php.ini [root@centos01 ~]# tar zxvf /usr/src/zendguardloader-php-5.3-linux-glibc23-i386.tar.gz -C /usr/src/ [root@centos01 ~]# cd /usr/src/ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/[root@centos01 php-5.3.x]# lsZendGuardLoader.so[root@centos01 php-5.3.x]# cp ZendGuardLoader.so /usr/local/php/lib/php/ [root@centos01 php-5.3.x]# vim /usr/local/php/php.ini [PHP]zend_extension=/usr/local/php/lib/php/ZendGuardLoader.sozend_loader.enable=1[root@centos01 ~]# vim /usr/local/httpd/conf/httpd.conf 99 ServerName 192.168.100.10:80 168 DirectoryIndex index.html index.php311 AddType application/x-httpd-php .php[root@centos01 ~]# systemctl restart httpd [root@centos01 ~]# vim /usr/local/httpd/htdocs/index.php 四、部署phpMyadmin系统
[root@centos01 ~]# tar zxvf /usr/src/phpmyadmin-3.3.10-all-languages.tar.gz -C /usr/src/ [root@centos01 ~]# mv /usr/src/phpMyAdmin-3.3.10-all-languages//usr/local/httpd/htdocs/phpMyAdmin [root@centos01 ~]# cp /usr/local/httpd/htdocs/phpMyAdmin/config.sample.inc.php /usr/local/httpd/htdocs/phpMyAdmin/config.inc.php1、用户访问phpmyadmin系统

五、安装DNS
安装DNS详细配置及原理概述请参考:CentOS7简单搭建DNS服务
[root@centos01 ~]# yum -y install bind bind-chroot bind-utils[root@centos01 ~]# cp /etc/named.conf /etc/named.conf.bak[root@centos01 ~]# echo "" > /etc/named.conf[root@centos01 ~]# vim /etc/named.confoptions{ listen-on port 53 { any; }; directory "/var/named";};zone "benet.com" IN { type master; file "benet.com.zone"; allow-transfer { any; };};[root@centos01 ~]# named-checkconf -z /etc/named.conf[root@centos01 ~]# vim /var/named/benet.com.zone$TTL 86400@ SOA benet.com. root.benet.com( 2020020710 1H 15M 1W 1D)@ NS centos01.benet.com.centos01 A 192.168.100.10www A 192.168.100.10[root@centos01 ~]# named-checkzone benet.com /var/named/benet.com.zone[root@centos01 ~]# chmod 755 /var/named/benet.com.zone [root@centos01 ~]# chown named:named /var/named/benet.com.zone[root@centos01 ~]# systemctl start named[root@centos01 ~]# systemctl enable named1、使用域名访问phpmyadmin系统

-------- 本文至此结束,感谢阅读 --------
原理
参考
配置
系统
服务
数据
数据库
域名
架构
用户
网站
至此
论坛
环境
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
西安纸贵互联网科技有限公司
中国互联网科技工作委员会毛军
互联网扶贫科技
互联网下的科技发展
北京互联网科技公司
唐信互联网科技
贷财互联网科技
善班互联网科技有限公司
互联网科技缩写
互联网科技logo
润盈互联网科技
融贸通互联网科技
深圳艾佳互联网科技
海南购全球互联网科技
北京大学互联网科技怎么样
互联网为啥属于高科技
移动互联网科技公司
玉溪互联网科技怎么选
互联网科技和信息
科技和互联网行业的特点
上海挚品互联网科技有限公司
亿人帮互联网科技
互联网金融和金融科技
重庆科技学院互联网
移动互联网科技公司
互联网科技商业
北京互联网科技类企业分布
广州三三互联网科技有限公司
第三届互联网大会安防黑科技
科技互联网专业务虚会材料