CentOS yum安装 Apache + PHP + MySQL
程序员文章站
2022-06-30 21:57:34
...
一:安装MySQL
1.安装
yum install mysql mysql-server mysql-devel
2.启动MySQL
/etc/init.d/mysqld start
3.设置MySQL初始密码
假设密码设置为123456
mysqladmin -u root password 123456
4.设置远程登录权限
mysql -u root -p
输入密码
mysql> GRANT ALL PRIVILEGES ON *.* TO '用户名'@'地址' IDENTIFIED BY '密码' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;
二:安装Apache
yum install httpd httpd-devel
三:安装PHP及插件
yum install php php-mysql php-common php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
启动Apache
/etc/init.d/httpd start
设置开机启动
chkconfig mysqld on chkconfig httpd on
安装后的网页位置是 /var/www/html
如果要用其他机器访问需关闭防火墙
service iptables stop
或者自己设置防火墙允许访问端口80
iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
推荐阅读
-
64位CentOs7源码安装mysql-5.6.35过程分享
-
centOS7.4 安装 mysql 5.7.26的教程详解
-
centos系统为php安装memcached扩展步骤
-
centos6利用yum安装php mysql gd的步骤
-
centos7.2.1511安装jdk1.8.0_151及mysql5.6.38的方法
-
CentOS随笔 - 4.CentOS7安装MySql 5.5.60(下载 tar 方式安装)
-
Centos7 Yum安装PHP7.2流程教程详解
-
centos yum php 7.x 无需删除升级的方法
-
APMServ一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP运行平台教程
-
简单介绍win7下搭建apache+php+mysql开发环境