0

I add the following codes in httpd-vhost.conf file.

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mmcast"
ServerName mmcast.dev
 <Directory  "C:/xampp/htdocs/mmcast">
    AllowOverride All
    Require all granted
 </Directory>

Although I can run the Apache and MySQL in XAMPP but I cannot call my vhost.
I got "Unable to connect" error in when I call mmcast.dev in browser.

Do I need to change <VirtualHost *:80> into 81 ? Because I change Listen 81 in httpd file. But, I tried to change 80 to 81 but it still does not work.

In httpd.conf file, I change like this but it does not work.

<Directory />
AllowOverride all
Require all granted
</Directory>

In hosts file,

127.0.0.1       mmcast.dev

Only http://localhost:81/mmcast/ works. Can anyone help me please?

May Phyu
  • 895
  • 3
  • 23
  • 47
  • if you are using port 81, then yes 80 should be changed to 81 and make sure you call your domain `mmcast.dev:81` by including the port number – TheTechGuy Jul 18 '17 at 18:07
  • @hmd, bro I got it now... Thank you very much. :) I didn't add port number. But adding port number does not associate with virtual host naming in drupal? I mean .. I 'm afriad that portnumber include everywhere whenever I call the image location path in drupal bro – May Phyu Jul 18 '17 at 18:17
  • No, port number needs to be included in all request, if it is not default port 80. I haven't worked with drupal but it should be the same! – TheTechGuy Jul 18 '17 at 18:19
  • ok bro. Thanks a lot for your answer . :) – May Phyu Jul 18 '17 at 18:21
  • welcome, hope it is solved :) – TheTechGuy Jul 18 '17 at 18:22
  • bro @hmd, I would like to ask one question. I got Connection is not secure problem in my virtual host website. How can I solve this bro? In httpd-ssl file, port number is 4433 . bro. – May Phyu Jul 19 '17 at 07:48
  • have not worked with SSLs, you need to install SSL certificate first. You will have to purchase it from your host or a third party I believe. Default port for SSL is 443 though. – TheTechGuy Jul 19 '17 at 08:00
  • okie bro. Thanks :) – May Phyu Jul 19 '17 at 08:42

1 Answers1

0

Very first confirn you have an entry in hosts file -

127.0.0.1   mmcast.dev

Second, check httpd.conf file - there are multiple < directory tag and if necessary make all Require all granted

Third, in httpd-vhost.conf file write bellow lines

# you can put any port whatever you feel comfortable! I normally use 127.0.0.1:144 and counting for every project
Listen 127.0.0.1:81 
<VirtualHost 127.0.0.1:81>
    ServerName mmcast.dev
    DocumentRoot "C:\xampp\htdocs\mmcast"
    SetEnv APPLICATION_ENV "development"
    <Directory "C:\xampp\htdocs\mmcast">
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
    </Directory>
</VirtualHost>  

Fourthly, RESTART XAMPP Server. and try in browser https://127.0.0.1:81

Atiqur
  • 3,802
  • 1
  • 25
  • 26