I have installed the Zend framework. However, when I try to set up the virtual host - apache.
localhost doesn't work.its execute zend folder.its out side of wamp folder.
What have I done:
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include "c:/wamp/alias/*"
NameVirtualHost localhost
<VirtualHost *:80>
DocumentRoot "C:/websites/zendy/public"
ServerName zendy
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "C:/websites/zendy/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "C:/wamp/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
how to work this two virtual hosts?
Related
I have unizped codeigniter on /var/www/control_cuotas indx.php is placed on that folder and I settrd up a new virtualhost on apache on the 000-default.conf file whith this code
<VirtualHost *:81>
<Directory /var/www/control_cuotas>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/control_cuotas
ServerAlias www.control_cuotas.test
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
But I cannot acces to localhost:81 its Unable to connect and the serve rwas restarted before I tried to access
For example:
<VirtualHost *:80>
ServerName your_project
DocumentRoot "C:/wamp64/www/your_project"
<Directory "C:/wamp64/www/your_project/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Let's try one more time.
Make sure all your VirtualHosts define a ServerName. Failure to do so will mean trouble as you add more hosts.
<VirtualHost *:80>
DocumentRoot /var/www/control_cuotas
ServerName control_cuotas.test
ServerAlias www.control_cuotas.test
ServerAdmin webmaster#localhost
<Directory /var/www/control_cuotas>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Don't forget to enable the above config in Apache adding it to the sites-enabled list. Then restart Apache.
The file /etc/hosts should look like this at a minimum
127.0.0.1 localhost
127.0.0.1 control_cuotas.test
127.0.0.1 www.control_cuotas.test
Other VHosts should also be represented in this file.
You can also add entries for ipV6 if you want, but it is not a requirement in most cases. (The main case is that you have disabled communication using ipV4.)
<VirtualHost *:80>
DocumentRoot "D:/projects/RnD"
ServerName dev.ei-rnd.loc
<Directory "D:/projects/RnD">
Options FollowSymLinks
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
Apache : 2.2.17
I have written above code to configure virtualhost in newly installed wamp. It gives me 403 error when dev.ei-rnd.loc hit on browser.
Please Note:
Already tried below options
uncomment Include conf/extra/httpd-vhosts.conf
Solution
<VirtualHost *:80>
DocumentRoot "D:/projects/RnD"
ServerName dev.ei-rnd.loc
<Directory "D:/projects/RnD">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
Created a instance in aws with ubuntu 14:04 server, installed and configured my apache2 virtual hosts as follows:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName magento.com
ServerAlias www.magento.com
DocumentRoot /var/www/magento.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/magento.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<VirtualHost>
and
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName recomendador.com
ServerAlias www.recomendador.com
DocumentRoot /var/www/recomendador.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/recomendador.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<VirtualHost>
My files are in:
/var/www/magento.com/public_html/
/var/www/recomendador.com/public_html/
My /etc/hosts :
127.0.0.1 localhost
127.0.0.1 magento.com
127.0.0.1 recomendador.com
When I access my aws:
http://meu_ip/
Opens magento, when I access:
http://meu_ip/recomendador.com
or
http://meu_ip/www.recomendador.com
Appears was not found on this server.
If I type:
http://meu_ip/magento.com
or
http://meu_ip/www.magento.com
That is, it seems he only recognizes the magento and still no use ServerName or ServerAlias.
I enabled both the a2ensite
Anyone know what might be wrong?
Thanks
I followed this guide and managed to make Python with a Django installation work perfectly, but it seems to have rendered all the locally hosted PHP sites inaccessible returning a 404 error.
httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
#This is placed right after the rule for <Directory "f:/WAMP/www/">
<Directory "f:/WAMP/www/python">
Options ExecCGI
AddHandler wsgi-script .py
Order allow,deny
Allow from all
</Directory>
#This is placed at the end of the file
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include "f:/WAMP/alias/*"
Include "F:/WAMP/www/python/sandbox/apache/apache_django_wsgi.conf"
apache_django_wsgi.conf
Alias /python/images/ "F:/WAMP/www/python/sandbox/images"
<Directory "F:/WAMP/www/python/sandbox/images">
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /python "F:/WAMP/www/python/sandbox/apache/django.wsgi"
<Directory "F:/WAMP/www/python/sandbox/apache">
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot f:/WAMP/www/python/sandbox/
ServerName 127.0.0.1
</VirtualHost>
django.wsgi
import os, sys
sys.path.append('F:/WAMP/www/python/sandbox')
os.environ['DJANGO_SETTINGS_MODULE'] = 'sandbox.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
PHP only renders when I comment out the lastline from httpd.conf.
You need to have another virtual host if you're going to set the DocumentRoot:
# This is for PHP
<VirtualHost *:80>
DocumentRoot f:/WAMP/www/
ServerName local.php.dev
</VirtualHost>
# This is for your Django stuff
<VirtualHost *:80>
DocumentRoot f:/WAMP/www/python/sandbox/
ServerName local.py.dev
</VirtualHost>
Otherwise, as it is now, all the local requests are being sent to the python sandbox.
Note that you'll need to have several hosts pointing locally.
I have installed zendserver and it is running on http://localhost:81/.
Now I have created zend framework 2 project in Apache2/htdocs/zend2 and accessing this through http://localhost:81/zend2/public.
I have to set virtual host for this like zend.local but it is not working.
In httpd.conf file
NameVirtualHost *:81
<VirtualHost *:81>
<Directory "C:\Program Files/Zend/Apache2/htdocs/zend2/public">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DocumentRoot C:\Program Files/Zend/Apache2/htdocs/zend2/public/
ServerName zend.local
ServerAlias zend.local
</VirtualHost>
and In hosts file
127.0.0.1 zend.local
I have tried all possibilities but nothing works.
I recommend installing ubuntu for development i dont see how your doing it on windows and how it doesn’t annoy you.
try this:
make a copy of the default portion and just add ServerName Zend.local then modify the paths and that should work. You might also want to try restarting the computer that sometimes makes it work (rare occasions)
here is a copy of mine that works but its under ubuntu so it might or might not work for you.
<VirtualHost *:80>
#ZEND-{354B5BC7F803049AB79DE95C47F32B59}
Include "/usr/local/zend/etc/sites.d/zend-default-vhost-80.conf"
#ZEND-{354B5BC7F803049AB79DE95C47F32B59}
ServerAdmin webmaster#localhost
ServerName zendapp.dev
DocumentRoot /var/www/vhosts/zendapp/public
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/vhosts/zendapp/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
#ZEND-{90331A19916187EEA0C9B3A8FE0E1632}
Include "/usr/local/zend/etc/sites.d/globals-*.conf"
Include "/usr/local/zend/etc/sites.d/vhost_*.conf"
#ZEND-{90331A19916187EEA0C9B3A8FE0E1632}