Wednesday, March 16, 2016

make alias to setup VirtualHosts using XAMPP on MacOSX (Simple way)

Simple & Quick

Add these following lines in ~/.bash_profile file

1)  alias goextra='cd /Applications/xampp/xamppfiles/etc/extra'
2). alias editvhost='sublime httpd-vhosts.conf'

and run " . ~/.bash_profile " .

and please run goextra and editvhost in your terminal respectively.

When you run editvhost httpd-vhosts.conf will be opened.

Add following lines to the file. You can also use the dummy lines in the file as reference.

<VirtualHost *:80>
    ServerName dummy.local
    DocumentRoot "/Users/You/Your_Projects/dummyproject"
    <Directory "/Users/You/Your_Projects/dummyproject">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    ErrorLog "logs/dummy.local-error_log"

3). alias edithost='sudo sublime /etc/hosts'

Add following line in #Virtual Hosts section of the hosts file.
# Virtual Hosts dummy.local

Restart your Apache on xampp.

You are good to go. 

If you have any question or better way to do this or to share your ideas, please leave a comment or send me an email at or tweet me @lynnnayko

Thank you very much for your time.

No comments: