Duplicated c:/Apache24/conf/original/extra/httpd-autoindex.conf wampserver - wampserver

Hello everyone I installed wampserver but I can't start the server the icon stay on orange in the logs directory there is no error log
only install.log
and there is the message
Installing Apache HTTP Server 2.x with
DomainName = example.com
ServerName = www.example.com
ServerAdmin = admin#example.com
ServerPort = 80
ServerSslPort = 443
ServerRoot = c:/Apache24
Rewrote docs/conf/extra/httpd-autoindex.conf.in
to c:/Apache24/conf/original/extra/httpd-autoindex.conf
Rewrote docs/conf/extra/httpd-default.conf.in
to c:/Apache24/conf/original/extra/httpd-default.conf
Rewrote docs/conf/extra/httpd-ssl.conf.in
to c:/Apache24/conf/original/extra/httpd-ssl.conf
Rewrote docs/conf/extra/httpd-multilang-errordoc.conf.in
to c:/Apache24/conf/original/extra/httpd-multilang-errordoc.conf
Rewrote docs/conf/extra/httpd-info.conf.in
to c:/Apache24/conf/original/extra/httpd-info.conf
Rewrote docs/conf/extra/httpd-userdir.conf.in
to c:/Apache24/conf/original/extra/httpd-userdir.conf
Rewrote docs/conf/extra/httpd-mpm.conf.in
to c:/Apache24/conf/original/extra/httpd-mpm.conf
Rewrote docs/conf/httpd.conf.in
to c:/Apache24/conf/original/httpd.conf
Rewrote docs/conf/extra/proxy-html.conf.in
to c:/Apache24/conf/original/extra/proxy-html.conf
Rewrote docs/conf/extra/httpd-vhosts.conf.in
to c:/Apache24/conf/original/extra/httpd-vhosts.conf
Rewrote docs/conf/extra/httpd-dav.conf.in
to c:/Apache24/conf/original/extra/httpd-dav.conf
Rewrote docs/conf/extra/httpd-languages.conf.in
to c:/Apache24/conf/original/extra/httpd-languages.conf
Rewrote docs/conf/extra/httpd-manual.conf.in
to c:/Apache24/conf/original/extra/httpd-manual.conf
Duplicated c:/Apache24/conf/original/extra/httpd-autoindex.conf
to c:/Apache24/conf/extra/httpd-autoindex.conf
Duplicated c:/Apache24/conf/original/extra/httpd-default.conf
to c:/Apache24/conf/extra/httpd-default.conf
Duplicated c:/Apache24/conf/original/extra/httpd-ssl.conf
to c:/Apache24/conf/extra/httpd-ssl.conf
Duplicated c:/Apache24/conf/original/extra/httpd-multilang-errordoc.conf
to c:/Apache24/conf/extra/httpd-multilang-errordoc.conf
Duplicated c:/Apache24/conf/original/extra/httpd-info.conf
to c:/Apache24/conf/extra/httpd-info.conf
Duplicated c:/Apache24/conf/original/extra/httpd-userdir.conf
to c:/Apache24/conf/extra/httpd-userdir.conf
Duplicated c:/Apache24/conf/original/extra/httpd-mpm.conf
to c:/Apache24/conf/extra/httpd-mpm.conf
Duplicated c:/Apache24/conf/original/httpd.conf
to c:/Apache24/conf/httpd.conf
Duplicated c:/Apache24/conf/original/magic
to c:/Apache24/conf/magic
Duplicated c:/Apache24/conf/original/charset.conv
to c:/Apache24/conf/charset.conv
Duplicated c:/Apache24/conf/original/extra/proxy-html.conf
to c:/Apache24/conf/extra/proxy-html.conf
Duplicated c:/Apache24/conf/original/extra/httpd-vhosts.conf
to c:/Apache24/conf/extra/httpd-vhosts.conf
Duplicated c:/Apache24/conf/original/extra/httpd-dav.conf
to c:/Apache24/conf/extra/httpd-dav.conf
Duplicated c:/Apache24/conf/original/mime.types
to c:/Apache24/conf/mime.types
Duplicated c:/Apache24/conf/original/extra/httpd-languages.conf
to c:/Apache24/conf/extra/httpd-languages.conf
Duplicated c:/Apache24/conf/original/extra/httpd-manual.conf
to c:/Apache24/conf/extra/httpd-manual.conf
I hade wamp 64 bit and removed it and install the 32 bits

