Portal Home > Knowledgebase > Articles Database > SSL not working after Apache modification


SSL not working after Apache modification




Posted by andym193, 02-10-2015, 04:04 PM
I'm not really sure if I can ask this question here. I have a Magento store in a sub-directory. I don't mind having sub domain or a sub directory. I have a wilcard SSL certificate and I was able to make https work with my store. But I needed to have an Apache modification - from this: ServerName *.lumenco.ca ServerAlias *.lumenco.ca VirtualDocumentRoot /home/lumenco0/public_html/%1 ServerAdmin webmaster@lumenco.ca UseCanonicalName Off To this: ServerName lumenco.ca ServerAlias *.lumenco.ca VirtualDocumentRoot /home/lumenco0/public_html/%1 ServerAdmin webmaster@lumenco.ca UseCanonicalName On Because of that modification, my store sub domain (store.mysite.com) doesn't work so I had to change it to a subdirectory (mysite.com/store) but with a sub directory, https doesn't work correctly - it works for admin but I get an internal error when https is used on frontend pages. Any ideas to fix this issue will be much appreciated.

Posted by helix247, 02-10-2015, 04:11 PM
Do you have to have the * in the server name/alias? Why not just do the actual subdomain/root domain? Also I think the server name would have to be sub.root.com.

Posted by andym193, 02-10-2015, 05:31 PM
Well basically I have a wordpress multisite with a sub domain structure installed in my pubic_html. I have set up wildcard sub domains with a * as a sub domain so my wordpress multisite works as usual. Any user can sign up and create a blog. However, apparently to have my wordpress mutisite working correctly with SSL (so everytime a user signs up, https works) I need that modification. My discussion about that can be seen here: http://wordpress.stackexchange.com/q...ite-subdomains I don't know if I need the * in the server name/alias. But it seems like I do based on the conversation in the link above. But because that modification, I'm having this issue with my Magento store. My host said they don't think they can fix the issue with that Apache modification, and so would have to use a wordpress plugin for a store, or remove that Apache modification, but if I remove that modification, I'm back with my first issue which was getting SSL to work correctly for my Wordpress multisite. I basically would just like my wordpress multisite to work with https (so it is https ready when users sign up) and to have a magento store working with https. At this moment I can only setup any one of them with https, but not both. Last edited by andym193; 02-10-2015 at 05:46 PM.

Posted by hostinit, 02-11-2015, 01:52 AM
Hi, Whats the exact issue you are facing while accessing store.yoursite? If you dont mind, share the content of your .htaccess file.

