LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-07-2005, 10:05 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Apache2 Help Needed!


I just installed Apache2 on my server and now want to just add a basic web page.

The default apache directory is under /var/www/apache2-default

Located there is the apache generic index.htm page to show that Apache is working.

I now want to add my own personal index.htm that I created to personalize my web server however when I add my index.htm to /var/www, it still shows the generic one located in the apache2-default directory. I then move my own personal index.htm to the apache2-default dir and it displays my own page now rather than the generic one but the address is now resolved as http://carlwill.dyndns.org/apache2-default/

I want the address to resolve as http://carlwill.dyndns.org/index

I think I need to back my own index.htm file one level to /var/www so the address will display as http://carlwill.dyndns.org/index.

Can anyone tell me what I am doing wrong?
 
Old 10-07-2005, 11:38 PM   #2
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
What is the DocumentRoot directive set to?
 
Old 10-08-2005, 05:36 AM   #3
alfNtexas
Member
 
Registered: Sep 2005
Location: Houston, Tx
Distribution: debian, SuSe, Fedora
Posts: 32

Rep: Reputation: 15
My FC4 apache default dir is /var/www/html and i use hn.org ... the site resolves quite well as ejecta.hn.org with files in the default location w/out haveing to edit the apache cfg file... so I kinda suspect yours will too..
 
Old 10-08-2005, 07:03 AM   #4
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
Put your index page in the /var/www/apache2-default directory instead of the /var/www
 
Old 10-08-2005, 08:55 AM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally posted by aznluvsmc
What is the DocumentRoot directive set to?
I don't know how to answer this questions.

Quote:
Originally posted by msound
Put your index page in the /var/www/apache2-default directory instead of the /var/www
My original post tells you that I did add my index page to /var/www/apache2-default which makes the URL path all weird.

The URL then becomes http://carlwill.dyndns.org/apache2-default/ but I want the URL to be http://carlwill.dyndns.org/index
 
Old 10-08-2005, 08:58 AM   #6
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
Go to /etc/apache2/sites-available/default

You'll see the references to /var/www/apache2-default. Change them to /var/www or whatever you want your DocumentRoot to be.

Then restart apache.
 
Old 10-08-2005, 03:56 PM   #7
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
This is what I see:

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>
 
Old 10-08-2005, 04:45 PM   #8
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
Try placing your index file in /var/www again but use an extension of .html. Apache does not recognize the .htm extension by default as this is a Windows thing. If you want Apache to recognize the .htm extension you need to edit your httpd.conf file and look for the DirectoryIndex directive then add index.htm as the first option before index.html.

Last edited by aznluvsmc; 10-08-2005 at 05:01 PM.
 
Old 10-17-2005, 12:13 AM   #9
maisy
LQ Newbie
 
Registered: Oct 2005
Location: UK
Posts: 1

Rep: Reputation: 0
Go back to this

# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>

and change to this

# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/
</Directory>

make sure you have /var/www/index.html then revisit your browser and try again
 
  


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
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 08:09 PM
Apache2 apache2-common WebDav timgerr Linux - Networking 1 08-25-2005 09:41 PM
apache2 basic tutorial needed exodist Linux - Networking 1 02-22-2005 08:24 PM
Apache2, MySQL & PHP Web Server. FTP Needed! Bobson Linux - Networking 4 02-07-2005 04:25 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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