I've installed Zend Framework, and I've created my project "zendy" to the path: D:\wamp\www\zendy. So I modified the file "httpd.conf" (I use WAMPSERVER) by adding:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
ServerName zendy
DocumentRoot D:\wamp\www\zendy\public
<Directory D:\wamp\www\zendy\public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
And then I restarted all the services of WAMPSERVER. I add a line "127.0.0.1 zendy" in the file C:\Windows\System32\divers\etc\hosts
Then I type "zendy/" or "localhost" in my navigator but it displays something like:
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request."
I totally follow the tutorial for installing zend frameline like :
http://www.youtube.com/watch?v=m7svJHmgJqs and http://framework.zend.com/manual/en/learning.quickstart.create-project.html
Who can help me?? Thanks a lot!!
Verify virtual configuration syntax using “httpd -S”
Also find something like this in httpd.conf and uncomment it by removing the preceding # sign before Include
#Virtual hosts
Include conf/extra/httpd-vhosts.conf
Please don't remove the # sign before Virtual hosts as depicted above.
Also, add
Options Indexes FollowSymLinks
before
AllowOverride All
and restart wamp
Here is the correct configuration:
<VirtualHost *:80>
ServerName zendy
DocumentRoot D:\wamp\www\zendy\public
</VirtualHost>
You do not need to mention directory under this.
Try and revert! :)
PS: Also, check for AllowOverride in your main httpd.conf or apache2.conf file. Hope it helps!
Related
im new to Zend Framework. Now i have to make some changes to an existing Zend Project. But on my local Xampp Installiation all links doesn't work.
I already set up a virtual host. Since then the Start page work correctly.
<VirtualHost *:80>
DocumentRoot "C:\xampp_54_zend\htdocs\myproject\public"
ServerName myproject
</VirtualHost>
But on every Link i get an error: "Link incorrect oder doesn't exist".
Edit: 404 Error
On the Live-Server everything works correctly.
What can i do to find the error and make the links working?
Try using below configuration:
<VirtualHost *:80>
ServerName myproject
DocumentRoot "C:/xampp_54_zend/htdocs/myproject/public"
DirectoryIndex index.htm index.html index.php
<Directory "C:/xampp_54_zend/htdocs/myproject/public">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
That is my iframe:
<iframe allowtransparency="true" class="igm" src="/flash/dewplayer-vol.xml&
amp;container=enterprise&view=default&lang=en&country=ALL&sanitize=0&
amp;v=cb90d5949f2275bc&up_CCOL=%23d1dae3&up_START=No&
amp;up_MP3=http://www.youtube-mp3.org/get?video_id=z0FERtqhwHs&
h=6a29a4973a0431d2638ba3f5a1aecfeb&r=1373776845504&up_LOOP=No&
amp;libs=analytics:core:flash&mid=55&rpctoken=-1666220716119396559"
frameborder="0" height="400" scrolling="yes" width="500"></iframe>
But when I open my page it appears:
Forbidden
You don't have permission to access /flash/dewplayer-vol.xml&container=enterprise&view=default&lang=en&country=ALL&sanitize=0&v=cb90d5949f2275bc&up_CCOL=#d1dae3&up_START=No&up_MP3=http://www.youtube-mp3.org/get on this server.
Apache/2.2.8 (Win32) PHP/5.2.6 Server at 212.43.43.254 Port 80
That is my httpd.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\AppServ\www\site\public
</VirtualHost>
<Directory "C:/AppServ/www/site/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
There some several step you have to follow in web server just go throw all this
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
And still you have more query then go to this LINK
Also
If you set up your virtual host the default way, i.e.
<VirtualHost *:80>
DocumentRoot "D:/Users/user/www/yourwebsite.dev/public"
ServerName .local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "D:/Users/user/www/yourwebsite.dev/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
You may access the public dir, by:
http://yourwebsite.dev/
and files in public dir by:
http://yourwebsite.dev/filename.ext
It is all about DocumentRoot.
i hope this will sure help you.
I have created zend application in /var/www/zendapp , but i have also installed mediawiki app
in /var/www/mediawiki
Now i want to access mediawiki app with http://mediawiki.local
and http://zendapp.local.
How can i do that?
I had couple of unsuccessful atempts. So far i edited /etc/hosts and added these two lines:
127.0.0.1 zendapp.local
127.0.0.1 mediawiki.local
I also created two files in /etc/apache2/sites-available/ :
zendapp
mediawiki
mediawiki :
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName mediawiki.local
DocumentRoot /var/www/mediawiki
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/mediawiki>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
zendapp :
ServerName zendapp.local
SetEnv APPLICATION_ENV "development"
DocumentRoot /var/www/zendapp/public
<Directory /var/www/zendapp/public>
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
But now it semes that only zendapp.local works, and if I go to :
http://mediawiki.local
it redirects me to http://zendapp.local/mediawiki/index.php/Main_Page
Do this: Separate virtualhost blocks:
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName mediawiki.local
DocumentRoot /var/www/mediawiki
#all other settings
.
.
.
</VirtualHost>
<VirtualHost *:80>
ServerName zendapp.local
DocumentRoot /var/www/zendapp/public
#all other settings
.
.
.
</VirtualHost>
Check out this blog, his answer worked!
http://justanswersnobullshit.wordpress.com/
I tried this out myself, after being frustrated by online video tutorials on how to setup multiple virtual hosts
And you do not accidentally forgot to include this site? That is, in the 'sites-enabled' directory should be by appropriate reference. Usually you should run the following commands:
sudo a2ensite host_name
sudo service apache2 reload
As a second variant, I can suppose, that 'DocumentRoot' should be ended by a slash:
DocumentRoot /var/www/zendapp/public/
I would like to protect a web folder via .htpasswd.
However, as the .htaccess file is under version control, I would prefer to not mess with it.
Instead, I would like to have the configuration in
/etc/apache2/sites-enabled/mysite
/etc/apache2/.htpasswd
Any idea what I need to put in the "mysite" apache configuration file?
So far it is sth like this,
<VirtualHost (ip address):80>
ServerName my.domain
DocumentRoot /var/sites/sitename
ServerAdmin ...
</VirtualHost>
Heureka, I figured it out myself.. or what I think to be the solution.
<VirtualHost (ip address):80>
ServerName my.domain
DocumentRoot /var/sites/sitename/
ServerAdmin ...
<Directory /var/sites/sitename/>
AuthUserFile /etc/apache2/.htpasswd
AuthGroupFile /dev/null
AuthName "What is the pw"
AuthType Basic
require user (username)
</Directory>
</VirtualHost>
The .htpasswd can be created in the usual way via commandline,
# htpasswd /etc/apache2/.htpasswd (username)
EDIT: anthony in the comment below strongly recommends you use https/SSL, to prevent the password from being sent unencrypted.
i want to install zend framework,i set my virtual hosts as the following :
Windows host setup :
127.0.0.6 nolanalg
xampp virtual host setup (httpd-vhosts.conf) :
NameVirtualHost 127.0.0.6
<VirtualHost 127.0.0.6>
DocumentRoot "C:/xampp/htdocs/nolanalg/public/"
ServerName nolanalg
</VirtualHost>
but i got an error!
it shows me this :
Server error! The server encountered
an internal error and was unable to
complete your request. Either the
server is overloaded or there was an
error in a CGI script. If you think
this is a server error, please contact
the webmaster.
Error 500 nolan
06/10/10 16:23:41 Apache/2.2.4 (Win32)
DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d
mod_autoindex_color PHP/5.2.1
my OS is windows 7,i had uninstall my antivirus,and turned off my windows firewall.
what is the problem?
i think you create your virtual host same following code in httpd-vhosts.conf
NameVirtualHost localhost:80
<VirtualHost mytest:80>
<Directory "C:/xampp/htdocs/mytest/public">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
DocumentRoot "C:/xampp/htdocs/mytest/public"
ServerName mytest
ServerAlias mytest
</VirtualHost>
so in c:\windows\system32\drivers\etc open host file
and add foloowing line
127.0.0.1 mytest
instead 127.0.0.1 enter your IP