LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   why won't Apache accept and additional Listen ports? (https://www.linuxquestions.org/questions/linux-networking-3/why-won%27t-apache-accept-and-additional-listen-ports-374535/)

mikeghet 10-18-2005 11:46 PM

why won't Apache accept any additional Listen ports?
 
Before I 'upgraded[cough]' to FC4 from FC3 I was able to add additional ports to listen to in my httpd.conf file by adding:

Listen port#
Listen port#

etc etc...

Now, even changing the defaul Listen 80
to somethign different doesn't work, nevermind adding more ports.

service httpd restart gives [failed] on return...not line number or anything. Now I know it used to....after putting FC4 and upgrading to the latest kernel, I also updated the apache to whatever version up2date had....

any takers?

mikeghet 10-18-2005 11:55 PM

Code:

# httpd -v
Server version: Apache/2.0.54
Server built:  Sep  2 2005 11:54:18

that's my version obviously


[Tue Oct 18 22:30:02 2005] [notice] caught SIGTERM, shutting down

and above is my lovely and not useful error line in my error log..

mikeghet 10-19-2005 11:12 AM

Nobody, eh?

mikeghet 10-19-2005 06:18 PM

http://httpd.apache.org/docs/2.0/bind.html

apach 2.0 supposedly supports this, just as the 1.3versions, but 2.0 doesn't actually work.

I just tried using multiple Listens on another brand new FC4 install and httpd just won't start. the error log, again, reports:

"[Wed Oct 19 16:17:10 2005] [notice] caught SIGTERM, shutting down"

Anyone on here ever use Apache and the Listen directive?

paranoid times 10-19-2005 06:34 PM

have you tried using "system-config-httpd" I switched from port 80 to 8080 with that to get through the firewall here, and it worked fine for me. it has an "add" feature, which may also allow you to add more ports. it works for me on FC4

Good Luck
-Michael

aznluvsmc 10-19-2005 08:19 PM

Run httpd -t to check the httpd.conf file syntax. It should return the line number of any incorrect directive.

mikeghet 10-19-2005 08:20 PM

hey, THANK YOU for responding...this is drving me insanse!

I never knew there was a gui for editing apache...how nice, except it overwrites the entire httpd.conf file...everytime? The config file it generates looks retarded too, but no biggy.

Well, I tried it and saved it...then tried to restart the httpd service and it failed again. Went into the httpd config file and commented out the extra port added, restarted httpd, and of course it worked because it ONLY works on one port and that one port has to port 80!

I don't understand what I could have done to make two different installs not work.

On both of them i used up2date to update the kernel and one only one of them I also updated apache from *.54 - *.55 version...both give same errors, so it must be something else.

Doesn't apache run independenlty of other software? Meaning it doesn't rely on some other configuration to run does it?

Intrestingly enough, the ssconfig file is reporting name doesn't atch errors. too be continuted...

mikeghet 10-19-2005 08:50 PM

Ok, this is the most insane thing....


Just before I was ready to jump off the nearest bridge I decided to try the ever so lovely command:

apachectl restart

instead of

service httpd restart


Like I have always done.

Guess what!! It works with the different Listen directives now! Very very wierd huh? I guess it has to do with httpd not having permission to bind ports other than 80, or something...

Anyway, I've seen other peopl have this same problem on the internet, and like me five minutes ago, they had no solution, so maybe this will help ppl use ../https -start or service httpd restart same thing.

paranoid times 10-19-2005 09:20 PM

thats interesting. i've always used

/etc/init.d/httpd start

because I forgot about service, I wonder if they work differently for some reason. anyways glad to know its working for you.

ahildoer 10-28-2005 12:03 PM

Solved - It is an SELinux issue.
 
Here is the solution to this one.

-Run system-config-securitylevel
-Click the 'SELinux' tab
-Under Modify SELinux Policy, expand 'HTTPD Service'
-Check 'Disable SELinux protection for httpd daemon'
-Click 'OK'
-If it prompts to save the changes, just select 'OK' or 'Continue' or 'Yes' or whatever the positive response is.

If you have any trouble with this, e-mail me: ahildoer@gmail.com

mikeghet 10-28-2005 12:45 PM

Oh, dang man, ur too good..! ;-)

I'm not at home on my linux box right now, but I know exactly what you are talking about.

Hopefully it works...I'll be sure to let ya know either way.

I was getting ready to convert my FC4 box to SUSE, as i've already done withmy desktop pc.

whovian 11-08-2005 05:08 PM

This worked great for me...thanks for the tip ahildoer :D The only one thing I can't figure out is how to grant access to a users public_html directory in FC3. If I could get this working it'd be great. I never had this problem with RH9.

ahildoer 11-08-2005 05:21 PM

public_html folder issues
 
Tersely, as I am studying for 3 midterms at the moment, make sure your permissions are correct.

For my public_html folder I set the following permissions:
$ chmod 701 /home/ahildoer
$ chmod 701 /home/ahildoer/public_html

In order for the web server to be able to get to the contents of the public_html folder, the user’s home folder and the public_html folder must be executable. In the context of directories, execute allows the directories to be traversed. You may also want to set the permissions of the contents of the public_html folder as well. I do so with the following command:
cmod -R 755 /home/ahildoer/public_html/* # this will modify only the contents of the folder and all subfolders

One final thing to check:
$ vi /etc/httpd/conf/httpd.conf file # make sure you uncomment the public_html related entries
$ sudo /sbin/service httpd restart

If that does not get your public_html folder up and running, I do not know what will

whovian 11-08-2005 05:42 PM

the httpd.conf file was moved by one of the above changes. I have no idea where it's at now.
I'm pretty sure I uncommented those lines though and it still won't work with the chmod changes.

ahildoer 11-08-2005 05:48 PM

you can try doing this to find the httpd.conf file:
$ sudo find / | grep 'httpd\.conf'

That could take some time.
Or if you plan to do lots of searches:
$ sudo updatedb # writes a file cache
$ locate httpd.conf # use this to seach the file cache for a file

Note: as files move around, the cache will go out of date. So do an updatedb before you start searching if it has been a while since the last time you ran updatedb.

But like I said before, if the conf file is configured correctly, and your permisions are set correctly, I do not know what it could be. I am actually not a Linux expert by any means.

Good luck.


All times are GMT -5. The time now is 03:36 PM.