Configure the network Yum source and third-party yum source and compile and install Apache

Source: Internet
Author: User
Tags yum repolist

Configure the network Yum source and third-party yum source and compile and install Apache


System hardware and software Environment platform:

VMware Workstation Pro 12.5.5 build-5234757

CentOS Linux Release 7.3.1611

Kernel version: 3.10.0-514.el7.x86_64

Test Date: June 13, 2017



Lab 1: Realizing the network Yum source

1. Prepare the relevant system CD and build the Network service FTP or HTTP

[Execute command] #ls  /mnt[execute command] #mount  | grep  "/dev/sr0" [Execute command] #mount  /dev/sr0 /mntmount:  /dev/sr0 is write-protected, mounting read-only[Execute command] #cd  /mnt/packages/[execute command]# Rpm -ivh vsftpd-3.0.2-21.el7.x86_64.rpmwarning: vsftpd-3.0.2-21.el7.x86_64.rpm: header  v3 rsa/sha256 signature, key id f4a80eb5: nokeypreparing... ######### ######################## [100%]updating / installing ... 1:vsftpd-3.0.2-21.el7 ################################# [100%][Execute command] #netstat  -ntlActive  internet connections  (only servers) proto recv-q send-q local address  Foreign address statetcp 0 0 0.0.0.0:111 0.0.0.0:* listentcp 0 0  192.168.122.1:53 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:22 0.0.0.0:*  Listentcp 0 0 127.0.0.1:631 0.0.0.0:* listentcp 0 0 127.0.0.1:25 0.0.0.0:* listentcp6 0 0 :::111 :::*   listentcp6 0 0 :::22 :::*  listentcp6 0 0 ::1:631 :::*   listentcp6 0 0 ::1:25 :::*  listen[Execute command] #systemctl  start vsftpd  / /Start Service

#########################

Settings for the VSFTPD service

CENTOS6 Version Path/etc/rc.d/init.d/vsftpd

/ETC/RC.D/INIT.D/VSFTPD Start//Startup service

Service vsftpd start//Ibid

Chkconfig vsftpd on//Set boot auto start service


Centos7 Version Path/usr/lib/systemd/system/vsftpd.service

Systemctl start VSFTPD//Start service

Systemctl Enable VSFTPD//Set boot auto-start service


iptables firewall settings

Centos6

Service iptables stop//disable

Chkconfig iptables off//Next boot disabled


Centos7

Systemctl Stop Firewalld.service//disable

Systemctl Disable Firewalld.service//Next boot disable

############################

[Execute command] #netstat  -ntlActive Internet connections  (only servers) proto recv-q  send-q local address foreign address statetcp 0 0 0.0.0.0:111  0.0.0.0:* listentcp 0 0 192.168.122.1:53 0.0.0.0:* listentcp 0 0  0.0.0.0:22 0.0.0.0:* listentcp 0 0 127.0.0.1:631 0.0.0.0:* listentcp 0  0 127.0.0.1:25 0.0.0.0:* listentcp6 0 0 :::111 :::*  LISTENTCP6  0 0 :::21 :::*  listen  //Displays the port number of the FTP, indicating that the service started successfully tcp6 0 0 :::22  :::*  listentcp6 0 0 ::1:631 :::*  listentcp6 0 0 ::1:25  :::*  listen[execution Command] #iptables  -vnLChain INPUT  (policy accept 2092  Packets, 171k bytes) Pkts bytes target prot opt in out source  destination0 0 accEpt udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:530 0 accept  tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:530 0 accept  udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:670 0 accept  tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:67chain forward   (policy accept 0 packets, 0 bytes) pkts bytes target prot  Opt in out source destination0 0 accept all -- * virbr0  0.0.0.0/0 192.168.122.0/24 ctstate RELATED,ESTABLISHED0 0 ACCEPT all  -- virbr0 * 192.168.122.0/24 0.0.0.0/00 0 accept all -- virbr0  virbr0 0.0.0.0/0 0.0.0.0/00 0 REJECT all -- * virbr0  0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable0 0 reject all -- virbr0 * 0.0.0.0/0  0.0.0.0/0 reject-with icmp-port-unreachablechain output  (policy ACCEPT 1714  packets, 189k bytes) pkts bytes target prot opt in out  source destination0 0 accept udp -- * virbr0 0.0.0.0/0 0.0.0.0/0  udp dpt:68[Execute command] #iptables  -f  //recommend emptying the firewall to avoid affecting the experimental results [execute command] #iptables  -vnLChain  input  (policy accept 5 packets, 356 bytes) Pkts bytes target prot  opt in out source destinationChain FORWARD  (policy accept 0  packets, 0 bytes) Pkts bytes target prot opt in out source  destinationChain OUTPUT  (policy accept 4 packets, 384 bytes) pkts  bytes target prot opt in out source destination[Execute command] #getenforceEnforcing [execute command] #setenforce  0    //recommends that SELinux be closed to avoid effects on experimental effects [execute command] #getenforcePermissive [execute command] #systemctl  stop firewalld.service   //If FTP is still inaccessible, you can directly close the Firewall service [execute command] #systemctl  disable firewalld.service [execute the command]# Systemctl status firewalld.service  firewalld.service - firewalld - dynamic  firewall daemonLoaded: loaded  (/usr/lib/systemd/system/firewalld.service; disabled;  vendor preset: enabled) active: inactive  (Dead) docs: man:firewalld (1)

