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 09-18-2014, 05:06 AM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 262

Rep: Reputation: 2
httpd not showing index page: httpd.conf deleted


Hi,
I modified the httpd.conf file and when i restarted the computer, it was not there. Then i copied it from internet but the Apache index page is not displayed when i type localhost on the browser.
Code:
[root@localhost etc]# ls httpd
conf  conf.d  conf.modules.d  httpd.conf  logs  modules  run
[root@localhost etc]#
I have tried to reinstall the Apache but its saying :
Code:
[root@localhost lab6]# yum -y install httpd
Loaded plugins: langpacks, refresh-packagekit
updates/20/x86_64/metalink                               | 6.7 kB     00:00     
Package httpd-2.4.10-1.fc20.x86_64 already installed and latest version
Nothing to do
[root@localhost lab6]# whereis httpd
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz
Somebody please guide me how to solve this problem.

Zulfi.

Last edited by zak100; 09-18-2014 at 05:08 AM.
 
Old 09-18-2014, 06:00 AM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Where does the httpd.conf that you downloaded from the 'net think that your index.html page is?

If it believes that index.html is located in, for instance, /var/www/htdocs but you have it stored in /var/www/ then yes, going to localhost will not display index.html

Also, where did you find this httpd.conf ?

Also, are you sure that httpd is running?

Code:
systemctl status httpd.service
 
Old 09-18-2014, 09:17 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by zak100 View Post
Hi,
I modified the httpd.conf file and when i restarted the computer, it was not there.(Where there?)
Code:
[root@localhost etc]# ls httpd
conf  conf.d  conf.modules.d  httpd.conf  logs  modules  run
[root@localhost etc]#
Maybe it is in subdirectories conf or conf.d ?
 
Old 09-18-2014, 09:24 AM   #4
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
Check the httpd.conf that you downloaded. Check that it's DocumentRoot is where your web files are actually located. Make sure that any other file paths point to where the files are located on your server. Also, check that your web files are still there. If one file mysteriously went missing then there may be more...

Hope this helps!
 
Old 09-18-2014, 10:38 PM   #5
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I downloaded the file from following location:
Code:
https://collab.itc.virginia.edu/wiki/toolbox/example%20httpd.conf%20file.html
Following is the outputput of running httpd and its status option
Code:
[root@localhost lab6]# service httpd start
Redirecting to /bin/systemctl start  httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
[root@localhost lab6]# systemctl status.service
Unknown operation 'status.service'.
[root@localhost lab6]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: failed (Result: exit-code) since Thu 2014-09-18 23:30:43 EDT; 40s ago
  Process: 2170 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 2168 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2168 (code=exited, status=1/FAILURE)

Sep 18 23:30:43 localhost.localdomain httpd[2168]: AH00526: Syntax error on l...
Sep 18 23:30:43 localhost.localdomain httpd[2168]: Listen requires 1 or 2 arg...
Sep 18 23:30:43 localhost.localdomain systemd[1]: httpd.service: main process...
Sep 18 23:30:43 localhost.localdomain systemd[1]: Failed to start The Apache ...
Sep 18 23:30:43 localhost.localdomain systemd[1]: Unit httpd.service entered ...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost lab6]# journalctl -xn
-- Logs begin at Wed 2014-07-16 08:24:43 EDT, end at Thu 2014-09-18 23:30:43 EDT
Sep 18 23:30:30 localhost.localdomain systemd-logind[477]: Removed session c1.
-- Subject: A session c1 has been terminated
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- 
-- A session with the ID c1 has been terminated.
Sep 18 23:30:30 localhost.localdomain su[2067]: (to root) lab6 on pts/0
Sep 18 23:30:30 localhost.localdomain su[2067]: pam_unix(su:session): session op
Sep 18 23:30:31 localhost.localdomain fprintd[1251]: ** Message: No devices in u
Sep 18 23:30:43 localhost.localdomain systemd[1]: Starting The Apache HTTP Serve
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit httpd.service has begun starting up.
Sep 18 23:30:43 localhost.localdomain httpd[2168]: AH00526: Syntax error on line
Sep 18 23:30:43 localhost.localdomain httpd[2168]: Listen requires 1 or 2 argume
Sep 18 23:30:43 localhost.localdomain systemd[1]: httpd.service: main process ex
Sep 18 23:30:43 localhost.localdomain systemd[1]: Failed to start The Apache HTT
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit httpd.service has failed.
-- 
-- The result is failed.
Sep 18 23:30:43 localhost.localdomain systemd[1]: Unit httpd.service entered fai
[root@localhost lab6]#

Somebody please guide me.

Zulfi.
 
Old 09-18-2014, 10:43 PM   #6
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I have found that httpd.conf is still there. I would try by remove the downloaded and removing the changes which i made.
Code:
[root@localhost lab6]# cd /etc
[root@localhost etc]# cd httpd
[root@localhost httpd]# ls
conf  conf.d  conf.modules.d  httpd.conf  logs  modules  run
[root@localhost httpd]# ls conf
httpd.conf  magic
[root@localhost httpd]#
Zulfi.
 
Old 09-18-2014, 10:48 PM   #7
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Its running now. I actually made the following change:
Code:
Listen 80
#Listen 0.0.0.0:80 #New value
This was suggested to me by Chris (on this forum) so that i can run my web services. This required for ipv4. Kindly guide me how to make the required change.

Zulfi.
 
Old 09-18-2014, 11:22 PM   #8
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I tried again by writing:
Code:
Listen 0.0.0.0:80
instead of:

Listen 0.0.0.0:80 #New value


its working now.

Zulfi.
 
Old 09-18-2014, 11:26 PM   #9
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
By the looks of what you posted in #5, connf file has errors:

Quote:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: exit-code) since Thu 2014-09-18 23:30:43 EDT; 40s ago
Process: 2170 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 2168 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 2168 (code=exited, status=1/FAILURE)

Sep 18 23:30:43 localhost.localdomain httpd[2168]: AH00526: Syntax error on l...
Sep 18 23:30:43 localhost.localdomain httpd[2168]: Listen requires 1 or 2 arg...
Sep 18 23:30:43 localhost.localdomain systemd[1]: httpd.service: main process...
Sep 18 23:30:43 localhost.localdomain systemd[1]: Failed to start The Apache ...
Sep 18 23:30:43 localhost.localdomain systemd[1]: Unit httpd.service entered ...
share you conf file with us, so we can check further.

The best i can suggest is use the default conf file that comes with the apache package, if you dont find it re-install apache an then edit the default conf file per your needs.
cant see you mentioned what distor you are using ? It looks like a recent version of Redhat that uses systemctl.
 
Old 09-18-2014, 11:37 PM   #10
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I am now using the default file. The post #5 showed problem which i got when i was using downloaded httpd.conf. I thought i deleted the defalt file but it was there at a different location i.e /etc/httpd/conf.
I have made only one change:

Listen 0.0.0.:80

& its running again. Previously i put a comment symbol ('#') at the end of above line.
If you still want to look at httpd.conf, i would post it.

Zulfi.
 
  


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.2 Index.html / configure httpd.conf file kaltwasser Linux - Networking 17 12-09-2020 07:21 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
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
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
deleted httpd.conf - apache still finds it after restart jordanthompson Linux - Software 1 10-16-2004 02:08 PM

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

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