---
# System prepended metadata

title: 'ECO: MAP TÊN MIỀN ẢO VỚI PORT REACTJS (XAMPP + WINDOWN)'

---

# ECO: MAP TÊN MIỀN ẢO VỚI PORT REACTJS (XAMPP + WINDOWN)
## Dự án passio-frontend
#### Reference links: https://gist.github.com/ralphcrisostomo/4036231

* B1: Open httpd.conf file in path: C:\xampp\apache\conf
```bash
- Un-comment 3 line: 
    + LoadModule rewrite_module modules/mod_rewrite.so
    + LoadModule proxy_module modules/mod_proxy.so
    + LoadModule proxy_http_module modules/mod_proxy_http.so

- Add bellow code to end of file httpd.conf: 
    <IfModule mod_proxy.c>
        ProxyRequests On
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyVia On
        ProxyPass / http://account.passio.local
        ProxyPassReverse / http://account.passio.local
        ProxyPreserveHost On
    </IfModule>
    
    Note: After 1 time of testing, comment 2 bellow line then project still work
    ProxyPass / http://account.passio.local
    ProxyPassReverse / http://account.passio.local
```

* B2: Open httpd-vhosts.conf file in path: C:\xampp\apache\conf\extra\httpd-vhosts.conf
```bash
Add code: 
<VirtualHost *:80>
    ProxyPreserveHost  On
    ProxyRequests Off

    <Location />
        ProxyPass http://localhost:3009/
        ProxyPassReverse http://localhost:3009/
    </Location>

    ServerName account.passio.local
    ServerAlias passio.local  
</VirtualHost>
```
	
* B3: Open hosts file in path: C:\Windows\System32\drivers\etc\hosts
```bash
Add code: 127.0.0.1	account.passio.local
```
* B4: 
    Restart lại xampp 
* B5: 
    Open git bash in project, run project with command: yarn run dev 
* B6: 
    Access domain in browser with address: http://account.passio.local