Those are not messages from an install of WAMPServer. So I would assume that you had tried to install Apache manually but have not uninstalled it before installing WAMPServer.
So basically you have 2 Apache running and the original is probably set to start Automatically at boot time, so WAMPServers Apache cannot get to port 80 as the other Apache has already assigned it.
Uninstall the other Apache and WAMPServer will work.

Related

Wamp server 2.5 wrong page redirection

I installed wamp server 2.5 with PHP 5.5. Now, when i try to access my project pages from the front page(wamp home page), it redirect to a wrong url and shows google cannot find this page.
The problem definition is
I enter to wamp using http://localhost
There I have many project. Suppose I click on sample_project
Then the page redirects to sample_projects/
And Google Chrome displays the error chrome cannot find this webpage
There are two fields are swown red marks in my wamp PHP extensions area. They are php_enchant and php_opcache
What is the problem with my wamp??am I missing something? Help please
Honestly I think its highly inefficient to create Virtual Host for every.. single.. project. So after investigating I found a key variable in:
wamp/www/index.php.
After quick analysis, the variable's obvious purpose is to remove the 'localhost' in projects links.
Change this line:
$suppress_localhost = true;
To this:
$suppress_localhost = false;
WAMPServer 2.5 Homepage the Your Projects Menu and Virtual Hosts
There has been a change of concept in WampServer 2.5 and there is a good reason for this change!
In WampServer 2.5 it is now STRONGLY encouraged to create a Virtual Host for each of your projects, even if you hold then in a \wamp\www\subfolder structure.
Virtual Hosts Documentation
Virtual Host Examples
The WampServer home page ( \wamp\www\index.php ) now expects you to have created a Virtual Host for all your projects and will therefore work properly only if you do so.
History
In order to make life easier for beginners using WampServer to learn PHP Apache and MySQL it was suggested that you create subfolders under the \wamp\www\ folder.
wamp
|-- www
|-- Chapter1
|-- Chapter2
|-- etc
These subfolders would then show as links in the WampServer Homepage under a menu called 'Your Projects' and these links would contain a link to localhost/subfoldername.
Acceptable only for simple tutorials
This made life easy for the complete beginner, and was perfectly acceptable for example for those following tutorials to learn PHP coding.
However it was never intended for use when developing a real web site that you would later want to copy to your live hosted server.
In fact if you did use this mechanism it often caused problems as the live sites configuration would not match your development configuration.
The Problem for real website development.
The reason for this is of course that the default DocumentRoot setting for wamp is
DocumentRoot "c:/wamp/www/"
regardless of what your subfolder was called.
This ment that often used PHP code that queried the structure or your site received different information when running on your development WampServer to what it would receive when running on a live hosted server, where the DocumentRoot configuration points to the folder at the top of the website file hierarchy.
This kind of code exists in many frameworks and CMS's for example WordPress and Joomla etc.
For Example
Lets say we have a project called project1 held in wamp\www\project1 and run incorrectly as localhost/project1/index.php
This is what would be reported by some of the PHP command in question:
$_SERVER['HTTP_HOST'] = localhost
$_SERVER['SERVER_NAME'] = localhost
$_SERVER['DOCUMENT_ROOT'] = c:/wamp/www
Now if we had correctly defined that site using a Virtual Host definition and ran it as http://project1 the results on the WAMPServer devlopment site will match those received when on a live hosted environment.
$_SERVER['HTTP_HOST'] = project1
$_SERVER['SERVER_NAME'] = project1
$_SERVER['DOCUMENT_ROOT'] = c:/wamp/www/project1
Now this difference may seem trivial at first but if you were to use a framework like WordPress or one of the CMS's like Joomla for example, this can and does cause problems when you move your site to a live server.
How to create a Virtual Host in WampServer
Actually this should work basically the same for any wndows Apache server, with differences only in where you may find the Apache config files.
There are 3 steps to create your first Virtual Host in Apache, and only 2 if you already have one defined.
Create the Virtual Host definition(s)
Add your new domain name to the HOSTS file.
Uncomment the line in httpd.conf that includes the Virtual Hosts definition file.
Step 1, Create the Virtual Host definition(s)
Edit the file called httpd-hosts.conf which for WampServer lives in
\wamp\bin\apache\apache2.4.9\conf\extra\httpd-hosts.conf
(Apache version numbers may differ, engage brain before continuing)
If this is the first time you edit this file, remove the default example code, it is of no use.
I am assuming we want to create a definition for a site called project1 that lives in
\wamp\www\project1
Very important, first we must make sure that localhost still works so that is the first VHOST definition we will put in this file.
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
Now we define our project: and this of course you do for each of your projects as you start a new one.
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/project1"
ServerName project1
<Directory "c:/wamp/www/project1">
AllowOverride All
Require local
</Directory>
</VirtualHost>
NOTE: That each Virtual Host as its own DocumentRoot defined. There are also many other parameters you can add to a Virtual Hosts definition, check the Apache documentation.
Small aside
The way virtual hosts work in Apache: The first definition in this file will also be the default site, so should the domain name used in the browser not match any actually defined virtually hosted domain, making localhost the first domain in the file will therefore make it the site that is loaded if a hack attempt just uses your IP Address.
So if we ensure that the Apache security for this domain is ALWAYS SET TO
Require local
any casual hack from an external address will receive an error and not get into your PC, but should you misspell a domain you will be shown the WampServer homepage, because you are on the same PC as WampServer and therfore local.
Setp 2:
Add your new domain name to the HOSTS file.
Now we need to add the domain name that we have used in the Virtual Host definition to the HOSTS file so that windows knows where to find it. This is similiar to creating a DNS A record, but it is only visible in this case on this specific PC.
Edit C:\windows\system32\drivers\etc\hosts
The file has no extension and should remain that way. Watch out for notepad, as it may try and add a .txt extension if you have no better editor.
I suggest you download Notepad++, its free and a very good editor.
Also this is a protected file so you must edit it with administrator privileges, so launch you editor using the Run as Administrator menu option.
The hosts file should look like this when you have completed these edits
127.0.0.1 localhost
127.0.0.1 project1
::1 localhost
::1 project1
Note that you should have definitions in here for the IPV4 loopback address 127.0.0.1 and also the IPV6 loopback address ::1 as Apache is now IPV6 aware and the browser will use either IPV4 or IPV6 or both. I have no idea how it decides which to use, but it can use either if you have the IPV6 stack turned on, and most window OS's do as of XP SP3.
Now we must tell windows to refresh its domain name cache, so launch a command window again using the Run as Administrator menu option again, and do the following.
net stop dnscache
net start dnscache
This forces windows to clear its domain name cache and reload it, in reloading it will re-read the HOSTS file so now it knows about the domain project1.
Step 3: Uncomment the line in httpd.conf that includes the Virtual Hosts definition file.
Edit your httpd.conf, use the wampmanager.exe menus to make sure you edit the correct file.
Find this line in httpd.conf
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
And just remove the # to uncomment that line.
To activate this change in you running Apache we must now stop and restart the Apache service.
wampmanager.exe -> Apache -> Service -> Restart Service
Now if the WAMP icon in the system tray does not go GREEN again, it means you have probably done something wrong in the \wamp\bin\apache\apache2.4.9\conf\extra\httpd-hosts.conf file.
If so here is a useful mechanism to find out what is wrong. It uses a feature of the Apache exe (httpd.exe) to check its config files and report errors by filename and line numbers.
Launch a command window.
cd \wamp\bin\apache\apache2.4.9\bin
httpd -t
So fix the errors and retest again until you get the output
Syntax OK
Now there is one more thing.
There are actually 2 new menu items on the wampmanager menu system. One called [b]'My Projects'[/b] which is turned on by default.
And a second one, called [b]'My Virtual Hosts'[/b], which is not activated by default.
'My Projects' will list any sub directory of the \wamp\www directory and provide a link to launch the site in that sub directory.
As I said earlier, it launches 'project1` and not 'localhost/project1' so to make the link work we must create a Virtual Host definition to make this link actually launch that site in your browser, without the Virtual Host definition it's likely to launch a web search for the site name as a keyword or just return a site not found condition.
The 'My Virtual Hosts' menu item is a little different. It searches the file that is used to define Virtual Hosts ( we will get to that in a minute ) and creates menu links for each ServerName parameter it finds and creates a menu item for each one.
This may seem a little confusing as once we create a Virtual Host definition for the sub directories of the \wamp\www folder some items will appear on both of the 'My Projects' menu and the 'My Virtual Hosts' menu's.
How do I turn this other 'My Virtual Hosts' menu on?
Make a backup of the \wamp\wampmanager.tpl file, just in case you make a mistake, its a very important file.
Edit the \wamp\wampmanager.tpl
Find this parameter ;WAMPPROJECTSUBMENU, its in the '[Menu.Left]' section.
Add this new parameter ;WAMPVHOSTSUBMENU either before or after the ;WAMPPROJECTSUBMENU parameter.
Save the file.
Now right click the wampmanager icon, and select 'Refresh'. If this does not add the menu, 'exit' and restart wampmanager.
Big Note
The new menu will only appear if you already have some Virtual Hosts defined! Otherwise you will see no difference until you define a VHOST.
I can't believe that Wampserver now expects everyone to create a virtual host for every project under development offline on their laptops?
Your instructions seem to be very good but probably much too complicated for beginners (also, I suspect that the file path in your instructions for step2: adding the new domain to the HOSTS file only applies to 32-bit Windows)?
The solution from Rogue above (change $suppress_localhost="true"; to $suppress_localhost="false"; in c:/wamp/www/index.php) will work perfectly for 99% of the users who develop more than one website on their laptops.
Also uploading a completed website to an online server should not cause any real problems.
BUt perhaps Wampserver had another reason for adding the $suppress_localhost code?

