LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-27-2012, 02:31 AM   #31
Iyyappan
Member
 
Registered: Dec 2008
Location: Chennai, India
Distribution: CentOS 5, SLES 11
Posts: 245

Original Poster
Rep: Reputation: 4

Reg: .htaccess. Enabled .htaccess in httpd.conf.
I have 3 files in htdocs
1. /htdocs/test1/index.html
2. /htdocs/test2/index.html
3. /htdocs/index.html

Placed .htaccess in test1 & test2 folders alone. If i access index.html from test1 & test2 its asking for password its fine. But when i access http://localhost its asking for password, if i give same credentials its working, is this correct ?.
 
Old 03-27-2012, 03:26 AM   #32
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
Placed .htaccess in test1 & test2 folders alone. If i access index.html from test1 & test2 its asking for password its fine. But when i access http://localhost its asking for password, if i give same credentials its working, is this correct ?.
It should ask for credentials when it finds a .htaccess with auth directives. So regarding test1 and test2 it's doing correct, but is shouldn't ask for authentication for the http://localhost
 
Old 03-27-2012, 03:49 AM   #33
Iyyappan
Member
 
Registered: Dec 2008
Location: Chennai, India
Distribution: CentOS 5, SLES 11
Posts: 245

Original Poster
Rep: Reputation: 4
When i give localhost or IP, i get the index.html of test1 only and not the default apache page !. Have setup Virtual hosts for test1 & test2 only, but i should get the apache page right....DocumentRoot is DocumentRoot "/usr/local/apache/htdocs. In htdocs there are 2 folders and 1 file
1. index.html
2. test1
3. test2

Can u guide where i have gone wrong
 
Old 03-27-2012, 04:41 AM   #34
Iyyappan
Member
 
Registered: Dec 2008
Location: Chennai, India
Distribution: CentOS 5, SLES 11
Posts: 245

Original Poster
Rep: Reputation: 4
After adding port 8080 in httpd.conf
Listen 80
Listen 8080

I accessed localhost:8080 . It worked without asking password. I think since in httpd.conf 80 port is configured and in virtual host, i had written rule to redirect 80 to 443. so the page got redirected to the first virtual host. Am i right.
 
Old 03-27-2012, 04:42 AM   #35
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Yes, but if you are using vhosts, then the 1st vhost is the default, so when you visit http://localhost you get that vhost with docroot /htdocs/test1
You need another vhost with a docroot /htdocs.
 
  


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
[SOLVED] mod_rewrite help! sriks Linux - Server 2 08-05-2010 02:50 PM
[python] syntax Error : invalid syntax Python_user Programming 2 09-06-2009 12:52 PM
mod_rewrite basarab1310 Linux - Newbie 1 11-06-2008 07:57 AM
Help with mod_rewrite MicahCarrick Linux - Software 3 05-23-2007 08:09 PM
mod_rewrite mr_dizzle Linux - General 1 02-02-2006 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:16 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
Open Source Consulting | Domain Registration