Setup zend skeleton application - apache

I am trying to setup the zend skeleton application in my Windows 10 machine. However, since port 80 was not available, I am trying to configure on port 8080. But every time I do not get the zend skeleton page. I only get the apache page that says "It works". Pls suggest what I am doing wrong.
In apache httpd.conf, I made below changes:
Listen 8080
ServerName localhost:8080
In httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "${SRVROOT}/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<VirtualHost *:8080>
ServerName zendskeleton.localhost
DocumentRoot C:/zendskeleton/public
SetEnv APPLICATION_ENV "development"
<Directory C:/zendskeleton/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
In Windows hosts file:
127.0.0.1 zendskeleton.localhost localhost

Related

You don't have permission to access / on this server when I activate Virtual host in WAMP server

I'm trying to setup a virtual host on my server. I'm in windows server 2012. When I activate the vhost by uncomment the line Include conf/extra/httpd-vhosts.conf , I get this error:
You don't have permission to access / on this server
This is my httpd-vhosts.conf file
<VirtualHost *:80>
ServerAdmin webmaster#homemail.net
DocumentRoot "e:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "e:/wamp/www">
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from 127.0.0.0 localhost ::1
</IfDefine>
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "e:/wamp/www/test"
ServerName test.com
ErrorLog "logs/test-error.log"
CustomLog "logs/test-access.log" common
</VirtualHost>
Edit
After an day of trying to fix this problem, is this my current httpd-vhosts.conf file:
NameVirtualHost localhost
<VirtualHost localhost>
DocumentRoot E:/wamp/www/
ServerName localhost
</VirtualHost>
NameVirtualHost itp-recouvrement.bnpparibas
<VirtualHost test>
DocumentRoot E:/wamp/www/test/
ServerName exemple.fr
ServerAlias www.exemple.fr
ErrorLog "logs/test.log"
CustomLog "logs/test.log" common
<Directory />
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
</Directory>
</VirtualHost>
This is working locally, but not when I access the server from an another PC, I have same error before

Fedora Apache: VirtualHost not picking up DirectoryIndex

I am having a problem with virtualhosting on my fedora 18 box.
http://127.0.0.1 works correctly and brings up index.html
http://127.0.0.1:9000 also works correctly.
http://localhost works
http://localhost:9000 does NOT work.
It just redirects to http://localhost
Why is not able to treat localhost and 127.0.0.1 the same way?
Here is the contents of my httpd-vhosts.conf:
Thanks in advance.
Listen 9000
DirectoryIndex index.html welcome.html
NameVirtualHost *:80
NameVirtualHost *:9000
<VirtualHost *:80>
ServerName saraslights
ServerAdmin ratteri#gmail.com
ServerAlias saraslights
DocumentRoot "/var/www/html/opencart"
ErrorLog "logs/saraslights-errors.log"
CustomLog "logs/saraslights-access.log" common
</VirtualHost>
<VirtualHost *:9000>
ServerName wordpress
ServerAdmin ratteri#gmail.com
ServerAlias wordpress
DocumentRoot /var/www/html/wordpress
ErrorLog "logs/wordpress-errors.log"
CustomLog "logs/wordpress-access.log" common
</VirtualHost>

How to enable multiple domains and or subdomains with apache httpd server

