1. 程式人生 > >yum實驗--使用源碼包安裝httpd2.2(centos6)

yum實驗--使用源碼包安裝httpd2.2(centos6)

source nbsp ons debug notes chrome obb .sh win

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

技術分享圖片

yum實驗--使用源碼包安裝httpd2.2(centos6)