centos下面安装apache命令:
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
启动apache服务器:
systemctl start httpd.service
查看公网的ip地址:(这个命令查询不到,是内网的) 去云产品资源查看,在自己电脑访问ip
ip addr
访问:
能访问到apache默认页面就成功了!
安装msyql:
rpm -e mariadb-libs --nodeps
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-common-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-compat-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-client-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-server-5.7.35-1.el7.x86_64.rpm
启动msyql:
systemctl start mysqld.service
修改密码:
刷新授权让密码生效:
安装php:
yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap
创建页面方便测试:
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
重启web服务器:
systemctl restart httpd
访问:http://106.15.78.223/phpinfo.php
能打开phpinfo看到php具体信息