LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-28-2015, 11:12 AM   #1
davama
LQ Newbie
 
Registered: Mar 2013
Location: Brooklyn, NY
Distribution: Arch,Fedora,CentOS, RHEL, SLES, Ubuntu,
Posts: 11

Rep: Reputation: Disabled
Help! - Apache 2.4 w/ radius and virtualhosts


Hello,
I'm trying to setup 2 virtual host with xradius authentication. My xradius module is loaded on:
/etc/httpd/conf.modules.d/00-xradius.conf
with
Code:
LoadModule auth_xradius_module modules/mod_auth_xradius.so
Now to the end of my httpd.conf file i append the following:
Code:
ServerName b-25-6crlab-ecr-1
<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerAdmin root@syslog
	ServerAlias www.rsyslog.net
        DocumentRoot "/var/www/html/"
        SSLEngine On
	SSLProtocol all -SSLv2
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
	SSLOptions +StdEnvVars +OptRenegotiate
        SSLCertificateFile    /etc/httpd/ssl/server.crt
        SSLCertificateKeyFile /etc/httpd/ssl/server.key
	<Directory "/var/www/html">
		SSLRequireSSL
		Require valid-user
		Options +ExecCGI
		Options ExecCGI FollowSymlinks
		AllowOverride None
	</Directory>
</VirtualHost>
<VirtualHost *:443>
	ServerAdmin root@ecr
	ServerAlias www.ecr.net
        DocumentRoot "/usr/share/cgit/"
        SSLEngine On
	SSLProtocol all -SSLv2
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
	SSLOptions +StdEnvVars +OptRenegotiate
	Alias /cgit-data /usr/share/cgit/
	ScriptAlias /cgit /var/www/cgi-bin/cgit
        SSLCertificateFile    /etc/httpd/ssl/server.crt
        SSLCertificateKeyFile /etc/httpd/ssl/server.key
	<Directory "/usr/share/cgit">
		SSLRequireSSL
		Require valid-user
		Options +ExecCGI
		AddHandler cgi-script .cgi
		Options ExecCGI FollowSymlinks
		AllowOverride None
	</Directory>
</VirtualHost>
</IfModule>

<VirtualHost *:80>
        RewriteEngine on
        ReWriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
The above config works fine. I'm able to access both webapps with https redirection. Radius not in use at this point
Now when i try to use the xradius module options, like so, it does not work. i just goes straight through without authentication:
Code:
ServerName b-25-6crlab-ecr-1
<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerAdmin root@syslog
	ServerAlias www.rsyslog.net
        DocumentRoot "/var/www/html/"
        SSLEngine On
	SSLProtocol all -SSLv2
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
	SSLOptions +StdEnvVars +OptRenegotiate
        SSLCertificateFile    /etc/httpd/ssl/server.crt
        SSLCertificateKeyFile /etc/httpd/ssl/server.key
	<Directory "/var/www/html">
		AuthXRadiusAddServer "10.x.x.x:1812" "super_awesome_secret"
		## Time in Seconds to wait for replies from the RADIUS Servers
		AuthXRadiusTimeout 2
		AuthXRadiusRejectBlank on
		## Number of times to resend a request to a server if no reply is received. 
		AuthXRadiusRetries 2
		AuthType Basic
		AuthName "WHQ RADIUS"
		AuthBasicProvider xradius
		SSLRequireSSL
		Require valid-user
		Options +ExecCGI
		Options ExecCGI FollowSymlinks
		AllowOverride None
	</Directory>
</VirtualHost>
<VirtualHost *:443>
	ServerAdmin root@ecr
	ServerAlias www.ecr.net
        DocumentRoot "/usr/share/cgit/"
        SSLEngine On
	SSLProtocol all -SSLv2
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
	SSLOptions +StdEnvVars +OptRenegotiate
	Alias /cgit-data /usr/share/cgit/
	ScriptAlias /cgit /var/www/cgi-bin/cgit
        SSLCertificateFile    /etc/httpd/ssl/server.crt
        SSLCertificateKeyFile /etc/httpd/ssl/server.key
	<Directory "/usr/share/cgit">
		AuthXRadiusAddServer "10.x.x.x:1812" "super_awesome_secret"
		## Time in Seconds to wait for replies from the RADIUS Servers
		AuthXRadiusTimeout 2
		AuthXRadiusRejectBlank on
		## Number of times to resend a request to a server if no reply is received. 
		AuthXRadiusRetries 2
		AuthType Basic
		AuthName "WHQ RADIUS"
		AuthBasicProvider xradius
		SSLRequireSSL
		Require valid-user
		Options +ExecCGI
		AddHandler cgi-script .cgi
		Options ExecCGI FollowSymlinks
		AllowOverride None
	</Directory>
</VirtualHost>
</IfModule>

<VirtualHost *:80>
        RewriteEngine on
        ReWriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
It gets even better!
So i move the above code (the one with xradius) to conf.d/cgit.conf and replace it entirely. xradius authenticates me and goes to "Unauthorized" if auth fails. When auth passes im redirected to the first virtualhost but when i try to go the second i get virtualhost i get:
"Not Found"

First VHOST is just https://ip-address < which is fine
Second VHOST is https://ip-address/cgit < Not found message

Im not entirely familiar with apache. I've set vhost before with xradius but only with 1 Vhost. Now im trying two.
Any input as to how to resolve the Xradius not working in the first scenario or "Not found" msg in the second would be very much appreciated.

Thank you in advance
Dave
 
Old 09-09-2015, 09:00 PM   #2
davama
LQ Newbie
 
Registered: Mar 2013
Location: Brooklyn, NY
Distribution: Arch,Fedora,CentOS, RHEL, SLES, Ubuntu,
Posts: 11

Original Poster
Rep: Reputation: Disabled
Solved.

See here:
https://bbs.archlinux.org/viewtopic....57898#p1557898
Thanks

Last edited by davama; 09-09-2015 at 09:02 PM.
 
  


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] Apache with VirtualHosts how to use lpallard Linux - Server 18 02-24-2013 08:51 PM
Apache and Virtualhosts slowness fireballsp Linux - Server 2 01-12-2013 10:22 AM
apache and cgi VirtualHosts gabsik Linux - Server 1 10-23-2008 04:20 AM
Apache VirtualHosts and VSFTPd critical Linux - Software 3 09-14-2005 02:12 PM
VirtualHosts & apache 2.0.48 TiCkO Linux - Networking 2 07-13-2004 03:20 PM

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

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