Issue on Redirecting Projects on WampServer Index Page

Using WampServer 2.5 on Windows 7 Ultimate 64 bit I am not able to redirect from Wamp index page to Projects URL. For example, I have a Project called "Proj 1" which listed under "Your Projects" but when I click on that the address bar only change to
Proj 1
and I get this error message on page Oops! Google Chrome could not find Proj 1
and when I add localhost/ to the URL inbox it works fine. I tried to re install the Wamp several times but it didn't fix the issue.
Can you please let me know why this is happening and how I can fix this?
The QUICK AND DIRTY way to revert back to the old way and undo this new INTENDED functionality is:-
Edit \wamp\index.php
Find this line at aprox line 34
$suppress_localhost = true;
And change it to
$suppress_localhost = false;
CORRECT Solution
Is to create a VirtualHost for each of your projects that you want to store under the \wamp\www\ folder. Or anywhere else for that matter.
Edit the file \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
change version number to match your installed version of apache
Remove its default contents and add this to define your first VirtualHost definition
<VirtualHost *:80>
ServerName proj1
DocumentRoot C:/wamp/www/proj1
<Directory "C:/wamp/www/proj1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Save it!
Now edit the httpd.conf file ( using the wampmanager menu links ) and uncomment the line that includes the file we have just changed.
Find
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
And remove the # comment character like so :-
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Now edit the HOSTS file C:\windows\system32\drivers\etc\hosts and add a new line to tell windows that there is a site called proj1 so it should end up looking like this :-
127.0.0.1 localhost
::1 localhost
127.0.0.1 proj1
::1 proj1
Remember you have to be an Administrator to edit the hosts file!!! Hit the Windows key, type note, right click on Notepad and choose Run as Administrator.
Now to apply that change to the HOSTS file either reboot or
Start a command window using "Run as Administrator" and run these 2 commands :-
net stop Dnscache
net start Dnscache
This will refresh the windows DNS cache, and you new site will be addressable.
Now last of all restart the Apache service so it picks up your new VirtualHost definition.
wampmanager -> Apache -> Service -> Restart service
PS: Remove the space from the "proj 1" folder name. Spaces can cause odd issues. Remember Apache was ported from Unix and Unix does not really like spaces in directory names.
One option could be updating the www index.php (Line 338) from
$projectContents .= '<li>'.$file.'</li>';
to
$projectContents .= '<li>'.$file.'</li>';

