LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-13-2019, 08:59 AM   #16
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002

I would add the -f option to the OPTIONS variable in /etc/sysconfig/httpd. Of course, before you start the service with -f /app/apache/configfile, /app/apache/configfile must exist.

Simply copying /etc/httpd to /app/apache is not enough. You need to check if there are references to /etc/httpd in the current configuration and adjust them.

No need to remove /etc/httpd. I would keep it for an easy fallback option, just in case.
 
Old 08-14-2019, 07:49 AM   #17
QuinnXerses
LQ Newbie
 
Registered: Aug 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
I would add the -f option to the OPTIONS variable in /etc/sysconfig/httpd. Of course, before you start the service with -f /app/apache/configfile, /app/apache/configfile must exist.

Simply copying /etc/httpd to /app/apache is not enough. You need to check if there are references to /etc/httpd in the current configuration and adjust them.

No need to remove /etc/httpd. I would keep it for an easy fallback option, just in case.
Do I make the changes to /etc/systemd/system/httpd.service? What exactly do I put in the httpd.service file? What does the $OPTIONS -f entry look like?

In the new /app/apache/conf/ directory I have an Include at the bottom of the httpd.conf file:

######
Include conf/dev-test.conf

Inside dev-test.conf I have all the requisite pointers to /app/apache. I also assume in the httpd.conf file there I update ServerRoot "/app/apache"?
 
Old 08-14-2019, 10:06 AM   #18
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by QuinnXerses View Post
Do I make the changes to /etc/systemd/system/httpd.service?
I said:
Quote:
I would add the -f option to the OPTIONS variable in /etc/sysconfig/httpd
Quote:
What exactly do I put in the httpd.service file? What does the $OPTIONS -f entry look like?
You add "-f /app/apache/whateverthenameofyourconfigurationfileis" to the OPTIONS string. Unfortunately I don't have an example in front of me. A line like this probably works:
Code:
OPTIONS=${OPTIONS}" -f /app/apache/blabla"
Quote:
I also assume in the httpd.conf file there I update ServerRoot "/app/apache"?
I think so, especially if the original value of ServerRoot is /etc/httpd.
 
Old 08-14-2019, 10:26 AM   #19
QuinnXerses
LQ Newbie
 
Registered: Aug 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
So I don't update the httpd.service file in /etc/systemd/system/?

In /etc/sysconfig/httpd I've modified it to have:

#
OPTIONS=${OPTIONS} "-f /app/apache/conf/httpd.conf"

And the ServerRoot is updated in the /app/apache/conf/httpd.conf file as well.

Now if this is done correctly, do I run:

systemctl daemon-reload or do I use systemctl reload httpd.service?

And then start it up: systemctl start httpd.service

Last edited by QuinnXerses; 08-14-2019 at 10:42 AM.
 
Old 08-14-2019, 01:30 PM   #20
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by QuinnXerses View Post
So I don't update the httpd.service file in /etc/systemd/system/?

In /etc/sysconfig/httpd I've modified it to have:

#
OPTIONS=${OPTIONS} "-f /app/apache/conf/httpd.conf"

And the ServerRoot is updated in the /app/apache/conf/httpd.conf file as well.

Now if this is done correctly, do I run:

systemctl daemon-reload or do I use systemctl reload httpd.service?

And then start it up: systemctl start httpd.service
Yes.
 
Old 08-14-2019, 02:49 PM   #21
QuinnXerses
LQ Newbie
 
Registered: Aug 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Here's the error when I run it:

# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-08-14 15:39:10 EDT; 23s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 12246 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 12239 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 12239 (code=exited, status=1/FAILURE)

Aug 14 15:39:10 dev-test.machine httpd[12239]: -M : a synonym for -t -D DUMP_MODULES
Aug 14 15:39:10 dev-test.machine httpd[12239]: -t : run syntax check for config files
Aug 14 15:39:10 dev-test.machine httpd[12239]: -T : start without DocumentRoot(s) check
Aug 14 15:39:10 dev-test.machine httpd[12239]: -X : debug mode (only one worker, do not detach)
Aug 14 15:39:10 dev-test.machine systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Aug 14 15:39:10 dev-test.machine kill[12246]: kill: cannot find process ""
Aug 14 15:39:10 dev-test.machine systemd[1]: httpd.service: control process exited, code=exited status=1
Aug 14 15:39:10 dev-test.machine systemd[1]: Failed to start The Apache HTTP Server.
Aug 14 15:39:10 dev-test.machine systemd[1]: Unit httpd.service entered failed state.
Aug 14 15:39:10 dev-test.machine systemd[1]: httpd.service failed.
 
Old 08-19-2019, 07:15 AM   #22
QuinnXerses
LQ Newbie
 
Registered: Aug 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Does anyone have any idea how I can fix this issue? Any advice is welcome.
 
Old 08-19-2019, 09:06 AM   #23
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You could check the journal, as suggested. I would run journalctl -u httpd, then in the program enter minus followed by upper case S (i.e., -S) so that full lines are displayed.

However the error message indicates incorrect command line options. And indeed, something is wrong with OPTIONS:
Code:
OPTIONS=${OPTIONS} "-f /app/apache/conf/httpd.conf"
The space before the first double quote character causes the command to fail. Stick the quote right to the OPTIONS and put the space after it:
Code:
OPTIONS=${OPTIONS}" -f /app/apache/conf/httpd.conf"
Sorry I should have caught that earlier.

Last edited by berndbausch; 08-19-2019 at 09:19 AM.
 
Old 08-22-2019, 11:32 AM   #24
QuinnXerses
LQ Newbie
 
Registered: Aug 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
You could check the journal, as suggested. I would run journalctl -u httpd, then in the program enter minus followed by upper case S (i.e., -S) so that full lines are displayed.

However the error message indicates incorrect command line options. And indeed, something is wrong with OPTIONS:
Code:
OPTIONS=${OPTIONS} "-f /app/apache/conf/httpd.conf"
The space before the first double quote character causes the command to fail. Stick the quote right to the OPTIONS and put the space after it:
Code:
OPTIONS=${OPTIONS}" -f /app/apache/conf/httpd.conf"
Sorry I should have caught that earlier.
Made the changes, but still getting the same errors.
 
  


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
I overwrote /etc/httpd/conf/httpd.conf NotionCommotion Linux - Newbie 10 04-25-2014 11:58 AM
How to configure /etc/httpd/conf/httpd.conf file to run a html on web arunava.saha Red Hat 2 05-30-2012 03:28 AM
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM

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

All times are GMT -5. The time now is 07:30 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