[Vuejs]-Run Webpack + Vue in a Local VirtualServer

1๐Ÿ‘

โœ…

  1. Open /Applications/XAMPP/xamppfiles/etc/httpd.conf file in any editor and look for the following lines.
# Virtual hosts
# Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
  1. Remove # from second line to enable virtual host

  2. Open /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf file, remove everything and write below code.

<VirtualHost *:8080>    
  ServerName myweb.site
  ServerAlias myweb.site
  <Location />
    ProxyPass "/" "http://localhost:3000/"
    ProxyPassReverse "/" "http://localhost:3000/"
  </Location>
</VirtualHost>
  1. Open /etc/hosts and add 127.0.0.1 myweb.site to bottom
  2. Restart Apache Server from XAMPP Control Panel

myweb.site should be same in both file, this will be your URL for your Vue app and http://localhost:3000 is your app url, port should be same with port of your development server

  1. Open any browser and enter http://localhost:8080 or http://myweb.site
๐Ÿ‘คAhmet Zeybek

Leave a comment