Apache服务器的安装及其应用
1. 搭建DNS服务器
2. 开始FTP服务
————————————————————————————————————————————————
应用
1. 创建用户,并设密码
cd /media/cdrom/RedHat/RPMS
rpm -ivh bind-9.2.4-2
mount /media/cdrom
cd /media/cdrom/RedHat/RPMS
rpm -ivh caching-nameserver-7.3.3.noarch.rpm
(2)开启区域
vi /etc/named.conf
zone "hongwei.com"{
type master;
file "hongwei.com";
};
cd /var/named
cp named.local hongwei.com
vi hongwei.com
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS localhost.
www IN A 172.16.2.99
vi /etc/resolv.conf
Address: 172.16.2.99
——————————————————————————————————————————————
2. 开启FTP 服务
——————————————————————————————————————————————
3.进行编译安装
[root@rhel4 aa]# ls
httpd-2.0.59.tar.gz
tar zxvf httpd-2.0.59.tar.gz
(3)编译前的配置
http:/www.hongwei.com
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
应用
1. 创建用户,并设密码
# passwd lei
# Changing password for user lei.
New UNIX password: 设置密码
Retype new UNIX password: 确认密码
passwd: all authentication tokens updated successfully.
——————————————————————————————————————————————————--
2. 设置用户的个人主页目录
[root@rhel4 ~]# cd /home/lei
[root@rhel4 lei]# mkdir public_html
———————————————————————————————————————————————————
3. 在主页目录中创建名为index.html的文件
[root@rhel4 public_html]# vi index.html
———————————————————————————————————————————————————
4.设置权限
chmod o+x /home/lei
service httpd stop
Stopping httpd: [ OK ]
———————————————————————————————————————————————————
5.重启服务
/usr/local/apache2/bin/apachectl start
4. 配置域名虚拟主机
#</VirtualHost
NameVirtualHost 172.16.2.99
<VirtualHost 172.16.2.99>
ServerName www.hongwei.com
DocumentRoot /home/lei/public_html
</VirtualHost>
————————————————————————————————————————————————-——
5.重启服务
/usr/local/apache2/bin/apachectl restart
———————————————————————————————————————————————————
6.测试
http://www.hongwei.com/