[SOLVED] httpd not showing index page: httpd.conf deleted
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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...
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]#
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.