Zend Http conf setting to Windows 7 - apache

I'm following Zend beginner tutorial. In that actually following need to be setup in the local server Apache httpd.conf in Linux PC.
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/usr/local/apache/htdocs/square/public"
ServerName square.localhost
</VirtualHost>
But I've a Windows 7 installed with Xampp in my local. Could anyone please help me on this how to put this in my local httpd.conf file.

Change DocumentRoot "/usr/local/apache/htdocs/square/public" to a public folder of your project. For example, to "C:\XAMPP\www\square\public" or wherever your project's public folder is located.
Also make sure you have this line in your hosts file : 127.0.0.1 localhost

Related

XAMPP Virtual Host cant find?

I'm trying to set up a local development environment for a PHP project. The project is placed in the htdocs folder, and i wanna be able to access it on a virtual host environment so all the links and so on works, and treats it as the root directory.
So, here is what i have done:
C:\Windows\System32\drivers\etc
hosts
127.0.0.1 bakeboss.test
C:\xampp\apache\conf\extra
httpd-vhosts
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\bakeboss"
ServerName bakeboss.test
<Directory "C:\xampp\htdocs\bakeboss">
</Directory>
</VirtualHost>
Apache starts up fine, but if i try to go to (in my browser):
www.bakeboss.test
NOTHING happens - cannot find it, cannot connect. If i go to localhost/bakeboss it works, but obviously not the way i want it.
What am i missing here?

Virtual host will NOT work in MAMP but works on localhost:8888

Created a new Laravel project in htdocs in MAMP. Followed all the steps, added virtual hosts, changed conf file, etc/hosts, restarted mamp and my pc several times but I just can't get my virtual host to run.
however, when I am in the MAMP Dashboard I can navigate to my website -> website -> public and the default Laravel boilerplate page appears.
Has anyone had this issues with MAMP before? I gave up with XAMPP and Valet so it's my last chance here..
Specs
High Sierra 10.13.5 on 2015 MBP,
Composer version 1.6.5,
php 7.2.7
httpd.conf
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
httpd-vhosts
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /Applications/MAMP/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "Applications/MAMP/htdocs/website/public"
ServerName website.dev
</VirtualHost>
etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
#255.255.255.255 broadcasthost
#::1 localhost
127.0.0.1 website.dev
website.dev is technically a public url, so the browser is looking for it on the internet I guess. I was trapped once in this dreadful situation. changing the name to something like website.local should solve your issue. It did for me.

Windows 10 apache virtual host config

I'm new to laravel. Using version 5.1. Trying to use laravel app as virtualhost. For this I've changed my httpd-vhosts.conf as below
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\practice\laraveldev/public"
ServerName laraveldev
</VirtualHost>
Now trying to access the app in browser laraveldev or http://laraveldev but not working.
You should also make changes in Hosts file to make it work (C:\Windows\System32\drivers\etc\hosts).
Does localhost:80 works (do you see 'Laravel 5' page)?

Setting up virtual host on XAMPP

I've installed XAMPP on Ubuntu in '/opt/lampp' directory and would like to set up some VirtualHosts. Apache Virtual Host tutorial instructs to place
<VirtualHost *:80>
...
</VirtualHost>
code in '/etc/apache2/sites-available/[virtualhostname].conf'. The problem is that I don't have 'apache2' folder in '/etc'. I also don't have 'sites-available' directory in '/opt/lampp/apache2'.
I have '/opt/lampp/etc/httpd.conf' and '/opt/lampp/etc/extra/httpd-vhosts.conf' files though. Which ones shall I use to set the VH up?
You should use /opt/lampp/etc/extra/httpd-vhosts.conf, but before you should add your servername to your .hosts file and uncomment inclusion of of the httpd-vhosts.conf in the /opt/lampp/etc/httpd.conf.

How to add a virtual host on a folder that is located on another computer?

I have Zend Server installed on my machine (windows 7 home edition) and I´m trying to set up a virtual host on a folder that is located in our server. For some reasons, I can't set an apache web server in there, so it must be done in my own computer.
But I can't get it done. My virtual host setup in httpd-vhosts.conf is like this:
<VirtualHost *:8081>
ServerAdmin web#web.com.br
DocumentRoot "\Data\Websites\Online\TheClientName\Site"
ServerName clientname.local
ServerAlias clientname.local
ErrorLog "logs/clientname.log"
</VirtualHost>
And the hosts file:
172.17.10.1/Data/Websites/Online/TheClientName/Site clientname.local
I have checked the Apache log. There's a Warning:
Warning: DocumentRoot [C:/Data/Websites/Online/TheClientName/Site] does not exist
I got full access to this folder, and I have it mapped like a local drive. I tried to set the DocumentRoot as follows, but no luck; Apache does not restarts after setting the 'Z:\'.
"Z:\Data\Websites\Online\TheClientName\Site"
I wonder if there is a way to point this v-host to server folder. Any ideas?