I already install zend framework and i used wamp server to let it works then in httpconfig i inserted
NameVirtualHost 127.0.0.1
DocumentRoot "C:\Workspace\zendy\public"
ServerName zendy
<Directory "C:\Workspace\zendy\public">
Options FollowSymLinks
AllowOverride AuthConfig Limit Indexes
Order allow,deny
Allow from all
</Directory>
after restarting wamp server ... the below message appears
Internal Server Error
i know the error in virtualhost. however, i couldn't solve the problem
You can enable rewrite module directly by clicking wamp tray icon and going into Apache settings. Like example below.
If you still find some problems you may need to add zendy server name to your system C:\Windows\System32\drivers\etc\hosts file:
127.0.0.1 zendy
Also you must uncomment vhosts in Apache httpd.conf:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Hope that helps!
just look into Apache Error Log, you should see what exactly caused Internal Server Error there
Related
I configured zend framework 3 through composer on remote debian server. I added virtual host to etc/apache2/sites-available/mysite.conf like below but it shows just "It works!" page instead of zf3 public. Do anyone knows hos to solve it?
<VirtualHost *:80>
ServerName zfapp.localhost
DocumentRoot /var/www/mysite/skeleton-application/public
<Directory /var/www/mysite/skeleton-application/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
Check the following:
Have you enabled the site on the remote Debian server. To enable the site you should use a2ensite mysite
The ServerName directive should correspond the the HTTP hostname in the HTTP request. When you are dereferencing a URL on the remote server, the hostname part in the browser should correspond with the ServerName. It is unlikely you are using zfapp.localhost since most OS's have reserved host entries of 127.0.0.1 for any localhost derivative.
I am trying to move a live wordpress website to a local site on my computer so that I can make changes and try things out without messing up the live site. I am using WAMP on a Win7 PC.
I went through all the steps...installed WAMP and downloaded my Wordpress files and my database file, put the wordpress files in the D:/wamp/www/site-name folder, I created a new database in phpadmin with the same name as my downloaded datebase, and imported my database, then I updated the URLS inside the database from http://www.site-name.org to localhost/site-name using the sql queries, then I updated the database name, username and password in the wp-config.pho file to reflect what is being used on the localhost versus the live site, then because I was using apache 2.4.x, I went to create a virtual host for my wordpress site because the localhost option was suppressed in the httpd.config file...and from what I gathered, the newer version is made to use virtual host, so I was attempting to do that, instead of unsupressing the localhost option.
So, I went to the the c/windows.system32/drivers/etc/hosts file and added the following
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
# site-name name resolution
127.0.0.1 site_name #local version of website
::1 site_name
( note I had already checked the httpd.config file, and this line was already active:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Then, I went to the httpd-vhost.conf file and added in my new virtual host:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
#
<VirtualHost *:80>
ServerName site_name
ServerAlias site_name
DocumentRoot D:/wamp/www/site_name
<Directory "D:/wamp/www/site_name">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
However, after saving that, and restarting WAMP services, I continue to get an error for Site_name under Virtual host, that says: The ServerName site_name has syntax error in file D:/wamp/bin/apache/apache2.4.23/conf/extra/httpd-vhosts.conf.
I have looked over the above code in the httpd-vhosts.conf for the site_name server, but can't find any syntax errors. The localhost virtual host works, and from what I can tell, the syntax for the site_name server is the same.
I tried running httpd.exe in the apache folder to see if it would give me more details on the syntax error, but I can't get it to run when double clicking on it, and I wasn't sure how to run it from the cmd prompt...I tried, but I kept getting some kind of socket error.
Thank you for the help.
Can someone please help be figure out what might be happening. What am I missing something?
You can't use underscore in host name.
I know this question has been asked a lot of times
I followed Most of the answers in the internet But I still get the same Message
403 Forbidden
You don't have permission to access / on this server.
It is weird that when I access using the same PC to localhost:1234 it runs normally but if I access using my IP address 192.168.0.188:1234
Also which is really weird is that I tried to install WAMP on other PC and without any configuration I could access to that PC.
So I thought it's because McAfee and Firewall so I open port on Widows and McAfee and nothing changed also I turned off Firewall and still nothing change.
Then for no reason I opened port through the Router “port forwarding” and still nothing changed.
I don't think that it's because my configuration in WAMP since I am still able to get this 403 Forbidden Message and also by using other PC without any configuration I could access it.
Both PCs are setup like this:
Windows 8 Pro
WAMP Wampserver: 2.4
Apache Version: 2.4.4
PHP Version: 5.4.12
MySQL Version: 5.6.12
The accessible PC uses Microsoft Security Essentials.
The inaccessible PC uses McAfee Internet Security.
I tried to turn off WAMP and start IIS For Microsoft Server (I works perfectly From any PC) but WAMP is still not not working
I followed these tutorial:
How to Access WAMP Server in LAN or WAN
Install & Setup Virtual Host Guide for WAMP
Install & Setup LAN & Worldwide Access Guide for WAMP
And the Stack Overflow answers here:
Cannot access wamp server on local network
WAMP 403 Forbidden message on Windows 7
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
By default Wampserver comes configured as securely as it can, so Apache is set to only allow access from the machine running wamp. Afterall it is supposed to be a development server and not a live server.
Also there was a little error released with WAMPServer 2.4 where it used the old Apache 2.2 syntax instead of the new Apache 2.4 syntax for access rights.
You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.
Change this section from :
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
To :
# onlineoffline tag - don't remove
Require local
Require ip 192.168.0
The Require local allows access from these ip's 127.0.0.1 & localhost & ::1.
The statement Require ip 192.168.0 will allow you to access the Apache server from any ip on your internal network. Also it will allow access using the server mechines actual ip address from the server machine, as you are trying to do.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so you have to make the access privilage amendements in the Virtual Host definition config file
First dont amend the httpd.conf file at all, leave it as you found it.
Using the menus, edit the httpd-vhosts.conf file.
It should look like this :
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Amend it to
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.
Dont forget to restart Apache after making this change
For Apache 2.4.9
in addition, look at the httpd-vhosts.conf file in C:\wamp\bin\apache\apache2.4.9\conf\extra
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Change to:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
changing from "Require local" to "Require all granted" solved the error 403 in my local network
I got this answer from here. and its works for me
Require local
Change to
Require all granted
Order Deny,Allow
Allow from all
To expand on RiggsFolly’s answer—or for anyone who is facing the same issue but is using Apache 2.2 or below—this format should work well:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from localhost
Allow from 192.168
Allow from 10
Satisfy Any
For more details on the format changes for Apache 2.4, the official Upgrading to 2.2 from 2.4 page is pretty clear & concise. Key point being:
The old access control idioms should be replaced by the new
authentication mechanisms, although for compatibility with old
configurations, the new module mod_access_compat is provided.
Which means, system admins around the world don’t necessarily have to panic about changing Apache 2.2 configs to be 2.4 compliant just yet.
For those who may be running WAMP 3.1.4 with Apache 2.4.35 on Windows 10 (64-bit)
If you're having issues with external devices connecting to your localhost, and receiving a 403 Forbidden error, it may be an issue with your httpd.conf and the httpd-vhosts.conf files and the "Require local" line they both have within them.
[Before] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local <--- This is the offending line.
</Directory>
</VirtualHost>
[After] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
</Directory>
</VirtualHost>
Additionally, you'll need to update your httpd.conf file as follows:
[Before] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
Require local #<--- This is the offending line.
</Directory>
[After] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
# Require local
</Directory>
Make sure to restart your WAMP server via (System tray at bottom-right of screen --> left-click WAMP icon --> "Restart all Services").
Then refresh your machine's browser on localhost to ensure you've still got proper connectivity there, and then refresh your other external devices that you were previously attempting to connect.
Disclaimer: If you're in a corporate setting, this is untested from a security perspective; please ensure you're keenly aware of your local development environment's access protocols before implementing any sweeping changes.
In order for me to be able to run a Zend Framework project on my local development machine, I made changes to Apache's \etc\apache2\httpd.conf and the openSUSE system's \etc\hosts files. I set up a test3.local alias for an individual Zend project, and things seem to "work".
Before I started fiddling with things, I could access phpMyAdmin simply by entering http://localhost/phpMyAdmin/ in my browser. And if I take away my changes, that once again works.
Using this answer as a basis, I tried to set up an additional virtual host specifically for phpMyAdmin, hoping to "solve" this problem. But right now if key in the virtual host name, admin.local, that I intend to take me to phpMyAdmin, I get a 403 error like this:
(source: willmatheson.com)
Here is my present httpd.conf:
### Virtual server configuration ############################################
IncludeOptional /etc/apache2/vhosts.d/*.conf
<VirtualHost *:80>
ServerName test3.local
DocumentRoot /home/william/public_html/ZendTest3/public
SetEnv APPLICATION_ENV "development"
<Directory /home/william/public_html/ZendTest3/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName admin.local
DocumentRoot /var/lib/mysql/phpMyAdmin
# This gives permission to serve the directory
<Directory /var/lib/mysql/phpMyAdmin>
DirectoryIndex index.php
Options None
AllowOverride All
# This allows eveyone to access phpmyadmin, which you may not want
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
and hosts:
127.0.0.1 localhost
127.0.0.1 local
127.0.0.1 test3.local
127.0.0.1 admin.local
Ideally I'd like to not have to specify a virtual host for phpMyAdmin at all, because I'm sure to muck it up, and just somehow have the settings to make the Zend project work but to also have phpMyAdmin work like it did before.
I know this question was already answered, but I thought I'd share what I did to overcome a similar problem, in case it helps anyone else.
My problem was:
I started to get localhost/phpmyadmin 404 error after changing the DocumentRoot folder in httpd.conf. The change I made was to change the DocumentRoot
from:
DocumentRoot "C:\Program Files (x86)\Zend\Apache2/htdocs"
to:
DocumentRoot "C:\Program Files (x86)\Zend\Apache2/htdocs/a/deeper/folder"
I fixed it by changing a line in zend.conf
from:
Alias /phpMyAdmin "C:\Program Files (x86)\Zend\phpMyAdmin"
to:
Alias /phpMyAdmin "C:\Program Files (x86)\Zend\ZendServer\data\apps\http\__default__\0\phpMyAdmin\4.0.5.4_41"
Hope this helps somebody else!
Well, there's a good reason I was getting a 403 - I was digging in the wrong place. My installation of phpMyAdmin was actually in /srv/www/htdocs/phpMyAdmin. Changed that, restarted Apache (sudo systemctl restart apache2.service) and things seem to work.
If you're interested in how the heck to find files and folders on openSUSE, the following steps worked for me:
sudo zypper install findutils-locate
su
updatedb (go check your e-mail)
locate phpMyAdmin (like that, not 'phpmyadmin')
Greetings experts and gurus, I am looking for some help with an apache php configuration problem.
I have been running several websites from an apache2 setup on an ubuntu server for some time now without problems using the line NameVirtualHost * in my etc/apache2/conf.d/virtual.conf file. I recently updated the server version to the latest lts version and I am now unable to run php files.
I am running all my sites for the location "/home/www/[site-name]/htdocs" and I have setup and enabled all my sites in /etc/apache2/sites-available. I have also disabled the default site.
for each sites file I have specified the following:
# Indexes + Directory Root.
# DirectoryIndex index.html index.htm index.php
DocumentRoot /home/www/[site-name]/htdocs/
# CGI Directory
ScriptAlias /cgi-bin/ /home/www/[site-name]/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog /home/www/[site-name]/logs/error.log
CustomLog /home/www/[site-name]/logs/access.log combined
I restart apache and enter the url for a php test page on my server and I am met with an "Internal Server Error". When I check the error log I get:
Script "/home/www/[site-name]/htdocs/test.php" resolving to "/home/www/[site-name]/htdocs/test.php" not within configured docroot.
For some reason when looking into the error, suphp came up a lot. According to this link:
Don't be fooled into thiking this has anything to do with the Apche virtual host document root, this is actually another setting in the suphp config file. Including the paths which contained the RoundCube scripts fixed this one. For example:
docroot=/var/www:/usr/share/roundcube:/var/lib/roundcube:${HOME}/public_html
You need to edit your /etc/suphp/suphp.conf file and change the docroot to whatever is appropriate.
It looks you missed the virtual hosts configuration for every site name:
<VirtualHost IP:80>
ServerName yourdomainname
ServerAlias www.yourdomainname
DocumentRoot /home/www/[site-name]/htdocs/
ScriptAlias /cgi-bin/ /home/www/[site-name]/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
ErrorLog /home/www/[site-name]/logs/yourdomainname.ua-error.log
CustomLog /home/www/[site-name]/logs/yourdomainname-access.log combined
</VirtualHost>
<Directory "/home/www/[site-name]/htdocs/">
Options FollowSymLinks
AllowOverride None
Order allow,deny
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
Thanks for all the help, I got there in the end. It seems that upgrading to Ubuntu 10.04 turned on suPHP. It has ended up being a good thing as the reason why I was getting errors was down to file management in my htdocs getting sloppy.
To fix my issues I had to do several things:
First I turned on suphp error messages in /etc/apache2/sites-available/[site-name]. This gave me the true error, which told me that some of my pages had the wrong permissions. I then set all my folder permissions in www to 755 and the files to 644. I also had to lower the min_uid and min_gid fileds in suphp.conf to 33.