网站部署---LAMP环境部署PHP网站
2021-01-22 07:12
标签:rest set 系统 error too dex 移除 ecshop ecs 系统环境要求 centos7,yum源正常使用,ip设置为:192.168.8.201; LAMP环境配置 ###软件环境设置 sed -i ‘s/\;date\.timezone \=/date\.timezone \= "PRC"/‘ /etc/php.ini cd /var/www/html 数据库初始化 ###mysql安全初始化 # mysql_secure_installation 网站安装 # ~~~上传网站源码,解压、修改文件权限; cd /var/www/html/;mkdir opensns; web界面配置网站 find ./ -name install #查找网站安装页面; 登录网站安装页面,如下图。 登录网站后台 登录网站前台 网站部署---LAMP环境部署PHP网站 标签:rest set 系统 error too dex 移除 ecshop ecs 原文地址:https://www.cnblogs.com/chalon/p/13286919.html
systemctl disable firewalld;systemctl stop firewalld;systemctl status firewalld
setenforce 0;getenforce;sed -i ‘s/SELINUX=enable/SELINUX=disabled/g‘ /etc/selinux/config
more /etc/selinux/config
###安装基础软件
yum -y install net-tools vim-enhanced wget lrzsz bash-completion unzip #补全功能需切换终端或重启;
yum list net-tools vim-enhanced wget lrzsz bash-completion unzip
###安装lamp组件及相关插件;
yum -y install httpd php mariadb mariadb-server php-mysql php-gd php-mbstring
yum list httpd php mariadb mariadb-server php-mysql php-gd php-mbstring
systemctl enable httpd mariadb;systemctl start httpd mariadb;systemctl status httpd mariadb
netstat -anptu |grep httpd;netstat -anptu |grep mysqld
###配置php.ini以便调试网站;
sed -i ‘s/display_errors = Off/display_errors = On/‘ /etc/php.ini
sed -i ‘s/display_startup_errors = Off/display_startup_errors = On/‘ /etc/php.ini
systemctl restart httpd;systemctl status httpd
###~~~测试网站是否正常;
curl http://127.0.0.1
cat >index.php phpinfo();
?>
eof
more index.php
curl http://127.0.0.1 #测试网站是否支持php;
mysql -e "drop database test;";mysql -e "show databases;" #删除test库及访问权限;
mysql -e ‘drop user ""@localhost;‘ #移除匿名用户,默认4个root账户,2个匿名用户;
mysql -e ‘delete from mysql.user where User="" and Host="localhost.localdomain"; ‘ #删除匿名用户;
mysql -e ‘select User,authentication_string,Host from mysql.user;‘ #查看用户及登录ip;
mysql -e "SHOW GRANTS FOR ‘root‘@‘localhost‘;" #查看mysql用户权限;
mysql -e "create database ecshop;" #创建数据库;
mysql -e "flush privileges;" #刷新配置;
mysqladmin -uroot password 123456;history -c #设置用户密码;
unzip -d ./opensns opensns.zip
id apache;chown -R apache:apache /var/www/html/opensns
ll !$
chmod -R 754 /var/www/html/opensns/Data/