安装Apache源码包[httpd-2.2.25.tar.gz]根据源码包安装四步骤,先安装gcc工具
挂载光盘安装gcc
1.挂载光盘配置yum库
[root@localhost ~]# cd /misc/cd/Server/
You have new mail in /var/spool/mail/root
[root@localhost Server]# cd /etc/yum.repos.d/
You have new mail in /var/spool/mail/root
[root@localhost yum.repos.d]# ls
rhel-debuginfo.repo
[root@localhost yum.repos.d]# cp rhel-debuginfo.repo rhel-server.repo
[root@localhost yum.repos.d]# ls
rhel-debuginfo.repo rhel-server.repo
[root@localhost yum.repos.d]# vim rhel-server.repo
[rhel-server]
name=Red Hat Enterprise Linux S
baseurl=file:///misc/cd/Server/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning up Everything
[root@localhost yum.repos.d]# yum list | wc -l //yum库安装完毕
3347
[root@localhost ~]# ls Desktop///VMware-tools工具拖拽到桌面或挂载到指定的路径
httpd-2.2.25.tar.gz
[root@localhost ~]# tar -zxf Desktop/httpd-2.2.25.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ls
awstats etc httpd-2.2.25 lib libexec share
bin games include lib64 sbin src
[root@localhost local]# cd httpd-2.2.25/
You have new mail in /var/spool/mail/root
2.源码包安装
[root@localhost etc]# vim named.rfc1912.zones
//一般搭建DNS服务器只需配置正向解析:
zone "tarena.com" IN {
type master;
file "tarena.com.zone";
masters { 192.168.10.1; };
};
[root@localhost etc]# named-checkconf named.conf named.rfc1912.zones
[root@localhost etc]# cd ../var/named/
data named.broadcast named.local
localdomain.zone named.ca named.zero
localhost.zone named.ip6.local slaves
[root@localhost named]# cp -p named.local tarena.com.zone
[root@localhost named]# vim tarena.com.zone
$TTL 86400
@ IN SOA tarena.com. root.tarena.com. (
2014030701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns1.tarena.com.
dns1 IN A 192.168.10.1
www IN A 192.168.10.1
bbs IN A 192.168.10.1
~
~
[root@localhost named]# named-checkzone tarena.com tarena.com.zone
zone tarena.com/IN: loaded serial 2014030701
OK
[root@localhost named]# service named restart
停止 named: [确定]
启动 named: [确定]
[root@localhost extra]# cd ../
[root@localhost conf]# ls
extra httpd.conf magic mime.types original
[root@localhost conf]# pwd
/usr/local/apache2/conf
[root@localhost conf]# vim httpd.conf //http主配置文件
.
.
114 #
115
116 Options FollowSymLinks
117 AllowOverride None
118 Order deny,allow
119 Allow from all
120
121
.
.
163 # DirectoryIndex: sets the file that Apache will serve if a directory
164 # is requested.
165 #
166
167 DirectoryIndex index.html
168
395 # Virtual hosts
396 Include conf/extra/httpd-vhosts.conf//删除前面#
[root@localhost conf]#/usr/local/apache2/bin/apachectl stop
[root@localhost conf]#/usr/local/apache2/bin/apachectl start
cp /usr/local/apache2/bin/apachect1 /etc/init.d/
cd /etc/init.d/
mv apachect1 apache
head -n 5 apache