Linux基础14
一、搭建LAMP平台
安装包:mariadb-server、php、php-mysqlnd、php-xml、php-json
搭建平台步骤:
php步骤:
创建网页:index.php
网页内编写php语言:
> eg:<?php
>
> phpinfo();
>
> ?>
数据库步骤(mariadb):
设置mariadb用户密码:mysqladmin -u [用户名] passwd [密码];
创建数据库:create database [库名];
进行用户授权:grant all on [库名].* to run[库名]@localhost indentified by '[用户密码]';
> 验证用户授权信息:show grants for run[库名]@localhost
网页步骤(httpd):
创建网页:
修改:配置文件httpd.conf
添加网页根目录:DocumentRoot "/var/www/html"
添加默认首页:DirectoryIndex index.php
重启网页服务
二、搭建ntp服务
安装包:chrony
服务:chronyd
配置文件:/etc/chrony.conf
服务端:
修改配置:
#pool 2.pool.ntp.org iburst
allow all
local stratum 10
客户端:
修改配置:
[server] [服务端ip地址] iburst #与服务端同步时间
> 修改配置文件后重启服务
-----------------------------------------------------------------------------------------------------------------------------
补充:
ftp文件下载:wget [ftp://ip/url/file] #默认下载到当前目录