Apache 2.2 Config Help

Hi -
Being that this is the first time I am setting up Apache, I am sure I am just missing something obvious.  However, I have spent hours looking through the docs and on google and have come up empty.

I successfully installed Apache 2.2.  Typing in http://localhost will bring up the "It Works" page.  I then copied my web site to the /var/www/html directory.  However, "It Works" still came up.  The I tried creating a VirtualHost (edited httpd.conf) and then copied the files to /var/www/mywebsite/html.  Same result.  If I browse to the full path as my url (eg: /var/www/mywebsite/html/index.html) the page loads.

What is the obivous that I am missing?

Thanks,
LVL 3
ycgtechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
On my Ubuntu system "/var/www" is the Apache web root, not "/var/www/html".
0
mchkorgCommented:
I don't think you need any virtualhost for the moment, if your goal is to host one single web site.
You said you've put your files in /var/www/html. I understand your index.html is /var/www/html/index.html
Or move your files to /var/www, not /var/www/html

If this is correct, you'll access your website with this URL: http://localhost/html/index.html (or http://localhost/html/ which points to the default index.html as well)

(I suppose you're just trying to access html regular files, not php and so on (that might require some further configuration and apache/php packages))
0
OrcenCommented:
You need to open the httpd.conf file and look the correct folder for the 'DocumentRoot' directive. That's the full path where you need to put your html pages, or you can change it to '/var/www/mywebsite/html'

Another issue could be that your index page is a php page, and if you don't have any php module loaded apache will only search for index.html pages.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

samriCommented:
hi ycgtech,

On Centos box, there is a file in /etc/httpd/conf.d/welcome.conf

If this file is there on your installation, edit the file, and comment all of the lines, or you could move the file to other location, or just delete it.

0
ycgtechAuthor Commented:
Thanks for all of the suggestions.  I will review and then work on it again Saturday night, then I will reply back.

Thanks
0
ycgtechAuthor Commented:
Thanks again for comments.  Here are my replies:

@DaveBaldwin: The httpd.conf file lists /var/www/html as document root.

@mchkorg:  I originally did not have the virtual host setup.  I only went to that step when I could not get it working with the default settings.  Currently the web data is in /var/www/html AND /var/www/mywebsitename/html.  I have an index.html in both of those locations.

@Orcen:  The document root is /var/www/html.  This actually is a php website, but I have the php module installed.  But just to take this out of the loop for troubeshooting purposes (this was the first thing that came to my mind), I created a basic index.html for testing purposes.  Even with the html file the page still does not load.

@samri:  I commented out the lines, and then restarted Apache.  Same thing.  The "It Works" page still loads.

Next troubleshooting step?

Thanks!
0
Dave BaldwinFixer of ProblemsCommented:
Which OS or version of Linux are you using?  They don't all set up Apache the same way.
0
ycgtechAuthor Commented:
Centos 5
0
Dave BaldwinFixer of ProblemsCommented:
What do you have for "DirectoryIndex"?  I use "index.html index.htm index.php index.shtml".
0
ycgtechAuthor Commented:
index.html index.html.var
0
Dave BaldwinFixer of ProblemsCommented:
What do you get with "http://localhost/index.html"?
0
ycgtechAuthor Commented:
The "It Works" page.
0
ycgtechAuthor Commented:
Let me add to my above post:  I have checked and double-checked the web root location.  It is indeed set to /var/www/html.
0
ycgtechAuthor Commented:
Ok, figured it out.  but perhaps you can explain why:  A find for httpd.conf finds multiple files.  The one I was working off of was in /etc/httpd/conf.  There is another one that is in /usr/local/apache2/conf.  Once I edited that one, it worked (well sort of - I have other unrelated issues now that I need to work on).  Why more than one file?
0
Dave BaldwinFixer of ProblemsCommented:
I believe you, Centos sets up Apache different than Ubuntu, I looked it up.  some others use 'htdocs'.  "index.html.var" is a 'map' to other language version of 'index.html'.  If you're not using them, you don't need it.  If you're using PHP, you should have 'index.php' in the "DirectoryIndex" list.

Since you moved your website file to a different location, you should be able to delete all the file in /var/www/html and put in your own 'index.html'.

I just found this... "as of 2.2, there must be a VirtualHost defined that is identical to the default server."
0
Dave BaldwinFixer of ProblemsCommented:
Oh, missed post.  I don't know about extra copies of 'httpd.conf' though that certainly complicates things until you find the right one.  Watch out for multiple copies of 'php.ini' also.

Your setup is quite different than mine on Ubuntu.  I have everything in /etc/apache2 with subdirectories for the Virtual Servers 'conf' files and some other stuff.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ycgtechAuthor Commented:
Thanks, points awarded for sticking with me and helping me out until I realized there were mutiple copies.

Thanks again!
0
Dave BaldwinFixer of ProblemsCommented:
Thanks and you're welcome.  I know from experience that Apache can be a real pain to set up.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.