How to start the right instance of Apache on RedHat server

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to start the right instance of Apache on RedHat server
# 8  
Old 07-29-2009
The OPTIONS variable is there to pass options to the httpd process. Do a man httpd to learn what the various options are. You can not input a command there, as it's not requesting the command to run.

In your case, I assume that you have your Apache configuration in another location/filename than the default configuration. If so, you will want to tell the Apache process where to find this new configuration.

I suggest the following line:

OPTIONS="-f <filename>"

This will make Apache use <filename> as your configuration file.

Also, you may want to not use /etc/init.d/httpd -k start to start your Apache process. The init script takes a single command as arguments. You can type /etc/init.d/httpd to see what these commands are.

service httpd start will do the same thing.
# 9  
Old 07-29-2009
i coppied the "httpd.conf" of the "apache2" instance i needed to use, in the directory "X" where i do have the other "httpd.conf" of the other "apache" instance, but when i do "httpd start", i get an error that calls a line in the "http.conf" and that is related to php and this is normal because only "apache2" instance was compiled taking into account php5.

i'am really desperate, because no one seems to understand what i want to do. THE ONLY THING I WANT IS TO MAKE MY APACHE2 INSTANCE THE DEFAULT APACHE INSTANCE THAT STARTS AFTER REBOOT AND CAN'T FIGURE OUT WHERE TO SET THIS ---> THAT'S THE ONLY THING I NEED TO DO AND I ALREADY TRIED MANY CONFIGURATION FILES ( such as "/etc/sysconfig/httpd" file ) WITHOUT SUCCESS
# 10  
Old 07-29-2009
Please try to clarify the situation.

Do you have two Apache installs (as in two separate complete install in two directories, binaries and all) or do you just have two configuration files?

When you try to start Apache, what error are you getting?

I understand your frustration, but in order for us to help you need to clarify what you are trying to do.

By guessing from what you've written, it appears like you have installed a separate Apache install in another directory. In order to start this instance of Apache rather than the default instance, you will need to indicate to the startup script that Apache resides in another directory.

If this is the case, edit /etc/sysconfig/httpd and add/edit the following lines:

HTTPD=<path to new binary>
OPTIONS="-d <location of serverroot>" # Default /etc/httpd/


If that is not the case, you need to clarify what you are trying to do in a better way.
# 11  
Old 07-29-2009
-have 2 distinct apache installed and just one of them is running at time

-it isn't a matter of having an error when starting the apache i need but a matter that: when i do "httpd start" i got the instance that i don't need running and to have the one i need i have to do "/etc/init.d/httpd -k start" AND I CAN WORK WHEN I DO THIS

I MODIFIED /etc/sysconfig/httpd FILE, CHANGING JUST

HTTPD=<path to new binary>

AND REBOOTED THE MACHINE, but it still give me an error that point that line in "httpd.config" which is :

"
AddHandler php5-script ...."

which is normal as i sad before, since this apache instance was not compiled with php !!!! THAT IS ALL THE MATTER !!!!!

# 12  
Old 07-29-2009
I understand your frustration, but if you wish for me to help you, please refrain from expressing this kind of hostile behaviour.

I'd love to help you, but please do not assume that I know what's happening on your server. In order to help you, you need to provide clear information of what is going on. What I'd like you to do is to provide the following:
  • The FULL error message you receive when starting Apache, no matter how irrelevant you may think it is.
  • The contents of your /etc/sysconfig/httpd file, WITHOUT comments (IE, do not copy lines that start with "#")
  • The location of BOTH your Apache binaries, both the old one and the new.
  • The location of the CONFIGURATION files for BOTH your Apache instances.
  • Whether you used yum install php another method to enable PHP support for Apache.
  • What version of Red Hat Enterprise Linux you are using.

The more information you can provide the better, and it will allow me as well as others to resolve your issue in a quick manner.
# 13  
Old 07-30-2009
THANK YOU SO MUCH AND I AM REALLY SORRY BUT THIS IS QUIET FRUSTRATING ! Smilie

As i wrote in the message before, it is not a matter of having an Error when starting Apache, but a matter of starting the right one and in this case Apache2 when doing the command "httpd start".

*) Binary directories : the Apache that starts, i mean the one that goes running when doing "httpd start", is under the dir "/etc/httpd" and the one i need is under "usr/local/apache2"
and that i start doing : "/etc/init.d/httpd -k start"

*) Same directories for the configuration files adding "/conf" piece to the directories i wrote before !.

*) ENTIRE content of the file "/etc/sysconfig/httpd" is commented with '#'

*) Linux version V5


================ FIXED USING WEBMIN !!==================

I FIXED THE PROBLEM AFTER INSTALLING WEBMIN ON MY REDHAT SERVER AND DEFINING A NEW OPERATION AT START TIME IN THE MENU "System/Bootup & Shutdown" that is "/etc/init.d/httpd start" AND IT WORK !!!

THANK SO MUCH

Last edited by mehdi1973; 07-30-2009 at 06:06 AM..
# 14  
Old 07-30-2009
Mehdi, I'm going to make one more attempt at trying to resolve your issue. The problem is that I need information in order to diagnose the problem, and I need ALL of the things I listed as bullet points, along with any other information you can provide. The MORE information you can give, the easier it will be to diagnose your issue.

Now... You state that you have two directories where Apache is installed. The new instance of Apache is located in /usr/local/apache2 if I understand things correctly. This directory is called your ServerRoot.

What you need to do is the following:

* Check your /etc/sysconfig/httpd and make sure that the OPTIONS variable has a -d option that points to your serverroot. Look further up in my thread for how to do this.
* MAKE SURE that the serverroot contains either a directory, or a symlink to a directory, containing the required modules, specifically the PHP5 module. This is EXACTLY why I asked you to supply the error message, so that I can verify if this is true or not.
* If this does not resolve your issue, I kindly ask you to provide the information I listed in the bulletpoints in my post above. Please list ALL of said information, or I will refrain from assisting further due to lack of relevant information to diagnose your issue.

One more thing. Is there a specific requirement for having two separate instances of Apache? Specifically, did you try yum install php to enable PHP-support for your existing Apache install?

Please see Install PHP 5 in Red Hat Enterprise Linux 5 for a guide as for how to install PHP5 support on Red Hat Enterprise Linux 5.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Unable to start the apache web server

Hi All, I'm getting this below error bash-4.1$ ./apachectl -k start (98)Address already in use: make_sock: could not bind to address hostname:18000 no listening sockets available, shutting down Unable to open logs I tried to change the port number, still same error: ... (5 Replies)
Discussion started by: raghur77
5 Replies

2. Red Hat

Redhat Apache

How is it possible to tied a IP address to folder in apache, so when someone put the ip in there browser they land in that folder? (3 Replies)
Discussion started by: da2013
3 Replies

3. UNIX for Advanced & Expert Users

Apache does not start

After i added this line to my apache httpd.conf it does not start. AuthUserFile /apps/apache22/conf/httpd.passwd and i see the below error. Syntax error on line 876 of /apps/apache22/conf/httpd.conf: AuthUserFile not allowed here Kindly help. (4 Replies)
Discussion started by: mohtashims
4 Replies

4. UNIX for Advanced & Expert Users

start instance via GUI

do you have any recommendation on how to restart instances of several servers via GUI? a. serverA: tomcat b. serverB: glassfish etc etc I already gave remote script but im thinking of other alternatives though pls help. thanks (0 Replies)
Discussion started by: lhareigh890
0 Replies

5. UNIX for Advanced & Expert Users

script to remotely start an application instance

just wanted to ask if anybody have script template for the subject above so I can make ti as my guide? example a. server 1.1.1.1: restart script located at /etc/init.d/glassfish.sh b. server 2.2.2.2: central script that support admin will use to execute to restart the /etc/init.d/glassfish.sh... (0 Replies)
Discussion started by: lhareigh890
0 Replies

6. UNIX for Dummies Questions & Answers

Maximum Number of Virtual Hosts per Apache instance

Is there a directive to limit the number of virtual hosts allowed per apache instance? I am told yes but I cannot find it. (1 Reply)
Discussion started by: mojoman
1 Replies

7. Red Hat

Apache instance

Hi , Maximum How many instances of apache can we run in one box? (2 Replies)
Discussion started by: krish4linux
2 Replies

8. Red Hat

X Server won't start (Redhat 9) HELP

im running rh 9 on my vmware, i tryed changing the graphics card mode to resize the desktop, after restarting i get a message X Server cannot start. then it takes me to the consol screen to log on, "im new to using linux as of last night" It would be helpfull if anyone can help me resolve... (4 Replies)
Discussion started by: aoteg
4 Replies

9. Solaris

help me........... my apache can't start

help me please.................bro i was install apache2 and i have been configure httpd.conf on my solaris 10 machine n i already running my httd service but why my webserver couldn't run on my browser? some buddy help me.............:confused::confused::confused::confused::confused: (5 Replies)
Discussion started by: yatmianto
5 Replies

10. UNIX for Dummies Questions & Answers

redhat 6.2 : Apache + PHP4

Hello, how are you all , I am having a hard time here I've got my Linux Redhat 6.2 server , with pre-instalation of redhat. anyway , I installed mysql (not rpm) and its working very well, but I faced lot of trouple with PHP4. Apache 1.1.12 was installed through rpm package and I updated... (1 Reply)
Discussion started by: t_zone
1 Replies
Login or Register to Ask a Question