做wordpress 下载站,重庆知名网站建设公司,竞价托管的注意事项,近期舆情热点话题目录
关闭或放行防火墙和selinux
1 搭建静态网站
2 建立两个基于ip地址访问的网站
思路#xff1a;
简单配置
编写httpd额外文件
3 建立两个基于不同端口访问的网站
思路
创建文件#xff08;与之前一致#xff09;
额外文件配置
4 基于虚拟目录和用户控制的web网…目录
关闭或放行防火墙和selinux
1 搭建静态网站
2 建立两个基于ip地址访问的网站
思路
简单配置
编写httpd额外文件
3 建立两个基于不同端口访问的网站
思路
创建文件与之前一致
额外文件配置
4 基于虚拟目录和用户控制的web网站
思路
设置用户密码
创建目录及页面
编写配置文件
额外配置文件必须制定目录及虚拟主机 关闭或放行防火墙和selinux
1 搭建静态网站
[rootlocalhost ~]# echo this is static /var/www/html/index.html
2 建立两个基于ip地址访问的网站 要求访问 ip 地址为 100 时访问的是 100 网页 访问 ip 地址为 200 时访问 200 网页 思路 创建 2 个 ip 创建 2 个 ip 对应的目录 使用 httpd 的额外文件来编写配置文件 创建虚拟主机 简单配置 nmcli connection modify ens33 ipv4.addresses 192.168.27.100/24
nmcli connection modify ens33 ipv4.addresses 192.168.27.200/24
nmcli connection up ens33
mkdir -pv /WWW/ip/100
mkdir -pv /WWW/ip/200
echo this is 100 /WWW/ip/100/index.html
echo this is 200 /WWW/ip/200/index.html
配置httpd虚拟主机
虚拟主机样例文件是/usr/share/doc/httpd-2.4.6/httpd-vhosts.con
[rootlocalhost ~]# find / -name *vhosts.conf
/usr/share/doc/httpd-2.4.6/httpd-vhosts.conf 编写httpd额外文件 [rootlocalhost ~]# more /etc/httpd/conf.d/vhosts.conf
VirtualHost 192.168.27.100:80
DocumentRoot /WWW/ip/100
ServerName 192.168.27.100
/VirtualHost
VirtualHost 192.168.27.200:80
DocumentRoot /WWW/ip/200
ServerName 192.168.27.200
/VirtualHost
给目录给予访问权限
Directory /WWW/ip
AllowOverride None
Require all granted
/Directory 3 建立两个基于不同端口访问的网站 思路 ip 已经创建 创建两个不同端口的目录 修改之前的额外文件 创建文件与之前一致 额外文件配置 listen 81
listen 82
VirtualHost 192.168.27.100:81
DocumentRoot /WWW/port/81
ServerName 192.168.27.100
/VirtualHost
VirtualHost 192.168.27.100:82
DocumentRoot /WWW/port/82
ServerName 192.168.27.100
/VirtualHost
Directory /WWW/port
AllowOverride None
Require all granted
/Directory 4 基于虚拟目录和用户控制的web网站 思路 设置用户和密码 创建页面文件目录 编写配置文件 设置用户密码 htpasswd -c /etc/httpd/mymima xiaoming
htpasswd -c /etc/httpd/mymima xiaohong 创建目录及页面 mkdir /usr/local/mysecret
echo this is mysecret /usr/local/mysecret/index.html 编写配置文件 额外配置文件必须制定目录及虚拟主机 [rootlocalhost ~]# more /etc/httpd/conf.d/vhosts2.conf
Directory /usr/local
AuthType Basic
AuthName please login
AuthUserFile /etc/httpd/mymima
Require user xiaohong
/Directory
VirtualHost 192.168.27.100:80
DocumentRoot /usr/local/mysecret
ServerName 192.168.27.100
/VirtualHost