nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Squid - Compile from Source or RPM

This is a discussion on Squid - Compile from Source or RPM within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; What is better? Compiling squid from source or installing RPM? What if I build RPM from source? Actually, I want ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Linux answers from nixCraft.


CentOS / RHEL / Fedora Discussion about Redhat Enterprise Linux or CentOS or Fedora Linux related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2009, 10:57 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default Squid - Compile from Source or RPM

What is better?
Compiling squid from source or installing RPM?
What if I build RPM from source?

Actually, I want to optimize squid performance. The only way I find to do that is install from source.
Is there a way to create RPM after ./configure or the make process?

Last edited by Cyborg_sa; 08-05-2009 at 11:01 PM.
Reply With Quote
  #2 (permalink)  
Old 09-05-2009, 03:08 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

rpm can be built using rpmbuild command. Download squid source rpm and install the same. Next, go to SPECS directory:
Code:
cd /usr/src/redhat/SPECS/
ls
Open squid.spec file and update ./configure options. Save the file. And build rpm as:
Code:
rpmbuild -bb squid.spec
You will find new rpms @ /usr/src/redhat/BUILD/ directory.

NOTE: Source rpm can be downloaded using the following syntax:

Code:
yumdownloader --source squid
rpm -ivh squid*.src.rpm
See http://www.cyberciti.biz/faq/yum-dow...ages-from-rhn/
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help

Last edited by nixcraft; 09-05-2009 at 03:10 AM.
Reply With Quote
  #3 (permalink)  
Old 09-05-2009, 01:01 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default

I tried what u suggested and this is the output:
Code:
[root@cybertron yum.repos.d]# yumdownloader --source squid
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * rpmforge: apt.sw.be
 * base: mirror.internode.on.net
 * updates: ftp.twaren.net
 * centosplus: mirror.internode.on.net
 * addons: mirror.internode.on.net
 * extras: mirror.internode.on.net
ftp://ftp.redhat.com/pub/redhat/linu...ata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Cannot retrieve repository metadata (repomd.xml) for repository: rhel-src. Please verify its path and try again
I also reffered this page:
This is my uname -r output:
Code:
[root@cybertron yum.repos.d]# uname -r
2.6.18-92.el5
and I am using CentOS 5.2

Is there any other src repository? A 3rd patry src repo that I can add to that srpm.repo file?
Reply With Quote
  #4 (permalink)  
Old 09-05-2009, 01:12 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default

OK this is what I did right now:
1. Removed srpm.repo
2. Downloaded CentOS-Source.repo
3. Modified it set priorities:
Code:
[c5-base-src]
name=CentOS-$releasever - Base Source Repository
baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=1
priority=1

[c5-updates-src]
name=CentOS-$releasever - Updates Source Repository
baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=1
priority=1
[c5-extras-src]
name=CentOS-$releasever - Extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
protect=1
enabled=1
priority=1

[c5-plus-src]
name=CentOSplus -$releasever Source Repository
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=0
Now everything works. This is the output:
Code:
[root@cybertron yum.repos.d]# yumdownloader --source squid
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * extras: mirror.internode.on.net
 * rpmforge: apt.sw.be
 * base: mirror.internode.on.net
 * updates: ftp.twaren.net
 * centosplus: mirror.internode.on.net
 * addons: mirror.internode.on.net
c5-extras-src             100% |=========================|  951 B    00:00
c5-base-src               100% |=========================|  951 B    00:00
c5-updates-src            100% |=========================|  951 B    00:00
447 packages excluded due to repository priority protections
squid-2.6.STABLE21-3.el5. 100% |=========================| 1.4 MB    00:26
Reply With Quote
  #5 (permalink)  
Old 09-05-2009, 01:45 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Now, install downloaded squid*.src.rpm and go to /usr/src/redhat/SPECS/ and update squid.spec file and run command as mentioned in my 2nd post.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #6 (permalink)  
Old 09-05-2009, 01:57 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default

This is the error I get:
Code:
   1:squid                  warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
########################################### [100%]
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
Should I try yum install mockbuild?

EDIT: Searched on the internet it is just a warning.

Last edited by Cyborg_sa; 09-05-2009 at 02:07 PM.
Reply With Quote
  #7 (permalink)  
Old 09-05-2009, 02:31 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default

I got 2 errors:
Code:
Processing files: squid-2.6.STABLE21-3
error: File not found: /var/tmp/squid-2.6.STABLE21-root/usr/lib/squid/ncsa_auth
error: File not found: /var/tmp/squid-2.6.STABLE21-root/usr/lib/squid/pam_auth
error: File not found: /var/tmp/squid-2.6.STABLE21-root/usr/sbin/cossdump
error: File not found: /var/tmp/squid-2.6.STABLE21-root/etc/squid/msntauth.conf
error: File not found: /var/tmp/squid-2.6.STABLE21-root/etc/squid/msntauth.conf.default
and

Code:
RPM build errors:
    File not found: /var/tmp/squid-2.6.STABLE21-root/usr/lib/squid/ncsa_auth
    File not found: /var/tmp/squid-2.6.STABLE21-root/usr/lib/squid/pam_auth
    File not found: /var/tmp/squid-2.6.STABLE21-root/usr/sbin/cossdump
    File not found: /var/tmp/squid-2.6.STABLE21-root/etc/squid/msntauth.conf
    File not found: /var/tmp/squid-2.6.STABLE21-root/etc/squid/msntauth.conf.default
These are the configure options in the squid.spec file:

Code:
%configure \
   --exec_prefix=/usr \
   --bindir=%{_sbindir} \
   --libexecdir=%{_libdir}/squid \
   --localstatedir=/var \
   --datadir=%{_datadir} \
   --sysconfdir=/etc/squid \
   --enable-poll \
   --enable-snmp \
   --enable-linux-netfilter \
   --disable-ident-lookups \
   --enable-async-io \
   --enable-icmp \
   --enable-arp-acl \
   %ifnarch ppc64 ia64 x86_64 s390x
   --with-large-files \
   %endif
   --with-maxfd=16384 \
I removed the auth entries in the configure section. What can then be wrong?
Reply With Quote
  #8 (permalink)  
Old 09-05-2009, 04:11 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Those are just warning as user:group combo does not exists. Just ignore them.

You should not remove auth_helper (look like they are tightly integrated with squid). They are part of squid. Just add / modify your optimization compile time flags.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #9 (permalink)  
Old 09-05-2009, 04:45 PM
Junior Member
User
 
Join Date: Feb 2009
OS: CentOS
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cyborg_sa is on a distinguished road
Send a message via MSN to Cyborg_sa
Default

Done. Now it compiles without problem. Thanx for ur help
Reply With Quote
Reply

Tags
centos , rhel , rpm , rpm spec file , rpmbuild , squid source rpm


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
how to cross compile postfix mtamil Mail Servers 0 22-10-2008 03:46 PM
compile a new kernel in RHEL 5 vikas027 CentOS / RHEL / Fedora 3 24-03-2008 09:56 PM
How to compile a c program in freeBSD jkmb All about FreeBSD/OpenBSD/NetBSD 4 24-03-2008 08:01 PM
sa-compile diptanjan Linux software 1 07-06-2007 07:07 PM
Kernel Compile mannrj45 Linux software 1 02-12-2006 08:32 PM


All times are GMT +5.5. The time now is 12:17 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38