安装httpd参考博客https://blog.csdn.net/qq_36113598/article/details/77532647yum install httpd配置ServerNamevi /etc/httpd/conf/httpd.conf将#ServerName www.example.com:80修改为ServerName localhost:80外...
安装httpd
参考博客
https://blog.csdn.net/qq_36113598/article/details/77532647
yum install httpd
配置ServerName
vi /etc/httpd/conf/httpd.conf
将#ServerName www.example.com:80修改为ServerName localhost:80
外部机器此时输入服务器的IP地址,应该看到apache的服务页面,端口不用输,apache默认就是使用80端口
systemctl start httpd.service #开启httpd服务
systemctl enable httpd.service#配置httpd服务开机自启
关闭防火墙
Systemctl stop firewalld.service
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning, 开启后显示running)
安装php
yum install php
重启apache服务
Systemctl httpd restart
安装mysql
参考博客
https://www.cnblogs.com/zhanzhan/p/7729981.html
1、安装MariaDB
安装命令
yum -y install mariadb mariadb-server
安装完成MariaDB,首先启动MariaDB
systemctl start mariadb
设置开机启动
systemctl enable mariadb
接下来进行MariaDB的相关简单配置
mysql_secure_installation
首先是设置密码,会提示先输入密码
Enter current password for root (enter for none):<–初次运行直接回车
设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,n,否则无法远程管理
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
初始化MariaDB完成,接下来测试登录
mysql -u root -p
enter password:
进入mariaDB页面
本文标题为:centOS7 搭建LAMP服务器(apache+php+MariaDB)
- windows下9款一键快速搭建PHP本地运行环境的好工具(含php7.0环境) 2023-09-02
- PHP仿tp实现mvc框架基本设计思路与实现方法分析 2022-10-18
- 用nohup命令实现PHP的多进程 2023-09-02
- PHP中PDO事务处理操作示例 2022-10-15
- php微信公众号开发之秒杀 2022-11-23
- Laravel balde模板文件中判断数据为空方法 2023-08-30
- laravel通用化的CURD的实现 2023-03-17
- PHP简单实现二维数组的矩阵转置操作示例 2022-10-02
- laravel实现按月或天或小时统计mysql数据的方法 2023-02-22
- PHP实现微信支付(jsapi支付)流程步骤详解 2022-10-09