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

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?

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?

How to add a website to the Apache Web Server

I have installed a the following Drupal distribution on an Ubuntu virtual machine at /var/www/html.
https://www.drupal.org/project/social
The Composer script installs the project at /var/www/html/project-folder and index.php can be found in /var/www/html/project-folder/html.
Within the file /etc/apache2/sites-available/000-default.conf I have changed the document root to `/var/www/html/project-folder/html'.
Now when I visit the IP Address for the server, it does load the homepage of the PHP based website, but all of the links to other pages are broken, and none of the images can be found.
What is the correct way to add a new site to the Apache web server? Should a VirtualHost be used, or is it better to change the document root?
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html/project-folder/html
</VirtualHost>

Multiple web applications with Apache 2.4

I want to have two webapps (webapp1 and webapp2 resident under /var/www/html/webapps/), both using PHP and JSP, running on the same machine:
Apache 2.4
Tomcat 7.0.50 (+APJ connector)
and want to make them accessible through the following URLs (with identical IP and ports):
localhost/webapp1
localhost/webapp2
I am aware of Virtual Hosts facility. The problem is that Apache seems to "see" only the first site available: whenever I look for localhost/webapp2, I get a 'Not Found' error. Note that if I look for "localhost:8080/webapp2" (i.e., bypassing apache2) everything works fine.
Each webapp has its own conf file under sites-available directory. For example, in webapp2.conf I have
JkMountCopy On
JkMount /webapp2/* tomcat_worker
How can I solve?
From the documentation
Note
Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site. You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries.
Listen 80
Listen 8080
<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot "/www/domain-80"
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot "/www/domain-8080"
</VirtualHost>
<VirtualHost 172.20.30.40:80>
ServerName www.example.org
DocumentRoot "/www/otherdomain-80"
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example.org
DocumentRoot "/www/otherdomain-8080"
</VirtualHost>
If you want additional help, show us your configuration files related.

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.

Zend Http conf setting to Windows 7

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