1 Linux建站
1.1 红帽LAMP建站
基础环境
[root@localhost /]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.2 (Maipo) [root@localhost /]# uname -a Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux [root@localhost /]#
1.1.1、配置好yum环境
具体参考:https://www.cnblogs.com/snow2021/p/16935535.html#_label3
1.1.2 安装lamp环境
[root@localhost /]# yum -y install httpd php php-mysql mysql mysql-server
1.1.3 启动apache和mysql服务
[root@localhost /]# service httpd start Redirecting to /bin/systemctl start httpd.service [root@localhost /]# service mysqld start Redirecting to /bin/systemctl start mysqld.service
解决mysql报错问题:参考https://blog.csdn.net/weixin_43303530/article/details/103713915
centos7默认安装的是mariaDB,而不是mysql,所以先卸载mariaDB。
查看是否安装了mariaDB:
rpm -qa |grep mariadb
卸载已安装的mariadb:
rpm -e --nodeps mariadb-5.5.68-1.el7.x86_64
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
查看是否已经成功卸载:
rpm -qa |grep mariadb
下载mysql:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql:
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql-server:
yum install mysql-server
再次启动mysql,service mysqld start,已经成功。
1.1.4 配置mysql root账号密码,然后登录进去。
[root@localhost /]# mysqladmin -u root password 123123 [root@localhost /]# mysql -uroot -p123123 Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.6.51 MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
1.1.5 关闭防火墙和seLinux
[root@localhost /]# iptables -F [root@localhost /]# setenforce 0
1.1.6 访问测试
浏览器输入虚拟机地址,可以看到测试页面。
1.1.7 搭建一个网站
网站目录在/var/www/html/,可以把自己的网站源码拷贝到此目录。
1.2 Centos建站
2 Windows建站
2.1 Windows Server2008配置
2.2 phpstudy建站
标签:1.1,网站,过程,x86,rpm,mysql,root,localhost,搭建 From: https://www.cnblogs.com/snow2021/p/16941940.html