专业提供高端网站建设,高端网站设计,企业网站制作,为广大公司客户建立高端品牌网站。
Copyright©2022 高端网站设计 All Rights Reserved. 苏ICP备19066048号
发布时间:2023-02-12 16:07:10 人气:47
个人网站https://www.ntbuhui.cn/
## 概念**名词**HTML:超级文本标记语言网页:使用HTML,PHP,JAVA语言格式书写的文件主页:网页中呈现用户的第一个界面网站:多个网页组合而成的一台网站服务器URL:统一资源定位符,访问网站的地址
**网站架构**LAMPLinux+Apache+MysQL+PHP系统+服务器程序+数据管理软件+中间软件##网站建设 静态站点**Apache基础**官网:Welcome to The Apache Software Foundation!
软件包名称:httpd服务端口: 80/tcp(http) 443/tcp(https)主配置文件:/etc/httpd/conf/httpd/conf子配置文件:/etc/httpd/conf.d/*.conf
主目录:/var/www/html**安装apache**yum -y install httpd (安装)systemctl start httpd (启动)systemctl status httpd (查看服务状态)
systemctl enable httpd (开机自启)systemctl stop firewalld (关闭防火墙)setenforce 0 (关闭selinux)
httpd -v (查看版本)**虚拟主机**作用:在一台物理服务器上运行多个网站**站点a设置:**准备网站源码(网页目录)mkdir /var/www/html/
http://a.orgvim /var/www/html/http://a.org/index.thml (输入网页内容)创建http://a.org的网站配置文件:vim /etc/httpd/conf,d/a.org.c网站建设onf
(某个虚拟主机)serverName www.a.org (服务器名)DocumentRoot /var/www/html/
http://a.org (网站的根目录)检查位置文件语法,重启服务httpd -tsystemctl restart httpd**站点b设置**准备网站源码目录mkdir /
http://b.orgvim /http://b.org/index.thml (输入网页内容)创建http://b.org的网站配置文件vim /etc/httpd/conf.d/b.org.conf
在文件中输入ServerName www.b.orgD网站建设ocumentRoot /http://b.org (目录授权,仅在网站主目录非“/var/www/html”时操作)
require all granted (允许所有的“网站”的访问)检测配置文件语法,重启服务httpd -t无报错就可以启动服务器了systemctl restart httpd
**客户端**linux客户端域名解析vim /etc/hosts192.168.1.1 www.a.org (填写web服务器的IP)192.168.1.1 www.b.org (填写web服务器的IP)
字符测试yum -y install elinkselinks http://www.b.org网站建设Windows客户端域名解析在C盘找到windows < system32 < drivers < etc < hosts
在最下面写192.168.1.1 www.a.org (填写web服务器的IP)192.168.1.1 www.b.org (填写web服务器的IP)windows客户端测试网站可用性
打开真机的运行窗口,输入cmdping www.a.org或直接使用浏览器分别打开两个地址测试www.a.orgwww.b.org## 动态站点LAMP:linux系统-网站程序apache-数据库mysql-PHP中间件
**部署论坛系统discuz基础环境** sed -ri /^SELIN网站建设UX=/cSELINUX=disabled /etc/selinux/config (永久关闭selinux)setenforce 0 (临时关闭selinux)
systemctl stop firewalld.service (停止防火墙)systemctl disable firewalld.service (开机禁用防火墙)
**安装LAMP** 安装网站-数据库服务器-数据库客户端-中间件-中间件插件-图形库-php图形库yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd
启动网站和数据库 systemct网站建设l start httpd mariadb开机启动网站和数据库systemctl enable httpd mariadb**安装Discuz**导入discuz网站源码
wget http://download.comsenz.com/DiscuzX/2.5/Discuz_X2.5_SC_UTF8.zipmkdir -p /webroot/discuz (创建网站目录)
yum install -y unzip (下载解压工具unzip)unzip Discuz_X2.5_SC_UTF8.zip (解压)
cp -rf upload/* /webroot/discuz/ (将解压好的文件移动至网站网站建设目录)chown -R apache.apache /webroot/discuz/ (更改网站目录权限属主属组为apache)
**配置虚拟机主机**vim /etc/httpd/conf.d/discuz.conf (开始配置虚拟主机) ServerName Discuz! Q - 再小众,也有圈子 - 开源的PHP内容付费轻社区
DocumentRoot /webroot/discuz Require all granted
systemctl restart httpd (重启程序)**准备数据库**mysqlMariaDB[(nane)]> create database discuz (网站建设创建数据库)**客户端测试时,添加域名解析**
vim /etc/hosts192.168.122.161 Discuz! Q - 再小众,也有圈子 - 开源的PHP内容付费轻社区
如果我的技能经验比较符合你们的需求,可以通过微信bh_0706联系我,专业有保障