2. Copy the metadata Repodata and RPM package files to the directory of the Network service, the client can access the normal remote

Cd/var/ftp/pub/lsmkdir 6 7cd 7cp-r/mnt/repodata. LS repodata/mkdir packagescp-r/mnt/packages/tree-1.6.0-10.el7.x86_6 4.rpm Packages/ls PACKAGES/LSCD. /6mkdir packagesumount/dev/sr0ls/mnt/mount/dev/sr0/mntlsdf-hmount/dev/sr0/mntcp-r/mnt/repodata. lscp/mnt/package s/tree-1.5.3-3.el6.x86_64.rpm PACKAGES/LSCD

The list of directories and files is shown below, where the CENTOS6 and 7 yum sources are built, and in order to test only one RPM package is copied, all packages under the CD packages need to be copied if the complete environment is to be built

[Execute command] #ls  /var/ftp/pub6/ 7/ test.txt[execute command] #ll  /var/ftp/pub/6/Packages/total  40drwxr-xr-x. 2 root root 41 jun 12 20:10 ./drwxr-xr-x. 4  ROOT ROOT 38 JUN 12 20:09&NBSP, .... /-r--r--r--.  1 root root 36884 jun 12 20:10 tree-1.5.3-3.el6.x86_64. rpm[Execute command] #ll  /var/ftp/pub/7/packages/total 48drwxr-xr-x. 2 root root 42 jun  12 20:07 ./DRWXR-XR-X. 4 ROOT ROOT 38 JUN 12 20:06&NBSP, .... /-rw-r--r--.  1 root root 47508 jun 12 20:07 tree-1.6.0-10.el7.x86_64. rpm[Execute command] #ll  /var/ftp/pub/6/repodata/total 27064dr-xr-xr-x. 2 root root 4096  jun 12 20:09 ./drwxr-xr-x. 4 root root 38 jun 12 20:09 &NBSP, .... /-r--r--r--.  1 root root 6621696 jun 12&nbsP;20:09 4344a2a6bf5b36982d263c6bdd097cb92e57910dee985a1ab445609788600c0d-filelists.sqlite.bz2-r--r--r--.  1 root root 4880323 Jun 12 20:09  4bdfb96905d87533542b3d8b5f9b60c3909ceffa99eb7a3f873adbdee907bf1c-primary.sqlite.bz2-r--r--r--.  1  root root 2893552 jun 12 20:09  59379012d189411213fb362e26b449fe6bd49949bf184e77285ec36154f65074-other.sqlite.bz2-r--r--r--.  1 root  root 3145272 Jun 12 20:09  71569ab4b90fb6a4855e9a2f63f17f284f6d6a224773450e135f92816308b447-other.xml.gz-r--r--r--.  1 root  root 231283 Jun 12 20:09  Aa8289f99bf8aedf9426be9da6339eed4db430a72d9740b4a502cb1ec150aff8-c6-x86_64-comps.xml.gz-r--r--r--.  1  root root 1260372 Jun 12 20:09  D0df041d26b67f7e9b5c5828e5126ddbfeb3a998ec8e8426de2d260d8e 15f6-c6-x86_64-comps.xml▽r--r--r--.  1  root root 2776232 jun 12 20:09  D3b2352ce1e09ca85dc0897d47c381be1beacd93f33b88a584a3c7ae8b725a5e-primary.xml.gz-r--r--r--.  1 root  root 5879460 Jun 12 20:09  F9a33e31c3fb73eab7900fa086b25220d412c0618bf4596c22b325bf9a4832fe-filelists.xml.gz-r--r--r--.  1 root  root 4063 jun 12 20:09 repomd.xml-r--r--r--.  1 root root  2575 jun 12 20:09 trans. tbl[Execute command] #ll  /var/ftp/pub/7/repodata/total 13708drwxr-xr-x. 2 root root 4096  jun 12 20:06 ./drwxr-xr-x. 4 root root 38 jun 12 20:06 &NBSP, .... /-rw-r--r--.  1 root root 1495137 Jun 12 20:06  5635df73647e7bb1ac9a289c27f3a84db1db2e33d3644bf506b85562c2a3d392-primary.xml.gz-rw-r--r--.  1 root  root 3103702 Jun 12 20:06  6ec2bb89ebc4b716fe62ea930164b179f2cd90e1bdf1a504cdd7832153392b1e-filelists.sqlIte.bz2-rw-r--r--.  1 root root 3069068 Jun 12 20:06  889dab2d016c523397f24315cacb947484b06607924cc7e4716017842515df52-filelists.xml.gz-rw-r--r--.  1 root  root 971157 Jun 12 20:06  8d04a279fb66b24cab67e8ebc33ef0ddb4fd7d37f9d9608585598a1b80138f53-other.xml.gz-rw-r--r--.  1 root  root 3122198 Jun 12 20:06  B1b2cb9f67759ef5d143a211c2399d800fa58cf3ab12c205188e3c13d1b3d41d-primary.sqlite.bz2-rw-r--r--.  1  root root 159099 jun 12 20:06  C55e5b7bbe933fa8dac2cffca4596c265812b74ed12ef3968d487dd6eb22ad93-c7-x86_64-comps.xml.gz-rw-r--r--.  1  root root 748686 Jun 12 20:06  D918936f5019be3fb66e9981a28cb2a41477a2963d741d454f79377a22214f43-c7-x86_64-comps.xml-rw-r--r--.  1  root root 1339096 jun 12 20:06  E4e51f819c9dfc35ad68a2745f1e39020d003741cbb1346d93f776d13e44351c-other.sqlIte.bz2-rw-r--r--.  1 root root 3732 jun 12 20:06 repomd.xml-r--r--r--.  1 root root 2575 jun 12 20:06 trans. TBL

