LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2009, 10:52 PM   #1
athomas
Member
 
Registered: May 2009
Location: Eastern Shore, MD, USA
Distribution: CentOS 5.5
Posts: 184

Rep: Reputation: 15
Weird Apache "Issue"


For some odd reason (on CentOS) When I hit the default page for my Apache installation, it reverts to http://*servername*/apache2-default. How do I remove this appended extension?
 
Old 06-02-2009, 12:05 AM   #2
esoukenka
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Rep: Reputation: 2
locate your apache configuration file which can be different for different versions or distros but look for httpd.conf and apache.conf and apache2.conf. (find / -name httpd.conf)


Then in this file you will see
DocumentRoot you can modify this to specify a new document root.
 
Old 06-02-2009, 01:00 AM   #3
athomas
Member
 
Registered: May 2009
Location: Eastern Shore, MD, USA
Distribution: CentOS 5.5
Posts: 184

Original Poster
Rep: Reputation: 15
Oddly enough, it's empty. Not sure how httpd is even working...
 
Old 06-02-2009, 01:09 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Well, if this is a recent version of CENTOS eg v5.x, should be /etc/httpd/conf/httpd.conf. See also anything under /etc/httpd/conf.d, assuming you did the default install for Apache either install or via yum.
Otherwise, as mentioned, try the find cmd for various names eg


find / -iname 'http*' -print 2>/dev/null
find / -iname 'apache*' -print 2>/dev/null

also, the ps cmd has flags to do a long output of the cmds running ie daemon startup.
Also look in /etc/rc.d
 
Old 06-02-2009, 12:27 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by athomas
For some odd reason (on CentOS) When I hit the default page for my Apache installation, it reverts to http://*servername*/apache2-default. How do I remove this appended extension?
You might be hitting the default welcome page (which CentOS enables as part of a standard httpd rpm installation). Check /etc/httpd/conf.d/welcome.conf. It contains:
Code:
# 
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>
Just follow the directions and comment out the lines. Then:
# service httpd reload
 
Old 06-03-2009, 05:57 AM   #6
misarab
LQ Newbie
 
Registered: Feb 2006
Distribution: Debian
Posts: 5

Rep: Reputation: 0
I had the exact same problem after installing apache in a hurry on an old PC after my “Power Edge” was fried by a power surge. Be warned that I am still a total newbie after all these years when it comes to knowledgeability about these things, but that hasn’t stopped me so far.

Here goes…

As you have probably noticed the current Apache version seems to be Apache2 and configuration works differently so when you search the web for tips you get a lot of bad advice (that probably works fine for Apache 1.3). httpd.conf is not used anymore so it’s supposed to be empty, I think they keep it around for compatibility.

I’m running Debian on my machine but Apache2 is probably quite similar on all distros. In Debian the place for web pages is /var/www, in CentOS it maybe a different folder, but you should make sure to have at least an index.html file in this folder. In this www-folder there is another folder called apache2-default. I let that folder be just in case it’s needed for future reference but I deleted everything inside it, especially the index.html that I don’t want the browser to display anymore.

Next step; in the apache2 folder, mine is located at /etc/apache2, there is a folder called sites-available, and in that folder there is a file called default. The content of this file looks like a typical configuration file with so called “directives” that look a bit like html-tags. Now we are interested in one of the <Directory> directives.

Open the default file in your favourite text editor and search for RedirectMatch, in my file the whole line looks like this:
RedirectMatch ^/$ /apache2-default/

I warn you once again, I’m a newbie and have no idea what this line is for, I suspect it might have something to do with “virtual servers” which is also an unfamiliar term for me. If you are serving up pages for several domains like, www.mydomain.com and also www.anotherdomain.com from the same apache then this might be a bad idea. I’m running only one domain and this worked for me.

Comment out that line like so:
#RedirectMatch ^/$ /apache2-default/
and save the file and then restart apache. On Debian that’s: /etc/init.d/apache2 restart but it might be different for CentOS.

Good luck!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SSH issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 03:35 PM
Apache issue with "AddType" line. tekmann33 Linux - Newbie 2 01-08-2009 09:00 AM
How does "motd" work? And how about "issue"? rm_-rf_windows Linux - General 8 07-01-2007 01:53 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:34 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration