LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-09-2008, 07:57 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Rep: Reputation: 31
htaccess doesn't work


Hi!

I use solaris 10 and I did follow the following tutorial
http://www.whoopis.com/howtos/apache-auth.html
in order to use htaccess for 1 directory on my webserver.
I've fist edited httpd.conf:
I added AllowOverride AuthConfig in the general part of the file
and in the virtual part of the server.
Then I've created a password file with htpasswd and an .htaccess file. I've restarted apache many times but I don't get any change, no login prompt to be seen.
What did I forget?
Thanks for any help.
 
Old 06-09-2008, 09:23 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I've restarted apache many times but I don't get any change, no login prompt to be seen.
Make sure you have the following directive in the server part of httpd.conf
Code:
AccessFileName  .htaccess
and there is no "AllowOverride None".
Or check apache logs to see if you find anything.

Regards
 
Old 06-10-2008, 05:51 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory View Post
Make sure you have the following directive in the server part of httpd.conf
Code:
AccessFileName  .htaccess
and there is no "AllowOverride None".
Or check apache logs to see if you find anything.

Regards
I've checked the httpd.conf, everything is fine as you've described.

In the error.log there is nothing to see.
In the access.log there is no error message.
 
Old 06-10-2008, 06:41 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure you're editing the correct httpd.conf? Because you should at least see a "Forbidden" error or "Internal server error", if apache reads the "AllowOverride Authconfig" directive.
You can leave the "AllowOverride Authconfig", only in the virtualhost part adding
Code:
Order allow,deny
Allow from all
after the directive, to see what happens.
 
Old 06-10-2008, 08:14 AM   #5
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Until now I just looked in the logs from my virtualhost. I found the apache's logs, and it says:
Quote:
[ Jun 10 15:09:00 Executing start method ("/lib/svc/method/http-apache2 start") ]
Syntax error on line 1218 of /etc/apache2/httpd.conf:
AllowOverride not allowed here
[ Jun 10 15:09:00 Method "start" exited with status 1 ]
I want to apply my .htaccess to the following virtual host:
Quote:
1209 <VirtualHost *>
1210 ServerAdmin myname@website.org
1211
1212 ServerName www.website.org
1213 ServerAlias website.org
1214 DocumentRoot /mydocs
1215 ErrorLog /var/log/website/error.log
1216 TransferLog /var/log/website/access.log
1217
1218 AllowOverride AuthConfig
1219
1220
1221 </VirtualHost>
so why doesn't it accept it?
 
Old 06-10-2008, 08:35 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Then you must put a <Directory ...> inside the VirtualHost part:
Code:
<VirtualHost *>
ServerAdmin myname@website.org

ServerName www.website.org
ServerAlias website.org
DocumentRoot /mydocs
ErrorLog /var/log/website/error.log
TransferLog /var/log/website/access.log
<Directory /mydocs>
AllowOverride AuthConfig
/Directory>

</VirtualHost>
 
Old 06-10-2008, 09:09 AM   #7
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory View Post
Then you must put a <Directory ...> inside the VirtualHost part:
Code:
<VirtualHost *>
ServerAdmin myname@website.org

ServerName www.website.org
ServerAlias website.org
DocumentRoot /mydocs
ErrorLog /var/log/website/error.log
TransferLog /var/log/website/access.log
<Directory /mydocs>
AllowOverride AuthConfig
/Directory>

</VirtualHost>
Thank you very much! The problem seems to be gone. I have another difficulty though:
Quote:
[ Jun 10 15:57:59 Executing start method ("/lib/svc/method/http-apache2 start") ]
(125)Address already in use: make_sock: could not bind to address xxx.xxx.xx.xx:80
no listening sockets available, shutting down
I don't get why it has now such a problem...
 
Old 06-11-2008, 01:57 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
There is something else listening on port 80. Perhaps apache is already started by startup scripts and you're trying to start it again.

Regards
 
Old 06-12-2008, 04:34 AM   #9
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
It seemed that even when I diseabled apache, there were still httpd processes. So I just killed them all and restarted apache. Now it works. Thanks a lot for your help!
 
  


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
.htaccess Doesn't Work breadfan311 Linux - Server 9 03-31-2008 07:11 AM
htaccess don't work???? cuencano Linux - Security 3 07-23-2005 06:09 AM
.htaccess help, passwords dont work Atrocity Linux - General 4 07-04-2004 04:22 PM
problem getting .htaccess files work wiggywag Slackware 6 02-17-2004 01:21 PM
htaccess not work on apache 2 adrianmak Linux - Networking 2 01-09-2003 02:25 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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