3. Configure the client Yum source to test the installation software

Yum Client configuration file:

[Ftpbase]//Cannot duplicate name

NAME=CENTOS7//Description information

Baseurl=url//http,ftp,file file path

ENABLED={1|0}//1 enabled, 0 disabled

GPGCHECK={1|0}//whether to turn on authentication

[Execute command] #mkdir  /etc/yum.repos.d/back  //first need to back up the original *.repo file [Execute command] #cd  /etc/yum.repos.d/back[ Execute command] #mv  c* back/[execute command] #vi  /etc/yum.repos.d/ftp.repo[ftpbase]name=ftp yum  serverbaseurl=ftp://192.168.x.x/pub/$releasevergpgcheck =0[Execute command] #yum  repolist  // Query if Yum source is set successfully loaded plugins: fastestmirror, langpacksftpbase | 3.6 kb  00:00:00:  ftpbase/7/group_gz | 155 kb 00:00:00 (2/2):  ftpbase/7/primary_db  | 3.0 mb 00:00:00loading mirror speeds from cached hostfilerepo  id repo name statusftpbase/7 ftp yum server 3,831repolist: 3,831 [Execute command] #rpm  -qa treetree-1.6.0-10.el7.x86_64[execute command] #rpm  -e tree[execute command] #treebash:  tree:  command not found ... [Execute command] #yum  install tree  //install software via yum source loaded plugins: fastestmirror,  langpacksbase |&Nbsp;3.6 kb 00:00:00loading mirror speeds from cached hostfileresolving  dependencies--> running transaction check---> Package tree.x86_64  0:1.6.0-10.el7 will be installed--> finished dependency  resolutiondependencies resolved========================================================================== =============================package arch version repository size========================= ==============================================================================installing:tree x86_64  1.6.0-10.el7 base 46 ktransaction summary=========================================== ============================================================install 1 packagetotal download  size: 46 kInstalled size: 87 kIs this ok [y/d/N]:  ydownloading packages:tree-1.6.0-10.el7.x86_64.rpm | 46 kB 00:00:00Running transaction checkRunning transaction  Testtransaction test succeededrunning transactionwarning: rpmdb altered outside  of yum. installing : tree-1.6.0-10.el7.x86_64 1/1verifying : tree-1.6.0-10.el7.x86_64 1/ 1installed:tree.x86_64 0:1.6.0-10.el7complete! [Execute command] #yum  list | grep tree  //to see if the software was successfully installed tree.x86_64 1.6.0-10.el7 @ basetexlive-pst-tree.noarch 2:svn24142.1.12-38.el7 base[Execute command] #cd [execute command] #yum  remove tree   //Uninstall Software loaded plugins: fastestmirror, langpacksresolving dependencies-->  running transaction check---> package tree.x86_64 0:1.6.0-10.el7 will  be erased--> finished dependency resolutiondependencies resolved============ ===========================================================================================package arch version repository size==================================== ===================================================================removing:tree x86_64 1.6.0-10.el7   @base  87 ktransaction summary============================================================ ===========================================remove 1 packageinstalled size: 87 kis  this ok [y/n]: ydownloading packages:running transaction checkrunning  transaction testTransaction test succeededRunning transactionErasing :  Tree-1.6.0-10.el7.x86_64 1/1verifying : tree-1.6.0-10.el7.x86_64 1/1removed:tree.x86_64  0:1.6.0-10.el7complete! [Execute command] #tree-bash: /usr/bin/tree: no such file or directory