403 Error after upgrading passenger (for nginx) is keeping me up at night...where did I go wrong?

I think I've read every question and answer on SO related to passenger/nginx and 403 errors, but none have lead me to a solution, so here I go...
I had Nginx (1.0.6) with Passenger (3.0.9) running beautifully for a rails app for many, many months with no real issues. Tonight I decided to upgrade from Passenger v3.0.9 to v3.0.12 to take advantage of a new feature. After running the install according to the provided instructions (using RVM), I went to the URL served by my rails app and got the dreaded 403 error. The nginx log file first had me thinking it was a permissions error:
directory index of "/home/SimfoUsers/public/" is forbidden, client: , server: , request: "GET / HTTP/1.1", host: ""
But after checking every possible permission, I no longer think that is the issue. I think the problem is actually that passenger is somehow not actually running, and the page is being served as a "normal" webpage by nginx. This is supported by the fact that if I add an index.html file to my rails public directory (/home/SimfoUsers/public/), nginx serves up this file as one would expect. Also, if I run passenger-memory-stats, ZERO passenger processes are running. Shouldn't nginx automatically spawn passenger processes whenever needed, or am I completely missing something here?
Here are the relevant parts of my nginx.conf file:
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p290#Simfo/gems/passenger-3.0.12;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p290#Simfo/ruby;
...
server {
listen 80;
server_name simfo.info www.simfo.info;
root /home/SimfoUsers/public;
passenger_enabled on;
}
}
Basically the only thing that I changed from my previously working config file is to update the passenger_root and passenger_ruby directives to reflect the new version of passenger (3.0.12). So if this is a config file issue, I'm really at a loss to understand it...
I'm not sure whether to just delete this question, or leave it in case it can save someone else the same frustration. This definitely is a face palm moment...
In desperation, I finally rebooted the server. After that, everything worked fine. It seems that at some point the passenger-related processes died and were not re-spawned automatically. One would think that after a fresh installation and reboot of nginx, passenger would be restarted, but apparentally this is not the case. My only advice to anyone having a similar problem is to issue a ps aux | grep passenger (or tasklist on Windows?). You should see one or two processes related to passenger. If not, then something strange is going on, and a reboot might help you as well.

