LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2012, 06:52 AM   #1
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Rep: Reputation: 15
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
 
Old 03-28-2012, 11:44 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:
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
 
Old 03-29-2012, 08:58 AM   #3
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Original Poster
Rep: Reputation: 15
[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
 
Old 05-01-2019, 07:31 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
removed

Last edited by berndbausch; 05-01-2019 at 05:04 PM.
 
Old 05-01-2019, 01:44 PM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by berndbausch View Post
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.
 
  


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
how to set apache virtual hosts Host-Based Security? hocheetiong Linux - Newbie 2 01-17-2014 04:20 AM
[SOLVED] Apache: IP- and port-based virtual server with Redirect catkin Linux - Server 2 04-11-2011 11:42 PM
Apache Virtual Hosting security with SuExec: file and directory permissions krasl Linux - Server 2 08-04-2010 08:41 AM
Virtual Hosts, defaults on port 81 with Apache not working S3ct0r Linux - Networking 2 06-19-2004 03:35 PM
--destination-ports port[,port[,port...]] KevinGuy Linux - Networking 1 03-16-2004 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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