Lab 2: Implementing a third-party yum Source

1. Build network services, the client can be normal remote access, experiment 1 has been implemented, here omitted

2. Copy the third-party software into the directory of the Web service and create the meta-data

Umount/mntdf-hmount/dev/sr0/mntls/mnt/cd/var/ftp/pub/mkdir appcp/mnt/packages/tree-1.6.0-10.el7.x86_64.rpm appcdcreaterepo/var/ftp/pub/app///Create meta-data repodatacd/var/ftp/pub/app/ls repodata/cd with creatrepo command

3. Configure the client Yum source to test the installation software

[Execute command] #vi/etc/yum.repos.d/ftp.repo[app]name=app yum serverbaseurl=ftp://192.168.10.14/pub/appgpgcheck=0[execute command]# Yum repolist[Execute command] #yum install tree.x86_64//test installation software


Lab 3: Source code compile and install Apache

1. Download the Apache source package and unzip it

TAR-XVF HTTPD-2.4.25.TAR.BZ2LSCD Httpd-2.4.25/ls

2. Install the Developer Kit Group development tools

[Execute command] #vi/etc/yum.repos.d/ftp.repo//change Yum source to disc [Cdrom]name=cdrom yumbaseurl=file:///mntgpgcheck=0[execute command] #yum Repolistyum Groups install development\ Tools Installation devel package Group

3. Review the Readme and install Help files to determine the parameter settings for the compiled installation

More README

More INSTALL


4.configure, that is, configure the installation path and parameters, if an error occurs, install the corresponding package, usually prompted by the file name plus-devel is required to install the package name, such as

RPM-QA filename

Yum Search filename

Yum Install Filename-devel

./configure --prefix=/app/apache24//hint dependency, missing APR packet rpm -qa apr  //query Apr from which rpm package file Yum  search apr  //Query the Yum source for this package file, shown below loaded plugins: fastestmirror,  langpacksloading mirror speeds from cached hostfile================================== ======== n/s matched: apr ===========================================apr-devel.x86_64  : apr library development kitapr-util-devel.x86_64 : apr utility  library development kitapr.x86_64 : Apache Portable Runtime  Libraryapr-util.x86_64 : apache portable runtime utility libraryhaproxy.x86_64  : TCP/HTTP proxy and load balancer for high availability  environmentsname and summary matches only, use  "Search all"  for  Everything.yum install apr-devel   //Install package file, package named apr-devel./configure --prefix=/app/apache24  //continue the configuration process//Hint missing Apr-util package, Repeat these steps to resolve all dependency issues in turn rpm -qa apr-utilyum search apr-utilyum install apr-util-devel./ configure --prefix=/app/apache24rpm -qa pcre-configrpm -qa pcreyum search  pcreyum install pcre-devel./configure --prefix=/app/apache24  //Configuration Succeeded

5.make && make install, compile installation

CDCD httpd-2.4.25/lsmake && make install//compile installation httpd

6. Start the service and test that the software is installed successfully

Cd/app/apache24/iptables-vnl/app/apache24/bin/apachectl startnetstat-ntlcd/app/apache24/htdocs///This is the directory that holds the website ls


The test page shows "it works! ”


You can add httpd startup files to the path directory so that you can run directly without specifying an absolute path.

echo "path= $PATH: $dirname/bin" >/etc/profile.d/apache2.sh;cd/etc/profile.d/;. Apache2.sh;cd

Next time, you can run the command directly

Apachectl Start | Stop | Restart | Status


This article is from the "Rackie" blog, make sure to keep this source http://rackie386.blog.51cto.com/11279229/1934923

Configure the network Yum source and third-party yum source and compile and install Apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.