Posted by andym193, 02-12-2015, 12:02 AM
Thanks for your replies. By the way lumenco.ca isn't my domain that was just an example of what somone gave me. I assumed my host just relaced what was nessassary which fixed my wordpress issue as a result. Well I worked out the problem with https on my store with a subdirectory, I either had to turn off Web Server Rewrites in admin, or uncomment and set the rewrite rule in htaccess RewriteBase /store/ I would prefer to have a sub domain for my store, I would be greatful if you have any ideas on how to get the subdomain to work with https but if not, I am pretty happy with a sub directory store. Again, I originally was able to setup https for my subdomain store, but my host made that modification to make my Wordpress multisite suitable for https so I'm not sure if there is a work around. To get it to work on a sub domain is a more complicated issue, I'm not sure if it can be fixed with htaccess - I just created a new sub domain with nothing inside except an index.html file to see if the same happens, and it does: http://test.mysite.com - works fine https://test.mysite.com - doesn't work and it is the same problem with the Magento store with a sub domain - the url will have the subdomain web address in the URL box (https://test.mysite.com), but the page views whatever is in my website root. And because my web root has a worpress mutisite install, it shows the wordpress registration page for a user to register a site in that name (test.mysite.com). If I remove that symlink in my web root though (that my host added to setup SSL) then that subdomain will just display a 404 error. My magento htaccess (default Magento htaccess with just the rewrite rule edit if using a subdirectory) ## enable resulting html compression############################################ ## uncomment these lines for CGI mode ## make sure to specify the correct cgi php binary file name ## it might be /cgi-bin/php-cgi # Action php5-cgi /cgi-bin/php5-cgi # AddHandler php5-cgi .php ############################################ ## GoDaddy specific options # Options -MultiViews ## you might also need to add this line to php.ini ## cgi.fix_pathinfo = 1 ## if it still doesn't work, rename php.ini to php5.ini ############################################ ## this line is specific for 1and1 hosting #AddType x-mapp-php5 .php #AddHandler x-mapp-php5 .php ############################################ ## default index file DirectoryIndex index.php ############################################ ## adjust memory limit # php_value memory_limit 64M php_value memory_limit 256M php_value max_execution_time 18000 ############################################ ## disable magic quotes for php request vars php_flag magic_quotes_gpc off ############################################ ## disable automatic session start ## before autoload was initialized php_flag session.auto_start off ############################################ ## enable resulting html compression php_flag zlib.output_compression on ########################################### # disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off ########################################### # turn off compatibility with PHP4 when dealing with objects php_flag zend.ze1_compatibility_mode Off ########################################### # disable POST processing to not break multiple image upload SecFilterEngine Off SecFilterScanPOST Off ############################################ ## enable apache served files compression ## http://developer.yahoo.com/performance/rules.html#gzip # Insert filter on all content ###SetOutputFilter DEFLATE # Insert filter on selected content types only #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript # Netscape 4.x has some problems... #BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems #BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content #Header append Vary User-Agent env=!dont-vary ############################################ ## make HTTPS env vars available for CGI mode SSLOptions StdEnvVars ############################################ ## enable rewrites Options +FollowSymLinks RewriteEngine on ############################################ ## you can put here your magento root folder ## path relative to web root #(if using sub directory) RewriteBase /store/ ############################################ ## uncomment next line to enable light API calls processing # RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L] ############################################ ## rewrite API2 calls to api.php (by now it is REST only) RewriteRule ^api/rest api.php?type=rest [QSA,L] ############################################ ## workaround for HTTP authorization ## in CGI environment RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] ############################################ ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks RewriteCond %{REQUEST_METHOD} ^TRAC[EK] RewriteRule .* - [L,R=405] ############################################ ## redirect for mobile user agents #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$ #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302] ############################################ ## always send 404 on missing files in these folders RewriteCond %{REQUEST_URI} !^/(media|skin|js)/ ############################################ ## never rewrite for existing files, directories and links RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l ############################################ ## rewrite everything else to index.php RewriteRule .* index.php [L] ############################################ ## Prevent character encoding issues from server overrides ## If you still have problems, use the second line instead AddDefaultCharset Off #AddDefaultCharset UTF-8 ############################################ ## Add default Expires header ## http://developer.yahoo.com/performan...s.html#expires ExpiresDefault "access plus 1 year" ############################################ ## By default allow all access Order allow,deny Allow from all ########################################### ## Deny access to release notes to prevent disclosure of the installed Magento version order allow,deny deny from all ############################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags #FileETag none Thanks Last edited by andym193; 02-12-2015 at 12:13 AM.

Posted by donski, 02-12-2015, 12:26 AM
can you post the exact error your receiving when browsing to the site? the certificate can stop working for a lot of different reasons and we need the specific error code to debug in detail. In general a trusted certificate on a web server, wildcard or not, is the only certificate that can be used on that port. if your throwing a certificate error after modifying the default behavior of Apache you might need to reinstall the certificate by going back to the original issuer and requesting a new keypair.

Posted by hostinit, 02-12-2015, 02:16 AM
Try adding a separate virtuahost instead of dynamic virtualhost.

Posted by andym193, 02-13-2015, 01:52 PM
I created another support ticket with my host and they were able to fix it, I suggested adding a separate virtual host so that may have fixed it. Thanks for your help.

Posted by hostinit, 02-13-2015, 10:53 PM
Good to know it fixed the issue.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
hotmail.co.uk down? (Views: 810)
CatsNine- Monty Down (Views: 876)


Language: