LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 09-15-2015, 10:45 PM   #1
Abdizriel
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Rep: Reputation: Disabled
Why site over SSL is not working


Hello,

I've got problem with setting site over SSL with httpd.

My configuration is following for *:80

Code:
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
	ServerAdmin webmaster@site.com
	DocumentRoot /var/www/dev
	DirectoryIndex index.php index.html
	ServerName www.site.com
	ErrorLog logs/site.com-error_log
	CustomLog logs/site.com-access_log common

	<Directory /var/www/dev>
		RewriteEngine On
		RewriteOptions Inherit
		Options All
		AllowOverride FileInfo
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>
So I thought that if I copy it and add data needed for SSL it will work. However, when I do that I've got httpd default page.
If I input in my address: https://site.com/public/index.php I can see that it's 'working there so it means that I'm in document root but default page is not loaded from /public/index.php as it should be done from .htaccess:

Code:
<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule  ^$ public/    [L]
	RewriteRule  (.*) public/$1 [L]
</IfModule>
So question is why with similar cofiguration for https as for http it's not working?

Code:
Listen 443
NameVirtualHost *:443
<IfModule mod_ssl.c>
	<VirtualHost *:443>
		ServerAdmin webmaster@site.com
		DocumentRoot /var/www/html
		DirectoryIndex index.php index.html
		ServerName www.site.com
		ErrorLog logs/site.com-error_log
		CustomLog logs/site.com-access_log common

		SSLCertificateKeyFile /path/to/key
		SSLCertificateFile /path/to/cert  
		SSLCACertificateFile /path/to/cert
		
		<Directory /var/www/html>
			RewriteEngine On
			RewriteOptions Inherit
			Options All
			AllowOverride FileInfo
			Order allow,deny
			Allow from all
		</Directory>

	</VirtualHost>
</IfModule>
 
Old 09-21-2015, 03:28 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by Abdizriel View Post
Hello,

I've got problem with setting site over SSL with httpd.

My configuration is following for *:80

Code:
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
	ServerAdmin webmaster@site.com
	DocumentRoot /var/www/dev
	DirectoryIndex index.php index.html
	ServerName www.site.com
	ErrorLog logs/site.com-error_log
	CustomLog logs/site.com-access_log common

	<Directory /var/www/dev>
		RewriteEngine On
		RewriteOptions Inherit
		Options All
		AllowOverride FileInfo
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>
So I thought that if I copy it and add data needed for SSL it will work. However, when I do that I've got httpd default page.
If I input in my address: https://site.com/public/index.php I can see that it's 'working there so it means that I'm in document root but default page is not loaded from /public/index.php as it should be done from .htaccess:

Code:
<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule  ^$ public/    [L]
	RewriteRule  (.*) public/$1 [L]
</IfModule>
So question is why with similar cofiguration for https as for http it's not working?

Code:
Listen 443
NameVirtualHost *:443
<IfModule mod_ssl.c>
	<VirtualHost *:443>
		ServerAdmin webmaster@site.com
		DocumentRoot /var/www/html
		DirectoryIndex index.php index.html
		ServerName www.site.com
		ErrorLog logs/site.com-error_log
		CustomLog logs/site.com-access_log common

		SSLCertificateKeyFile /path/to/key
		SSLCertificateFile /path/to/cert  
		SSLCACertificateFile /path/to/cert
		
		<Directory /var/www/html>
			RewriteEngine On
			RewriteOptions Inherit
			Options All
			AllowOverride FileInfo
			Order allow,deny
			Allow from all
		</Directory>

	</VirtualHost>
</IfModule>

Stupid question... is the module being loaded? (mod_ssl)?
 
  


Reply

Tags
apache22, htaccess, httpd, virtual host



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
SSL site migration dvazart Linux - Server 1 02-03-2015 03:07 PM
How to cnfigure second site with ssl konzo Linux - Server 1 04-09-2011 06:36 AM
creating an SSL page under non SSL site with apache1.33? taiwf Linux - Software 1 06-27-2006 01:06 AM

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

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