0

I have searched other thread but unfortunately provided solution doesn't work. Here is what I did, add following code to "httpd-vhosts" file from apache>config>extra

<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/clientphp"
ServerName clientphp
SSLEngine on
SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/clientphp">
    Options All
    AllowOverride All
    Require all granted
</Directory>

Restarted the Apache server & MySQL on google chrome it still shows "not secure".

With Expactor Answer this is what I added:

  # http
  <VirtualHost 127.0.0.1:80>
  DocumentRoot "C:/xampp/htdocs/clientphp"
  DirectoryIndex index.php
   <Directory "C:/xampp/htdocs/clientphp">
    Options All
    AllowOverride All
    Require all granted
   </Directory>
   </VirtualHost>

# https
   <VirtualHost 127.0.0.1:443>
DocumentRoot "C:/xampp/htdocs/clientphp"
ServerName clientphp
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/clientphp">
    Options All
    AllowOverride All
    Require all granted
         </Directory>
      </VirtualHost>

enter image description here

its loading the site but with a red mark at url place

Update: Also if I use this link https://127.0.0.1/clientphp Then it says object not found.

mimi
  • 335
  • 5
  • 25
  • Can you access the site through https? Do you have a real certificate or a self signed certificate? (self signed usually shows as not secure, but that's just because they aren't verified, not because they don't work). – M. Eriksson Aug 02 '17 at 06:53
  • https://www.localhost/clientphp this one shows privacy error. I didn't modify or install any certificates, I am trying to use the default which comes with xampp. – mimi Aug 02 '17 at 06:57
  • 2
    That's because it's a self singed certificate. This post might help: https://stackoverflow.com/questions/35565278/ssl-localhost-privacy-error/41020281 to make Chrome accept it for localhost – M. Eriksson Aug 02 '17 at 06:59
  • try to use https instead of http to access your site, this might be the problem. – Atilla Arda Açıkgöz Aug 02 '17 at 07:01
  • @AtillaArdaAçıkgöz The link the OP posted in the comment is using https, and it's not that common that you get a privacy error using http. – M. Eriksson Aug 02 '17 at 07:02
  • @MagnusEriksson oh sorry, i did not notice comments. So next thing you need to configure is httpd-ssl.conf as well to set ssl – Atilla Arda Açıkgöz Aug 02 '17 at 07:08
  • @AtillaArdaAçıkgöz Please read the comments. Since https works (privacy error means that the web server responds and that the ssl-vhost is enabled and configured, as you can see in the question). The OP is using the self signed certificate that comes with Wamp. – M. Eriksson Aug 02 '17 at 07:09
  • @MagnusEriksson if those comments are part of the question then op should edit his question rather than posting it in the comments, So we can provide more help. – Atilla Arda Açıkgöz Aug 02 '17 at 07:11
  • I edited my question with new code suggestion – mimi Aug 02 '17 at 07:15
  • try this flag for chrome. just paste it to your url and enable allow invalid certificates from localhost chrome://flags/#allow-insecure-localhost – Atilla Arda Açıkgöz Aug 02 '17 at 07:26
  • @AtillaArdaAçıkgöz I already did that, it is already enabled – mimi Aug 02 '17 at 07:27
  • @mimi one last thing. Change DocumentRoot and Directory "C:/xampp/htdocs" into your "C:/xampp/htdocs/clientphp" for https and try it. – Atilla Arda Açıkgöz Aug 02 '17 at 07:31
  • @AtillaArdaAçıkgöz I already did that with Expactor updated answer. http://www.localhost/clientphp/ this one loading fine.http://www.localhost/clientphp/ this one loading but not secure sign in front of the url. – mimi Aug 02 '17 at 07:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/150786/discussion-between-atilla-arda-acikgoz-and-mimi). – Atilla Arda Açıkgöz Aug 02 '17 at 07:35

0 Answers0