yum实验--使用源码包安装httpd2.2(centos6)

1.下载源码 官网,教室的服务器

lftp 172.18.0.1
         user thirty-three pass:thirty-three
         get files/httpd-2.4.27.tar.bz2
         exit
         tar xvf httpd-2.4.27.tar.bz2

[root@centos6 ~]#lftp 172.18.0.1
lftp 172.18.0.1:~> user thirty-three
Password: 
lftp thirty[email protected]:~> ls
drwxrwxr-x    2 506      506          4096 Jul 31 06:56 files
drwxrwxr-x    2 0        0            4096 Jul 24 08:18 lab manuals
drwxrwxr-x    2 0        0            4096 Jul 09 10:03 notes
drwxrwxr-x    2 0        0            4096 Jul 06 09:54 pictures
drwxrwxr-x    2 0        0            4096 Aug 03 00:38 slides
drwxrwxr-x   18 0        0            4096 Aug 03 10:13 video
lftp thirty[email protected]:/> cd files
lftp thirty[email protected]:/files> ls
-rw-r--r--    1 506      506      49183336 Jul 11 11:13 67.0.3396.99_chrome_installer.exe
-rw-r--r--    1 506      506        658940 Oct 08  2024 access_log
-rw-r--r--    1 506      506       5779739 Jul 30 07:36 httpd-2.2.34.tar.bz2
-rw-r--r--    1 506      506       6527394 Jul 30 07:36 httpd-2.4.27.tar.bz2
-rw-r--r--    1 506      506      102201640 Jul 31 06:56 linux-4.15.13.tar.xz
-rw-r--r--    1 506      506           782 Jul 25 07:28 motd
-rw-r--r--    1 506      506         72928 Jul 11 11:12 skyZIP™_Proxy.crx
lftp thirty[email protected]:/files> get httpd-2.2.34.tar.bz2 
get: httpd-2.2.34.tar.bz2: file already exists and xfer:clobber is unset
lftp thirty[email protected]:/files> exit

[root@centos6 ~]#tar xvf httpd-2.2.34.tar.bz2

[root@centos6 ~]#ls
access_log                      Desktop        httpd-2.2.34          reset.sh
acl.bak                         Documents      httpd-2.2.34.tar.bz2  Templates
acl.txt                         Downloads      install.log           test.sh
anaconda-ks.cfg                 etc2018-07-24  install.log.syslog    Videos
bin                             etcdate +%F    Music
CentOS-6.8-x86_64-bin-DVD1.iso  fhj            Pictures
CentOS-6.8-x86_64-bin-DVD2.iso  f.txt          Public

2.安装Development Tools

查看yum的组列表

[root@centos6 ~]#yum grouplist 
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Group Process
Repository base is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
base                                                                 | 4.0 kB     00:00     
epel                                                                 | 4.3 kB     00:00     
Installed Groups:
    Additional Development
    Base
    CIFS file server
    Compatibility libraries
    Console internet tools
    Debugging Tools
    Desktop
    Desktop Debugging and Performance Tools
    Desktop Platform
    Development tools

[root@centos6 ~]#yum groupinstall 'Development Tools'

3.查看README INSTALL

[root@centos6 ~]#cd httpd-2.2.34
[root@centos6 httpd-2.2.34]#ls
ABOUT_APACHE  CHANGES        httpd.dsp       libhttpd.dep  NOTICE            server
acinclude.m4  config.layout  httpd.mak       libhttpd.dsp  NWGNUmakefile     srclib
Apache.dsw    configure      httpd.spec      libhttpd.mak  os                support
build         configure.in   include         LICENSE       README            test
BuildAll.dsp  docs           INSTALL         Makefile.in   README.platforms  VERSIONING
BuildBin.dsp  emacs-style    InstallBin.dsp  Makefile.win  README-win32.txt
buildconf     httpd.dep      LAYOUT          modules       ROADMAP

4../configure –help    

./configure --prefix=/app/apache22 --sysconfdir=/etc/apache22
     dnf|yum install -y apr-devel apr-util-devel pcre-devel

5.make -j 4 (看情况改,可要可不要)
6.make install
7.export PATH=$PATH:/app/apache22/bin 可把这行写入/etc/profile.d/*.sh 之后,再source该文件

vim /etc/profile.d/f.sh

export PATH=$PATH:/app/apache22/bin

[root@centos6 profile.d]#chmod +x f.sh 
[root@centos6 profile.d]#./f.sh

8.apachectl start 启动服务

9.vim /var/www/html/h.html(网页引导界面) 

[root@centos6 httpd-2.2.34]#vim /var/www/html/h.html
[root@centos6 profile.d]#cat /var/www/html/h.html
<html><body><h1>It works! welcome</h1></body></html>

10.iptables –F(关闭防火墙)

[root@centos6 profile.d]#iptables -F

11.浏览器访问

172.18.250.57/h.html

猜你喜欢

转载自www.cnblogs.com/f-h-j-11-7/p/9426713.html