先把镜像文件链接到虚拟机
tar -zcvf rpeo.tar.gz ./* 把当前的所有yum 做一个备份
rm -fr Cent* 把不用的yum库删除
vi local.rpeo 新建本地yum 库并配置本地云库至光盘挂载点
yum install -y httpd* 安装apache(网站) 服务
(yum remove -y httpd*reboo)
vi /etc/httpd/conf/httpd.conf 进入网站服务器配置文件
shift+g 到最后一页 并做如下修改
NameVirtualHost 192.168.35.133:80 你的IP
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost 192.168.35.133:80> 你的ip
ServerAdmin www@test.com 你的域名
DocumentRoot /var/www/html 网页存放位置
ServerName www.test.com 主机名
ErrorLog logs/dummy-host.example.com-error_log 日志文件位置
service httpd start ##重启网站服务器
service iptables stop ##关闭防火墙
service httpd restart ##重启网站服务器
关闭系统自带的selinux vi /etc/selinux/config 中的 SELINUX=disabled
重启
service iptables stop 直接关防火墙。
chkconfig httpd on 是设置开机自动启动网站
mkdir /mnt/cdrom 创建一个挂载点
mount /dev/cdrom /mnt/cdrom 将光盘文件挂载到挂载点
tar -zcvf rpeo.tar.gz ./* 把当前的所有yum 做一个备份
rm -fr Cent* 把不用的yum库删除
vi local.rpeo 新建本地yum 库并配置本地云库至光盘挂载点
yum install -y httpd* 安装apache(网站) 服务
(yum remove -y httpd*reboo)
vi /etc/httpd/conf/httpd.conf 进入网站服务器配置文件
shift+g 到最后一页 并做如下修改
NameVirtualHost 192.168.35.133:80 你的IP
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost 192.168.35.133:80> 你的ip
ServerAdmin www@test.com 你的域名
DocumentRoot /var/www/html 网页存放位置
ServerName www.test.com 主机名
ErrorLog logs/dummy-host.example.com-error_log 日志文件位置
保存退出
现在上传网页
。。。 。。。
service httpd start ##重启网站服务器
service iptables stop ##关闭防火墙
service httpd restart ##重启网站服务器
关闭系统自带的selinux vi /etc/selinux/config 中的 SELINUX=disabled
重启
service iptables stop 直接关防火墙。
然后
iptables -F 清空防火墙规则
iptables -A INPUT -p tcp --dport 80 -j ACCEPT ##是添加一条规则允许web 端口放行
chkconfig httpd on 是设置开机自动启动网站