Installing Zend Framework 2 in WAMP - localhost points to the same root as my Zend project

I am trying to learn about the Zend Framework and this is frustrating cause I can't even get to install the darn thing. :) So please help.
OP: Windows 7
Server: WAMP
I fould allot of documentation for Zend Framework 1 but not version 2 (which is the one I want).
Let me tell you what I did and what's the problem.
I have installed a working WAMP server, accessed from http://localhost
In the wamp's www, I have made a folder called "zendy" for the framework
I went to windows, system 32, drivers, etc and edited my host file. Here I have:
127.0.0.1 localhost
127.0.0.1 zendy # I have added this for my zend project
Then I went to httpd.conf and added this at the end:
ServerName zendy
DocumentRoot "C:\wamp\www\zendy"
I went to the Zend Framework 2 docs and downloaded the zend skeleton, pasted the contend inside my zendy folder. From the command line I typed:
"php composer.phar self-update"
"php composer.phar install"
Just like the zend framework 2 doc says.
The install worked ok and I saw this:
Installing dependencies from lock file
- Installing zendframework/zendframework (dev-master)
Cloning 18c8e223f070deb07c17543ed938b54542aa0ed8
Generating autoload files
Now, if I type http://zendy everything works ok but if I type http://localhost, I get the same zendy directory and I have lost access to my other php projects (non zend) which were in the www folder.
So basically: http://localhost goes to the same place as http://zendy (I have lost access to my localhost).
Any ideas on what is wrong?
You need to add your localhost as well as your other projects to the virtual hosts file.
<VirtualHost *:80>
DocumentRoot "C:\serverpath\htdocs"
ServerName localhost
</VirtualHost>

Redmine doesn't work properly in Apache

I'm trying to get Redmine (a Ruby on Rails app) working. It works fine when started with ruby script/server webrick -e production, however, I'm having trouble getting it working in Apache with Passenger.
Accessing http://example.com/redmine returns the Redmine home page, but clicking any link (or even adding a / to the URL) results in a 404. According to the Rails log, a RoutingError occurs. For example, when opening the projects page: ActionController::RoutingError (No route matches "/projects.html" with {:method=>:get})
The Redmine directory is /var/www/localhost/htapps/redmine. I followed the documentation at http://www.modrails.org/documentation/Users%20guide.html#_deploying_a_ruby_on_rails_application (section 3.2), so there's a symlink at /var/www/localhost/htdocs/redmine pointing to ../htapps/redmine/public, and the Apache configuration contains DocumentRoot /var/www/localhost/htdocs and RailsBaseURI /redmine.
What is causing it to raise these RoutingErrors?
It looks like this issue was actually caused by the default .htaccess included with Redmine.
Redmine's .htaccess rewrites every request to end with .html. Redmine's routes expect .html-less requests.
Setting RewriteEngine to Off solved the issue for me.
http://ptspts.blogspot.com/2009/05/how-to-fix-railsbaseuri-sub-uri-with.html
The manual workaround (according to what is suggested on the pages above) is adding the line below to config/environments/production.rb:
config.action_controller.relative_url_root = '/redmine'
If not deploying to a Sub-URI and deploying using passenger, adding the rule RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] to your public/.htaccess also solves the issue. As that rule is IfModule-ed out in the default .htaccess.
Another option is to delete .htaccess if you're not using it (As an example you may be using it for additional layer authentication with AuthType Digest etc). It is not required when deploying with passenger.
Even if you will manage to run Redmine in suburi, redmine still will have issues.
Some pages won't be parsed and displayed correctly, if displayed at all.
This issue is almost one year old and indicated for next minor release. Btw dozen minor releases came out, but it's not yet fixed. FCGI mode does not support sub-URI.

Resources