I'm trying to enable multiple domains in my environment Development, but am not succeeding the way I tried below, at which point I'm wrong?
I installed httpd and changed DocumentRoot in httpd.conf to:
C:/Webserver/www
*I changed the Windows hosts file to(in Italics would like to access):
If I switch to 127.0.0.1 api.rotadorock the address resolves to www/ but the right is www/rotadorock/api.
127.0.0.1 localhost
127.0.0.1 webserver
127.0.0.1/rotadorock/ecommerce rotadorock
127.0.0.1/rotadorock/api api.rotadorock
127.0.0.1/rotadorock/ecommerce ecommerce.rotadorock
127.0.0.1/rotadorock/mobile mobile.rotadorock
127.0.0.1/rotadorock/sistema sistema.rotadorock
127.0.0.1/rotadorock/social social.rotadorock
*Update(windows hosts file)
I removed the hosts file changes I mentioned above, because as #Volker Birk said are not necessary. But even so, still can not access as desire (api.rotadorock/ or localhost/api.rotadorock/ and should point to C:/Webserver/www/rotadorock/api). What could be wrong?
And finally changed httpd-vhost.conf for:
NameVirtualHost webserver:80
<Directory "C:/Webserver/www">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/Webserver/www"
ServerAlias localhost
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerName webserver
DocumentRoot "c:/Webserver/www"
ServerAlias webserver
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost rotadorock:80>
ServerName rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/ecommerce"
ServerAlias rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost api.rotadorock:80>
ServerName api.rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/api"
ServerAlias api.rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost ecommerce.rotadorock:80>
ServerName ecommerce.rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/ecommerce"
ServerAlias ecommerce.rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost mobile.rotadorock:80>
ServerName mobile.rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/mobile"
ServerAlias mobile.rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost sistema.rotadorock:80>
ServerName sistema.rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/sistema"
ServerAlias sistema.rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
<VirtualHost social.rotadorock:80>
ServerName social.rotadorock
DocumentRoot "c:/Webserver/www/rotadorock/social"
ServerAlias social.rotadorock
ErrorLog "logs/httpd-error.log"
CustomLog "logs/httpd-access.log" common
</VirtualHost>
You don't need the hosts file. Have a look into the documentation:
http://httpd.apache.org/docs/2.2/en/vhosts/name-based.html
Finally solved the problem. And I could just using the Windows hosts file and httpd-vhosts.conf httpd together.
Let me give an example of what was done to enable multiple subdomains accessing locally.
On Windows hosts file to add, for each domain and subdomain you want something like this:
127.0.0.1 api.rotadorock #my subdomain
127.0.0.1 rotadorock #my domain
And then the httpd-vhosts apache httpd:
# Accessing the API
<VirtualHost 127.0.0.1>
DocumentRoot "C:/Webserver/www/rotadorock/api"
ServerName api.rotadorock
ServerAlias ​​api.rotadorock
<Directory "C:/Webserver/www/rotadorock/api">
All Options Includes Indexes
</ Directory>
</VirtualHost>
# Accessing the domain
<VirtualHost 127.0.0.1>
DocumentRoot "C:/Webserver/www/rotadorock/"
ServerName rotadorock
ServerAlias ​​*.rotadorock
<Directory "C:/Webserver/www/rotadorock/">
All Options Includes Indexes
</Directory>
</VirtualHost>
And then that way I could access api.rotadorock/ and rotadorock/ locally. I tried all ways without the hosts file. But just gotta use it. If someone can explain to me how it should have done so it would not need to use the hosts I would be grateful.

Apache virtual-host not working correctly for subdomain

I've got a site set up on localhost that I'm actively developing, and I'd like to set up a subdomain on localhost to make my life 10* easier.
I added this to C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost i1.localhost:80>
ServerAdmin dummy#localhost
DocumentRoot "C:/xampp/htdocs/i1/"
ServerName i1.localhost
ServerAlias www.i1.localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
Apache stats up fine, but when I navigate to http://localhost/ I'm seeing content from the i1 subdomain. http://i1.localhost/ works fine, however.
Then I tried doing this:
<VirtualHost localhost:80>
ServerAdmin dummy#localhost
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
ServerAlias www.localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
<VirtualHost i1.localhost:80>
ServerAdmin dummy#localhost
DocumentRoot "C:/xampp/htdocs/i1/"
ServerName i1.localhost
ServerAlias www.i1.localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
But that worked the opposite. On both localhost and i1.localhost I'm seeing content from C:/xampp/htdocs/.
Anyone got an idea what's going wrong?
Cheers.
Apache usually does not like a vhosts document root inside another vhost, try:
DocumentRoot "C:/xampp/htdocs/"
and
DocumentRoot "C:/xampp/i1/"

Multiple-domains on WAMP localhost

If you're reading my question, thanks, I appreciate your help
I'm using Wamp on Windows Vista.
I've created 2 project folders:
www/project1/
www/project2/
My virtual hosts file looks like this:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project1/"
ServerName project1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project2/"
ServerName project2.com
</VirtualHost>
Can someone advise how I can go about doing this?
You need to specify ServerName in VirtualHost like this (and additionally ServerAlias) for each hostname:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.localhost
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host1.localhost"
ServerAlias *.first.com first.com
ServerName www.first.com
ErrorLog "logs/dummy-host1.localhost-error.log"
CustomLog "logs/dummy-host1.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.localhost
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
ServerAlias *.second.com second.com
ServerName www.second.com
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
Here is a full tutorial, hope it helps. Let me know if you run into any problems.
http://kintek.com.au/blog/configuring-multiple-domains-within-wamp-for-local-development/