LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2011, 12:43 PM   #1
x201s
Member
 
Registered: Dec 2010
Posts: 67

Rep: Reputation: 0
the Apache not bundled with Red Hat


OS: red hat 5.5.
I downloaded and installed httpd-2.2.17 in /usr/local/apache2

Now, when I try to do service httpd start or stop or restart, it says:

Code:
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
I searched internet. Found a possible solution: Changed some entries inside /etc/rc.d/init.d/httpd.conf file

old
Code:
apachectl=/usr/sbin/apachectl
httpd=${HTTPD- /usr/sbin/httpd}
new
Code:
apachectl=/usr/local/apache2/apachectl
httpd=${HTTPD- /usr/local/apache2/bin/httpd}
But the error does not go away.

When I type http://localhost, it says "It works"-- that means the new (2.2.17) is alive and kicking. Isn't it so?

I know that my red had has httpd package installed and that one is doing something sinister.

I prefer to leave it alone because I don't have sufficient skill to remove it (dependency issues).

What I want to do is configure Apache in such a way that only the apache in /usr/local/apache2 is started when the server is started and that is the one and the only one when it comes to http(d).

I have added export PATH=/usr/local/apache2/bin:$PATH to .bashrc.

How to make it work? Can someone please advise?

Thank you.
 
Old 01-12-2011, 12:49 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
What I want to do is configure Apache in such a way that only the apache in /usr/local/apache2 is started when the server is started and that is the one and the only one when it comes to http(d).
In that case, the modification that you made to init.d/httpd will be sufficient to make the new apache start up when called.

So, what is the problem here? I guess i'm not understanding.
 
Old 01-12-2011, 03:36 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
I know that my red had has httpd package installed and that one is doing something sinister.
sinister???? like what ? writing logs to /var/log


why not use the httpd that rhel5.5 has already installed ?
AND configured and is stable
you ARE paying red hat for there VERY stable platform
you ARE paying for the updates

so why not use what you are paying for ?
 
Old 01-12-2011, 05:34 PM   #4
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
szboardstretcher:
Thank you for the comments.
The problem is when I try to do service httpd start or stop or restart, it says:

Quote:
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
My guess is the red hat's http is (also running? or ) using the port 80, which I want my downloaded version to use. My understanding is that When I start server for the first time, it IS running the downloaded version. But when I type service httpd restart or stop, I get the error.
 
Old 01-12-2011, 05:49 PM   #5
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
John VV:

Quote:
sinister???? like what ? writing logs to /var/log
I mean the red hat's apache is occupying port 80, which I want to use for the http that I downloaded.

Quote:
why not use the httpd that rhel5.5 has already installed ?
AND configured and is stable
you ARE paying red hat for there VERY stable platform
you ARE paying for the updates

so why not use what you are paying for ?
I only have the license, customer support is not included. (I do have redhat account and a reminder always reminds me that updates are available.. but they always fail because some kind of dependency issue. I think my linux is not configured properly... for update but this is for another topic.)

I wanted to customize the apache. For example, at configure time, I did

Code:
$ ./configure --enable-so --enable-mods-shared="proxy cache ssl all"
Now, I don't know if I could do what I wanted to do (enable reverse-proxy related modules at build time) with the one that came bundled. My superiors told me to download and compile on my own and I did-- not blaming them but this is how I arrived here.

Some posts suggested that I change listening port to 81 instead of 80 in httpd file, and I did that, but I didn't see any change.

If you have other idea, please comment.

Thank you for your time.
 
Old 01-12-2011, 06:23 PM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
IF you are going to compile from source grab the RH source rpm (src) and extract out the spec file. This will tell you all the tricks and patches RH had to use in order to get the application to run properly.
 
Old 01-12-2011, 10:31 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
I mean the red hat's apache is occupying port 80
that is the default. It is supposed to be 80
just change it is in the httpd.conf
just as you did for the doc root and web root

also the RHEL apache server software is very easy to remove
this is in the documentation
Code:
su -
yum groupremove "Web Server"
now you will need to reinstall PHP,Perl Mysql , phpmyadmin ,...
see
Code:
yum --help
-- and --
man yum
and for setting the default port to something other than 80
http://httpd.apache.org/docs/2.2/
http://httpd.apache.org/docs/2.2/configuring.html
 
Old 01-13-2011, 12:06 PM   #8
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lazlow View Post
IF you are going to compile from source grab the RH source rpm (src) and extract out the spec file. This will tell you all the tricks and patches RH had to use in order to get the application to run properly.
Lazlow: If I had that kind of skill, I would probably not have had this problem to begin with.
I will try to use groupremove and see if it works.
 
Old 01-13-2011, 12:15 PM   #9
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
I would agree JohnVV. I think you have RHET apache installed and possible running. Try running

service httpd status

If you configure apache from source then you need to read the documentaion with your apache source code.

Anyways besure to check your ports here

$less /etc/services

That files holds the port numbers. Look for port 80 and see what you figure out. if you still have your source code and already configure you might want to cd to the directory and run "# make uninstall"
 
Old 01-13-2011, 12:27 PM   #10
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
John VV:

I removed the "Web Server" with groupremove. The removal went without any problem.
The httpd inside /init.d has been changed to httpd.rpmsave.

Next, I am planning to rename that httpd.rpmsave to httpd and make directory location changes and

chkconfig --add httpd and run httpd as a service.

I want to stick to port 80.

I hope this works.
 
Old 01-13-2011, 12:30 PM   #11
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
DO NOT

if you put apache someplace else USE THAT httpd.conf

all that is is a BACKUP file

and edit THAT file
 
Old 01-13-2011, 01:28 PM   #12
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
jmc1987: Thanks for the comments. I will come back to you later.

I want to ask John VV:

Quote:
if you put apache someplace else USE THAT httpd.conf
httpd.conf, ok, I understand that I need to edit the one that I installed at /usr/local/apache2.

But isn't httpd is a different file than httpd.conf?
I mean, I need something (a 2service2 file) inside /init.d, so that http daemon is automatically started?
 
Old 01-13-2011, 02:12 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
without using the redhat rpm YOU need to manually configure EVERYTHING

read the apache docs

well STUDY them
step 1

as if this is a class and the only grade is the final exam
the web site IS the final exam
so read ,reread , jot down some notes , reread ,rewrite the notes
write a outline ( think of installing as a term paper ) for the install instructions
write your own instructions .

step 2
repeat step 1
 
Old 01-20-2011, 06:29 AM   #14
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
I have been able to fix it.
In /etc/init.d/httpd, my pidfile location (/var/run) was not "correct".

The "correct" location in my case was under /myApacheInstallationDir/logs.
This is written NOT in /myApacheInstallationDir/conf/httpd.conf, but in

/myApacheInstallationDir/conf/extra/httpd-mpm.conf

So the processes were not killed in stop or restart, hence "already running" warning.

It makes sense why John vv insists on reading, --or rather studying-- the docs, but it is not an easy task for me.

Allow me to close this thread.

Thank you szboardstretcher, lazlow, jmc1987 and john vv for participation.

Cheers,
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2.0 on Red Hat AS 2.1? zap1831 Red Hat 2 09-30-2005 04:56 AM
red hat and apache Porter200EL Linux - Newbie 3 05-05-2005 11:25 PM
Apache for Red Hat 9 TransAmJugo Linux - Software 1 08-14-2003 03:59 PM
Red Hat 9 and Apache Manric Linux - Software 2 07-25-2003 05:28 PM
Red Hat 7.2--Can't find Apache dmg2206 Linux - Distributions 6 08-06-2002 10:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration