LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   want apache security in virtual ports only, not in port 80 (https://www.linuxquestions.org/questions/linux-software-2/want-apache-security-in-virtual-ports-only-not-in-port-80-a-936861/)

compused 03-28-2012 06:52 AM

want apache security in virtual ports only, not in port 80
 
In order to have apache security in a virtual port (103), I seem to have to enable security in port 80, which I don't want (otherwise I get this error msg when restarting apache:
Code:

AuthName not allowed here
I only want apache security in the virtual port. Anyone know whats wrong in the current config pls?:

In my apache.conf file I have:
Code:

DocumentRoot "/share/Web"
<Directory />
        # I dont know why we are referencing /
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
</Directory>
#
<Directory "/share/Web">
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
AuthName "Restricted Area"
AuthType basic
AuthUserFile /share/path/to/wwwpasswd
require user john3
</Directory>

And in a file referenced by apache.conf I have:
Code:

NameVirtualHost *:103
Listen 103
<VirtualHost *:103>
        ServerName server2
        DocumentRoot "/share/Web/service"

#<Directory "/share/Web/service">
#AuthName "Restricted Area"
#AuthType basic
#AuthUserFile /share/path/to/wwwpasswd
#require user john3
#</Directory>
</VirtualHost>
#

Any clues?
Thanks

bathory 03-28-2012 11:44 AM

Quote:

In order to have apache security in a virtual port (103), I seem to have to enable security in port 80, which I don't want (otherwise I get this error msg when restarting apache:
Code:

AuthName not allowed here
Apache authentication has nothing to do with the port apache is listening. So if you enable it, it will be used regardless if apache is listening on port 80, or port 103, or any other port.
Regarding the error, are you sure that you get it when you put the auth directives inside a <Directory ...></Directory> section?

IMHO it's better to uncomment the auth directives inside the vhost stanza and ditch those in the generic apache config file (I guess you mean httpd.conf instead of apache.conf).

Regards

compused 03-29-2012 08:58 AM

[solved]
 
Thanks for above info...understanding how it all flows through arrived me at the solution. I changed this area which controls port 80 in apache.conf (httpd.conf) to:
Code:

<Directory "/share/Web">
        Options FollowSymLinks MultiViews
        AllowOverride AuthConfig All
        Order allow,deny
        Allow from all
#I commented out lines below (as the aim was to disable security on port 80)
#and instead uncommented them in the desired <virtualhost> container to enable security there.
#AuthName "Restricted Area"
#AuthType basic
#AuthUserFile /share/path/to/wwwpasswd
#require user john3
</Directory>

A reference is: http://mathiasbynens.be/notes/apache-allowoverride-all

berndbausch 05-01-2019 07:31 AM

removed

hydrurga 05-01-2019 01:44 PM

Quote:

Originally Posted by berndbausch (Post 5990196)
If you have a question, ask a question rather than writing an answer to another question.

It was a spammer. You may want to edit your post to remove the spam link.


All times are GMT -5. The time now is 03:49 PM.