php - Can't get MAMP working with Virtual hosts -
i’m having hard time getting multiple sites working mamp using virtual hosts. below have set on mba. if open web browser , go "http:local.login.dev" or "http://dev.login.localhost" (after reconfigure) index page that’s saved in /users/aaron/localhost. first item listed in virtual hosts section not index page saved in virtual host want to. other sites have setup give me same result.. "http:next.site.localhost" = displays index page in /users/aaron/localhost.
does have thoughts? final goal configure mamp virtual hosts work , test ssl.
bottom line seems first virtual host entry read , that's whats used every host listed. missing setting somewhere??
environment: - mba os x, yosemite
mamp 3.0.7.3 using ports 80, , 3306 http , mysql respectively
httpd.conf file: include /applications/mamp/conf/apache/extra/httpd-vhosts.conf
127.0.0.1 localhost 127.0.0.1 local.login.dev
<virtualhost *> documentroot "/users/aaron/localhost" servername localhost </virtualhost> <virtualhost *:80> — tried both , without :80 documentroot "/users/aaron/localhost/training/login/public" servername local.login.dev </virtualhost>
also tried configuring hosts , httpd-vhosts.conf way - post:
127.0.0.1 localhost 127.0.0.1 dev.login.localhost
<virtualhost *> documentroot "/users/aaron/localhost" servername localhost </virtualhost> <virtualhost *:80> documentroot "/users/aaron/localhost/training/login/public" servername dev.login.localhost serveralias dev.login.localhost <directory "/users/aaron/localhost/training/login/public"> allow allowoverride options -indexes +followsymlinks </directory> </virtualhost>
just playing around more commented out first "localhost" in httpd-vhosts.conf file , looks can navigate local sites correctly. below have configed..
httpd-vhosts.conf:
# <virtualhost *> # documentroot "/users/aaron/localhost/" # servername localhost # </virtualhost> <virtualhost *:80> documentroot "/users/aaron/localhost/training/login/public" servername dev.login.localhost serveralias dev.login.localhost </virtualhost> <virtualhost *:80> documentroot "/users/aaron/localhost/site1" servername dev.site1.localhost serveralias dev.site1.localhost </virtualhost> <virtualhost *:80> documentroot "/users/aaron/localhost/site2" servername dev.site2.localhost serveralias dev.site2.localhost </virtualhost>
hosts file:
127.0.0.1 localhost ######locahost dev sites 127.0.0.1 dev.login.localhost dev.site1.localhost dev.site2.localhost
now see if can ssl working.
if of incorrect, please allow me know... config way can virtual hosts working, of now, using port 80... if have issues mixing 443 i'll update
php web mamp virtual-hosts
No comments:
Post a Comment