Wamp server localhost error - wampserver

All my services of WAMP server are running, but when I opened my http://localhost/ it gives me this error
"HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory."

You are getting this error because listing directory contents is disabled. Something like this can be found in the apache config file httpd.conf:
Options -Indexes
The reason you're seeing this is probably because of one of two reasons:
You haven't got an index page (index.php or index.html usually)
You have got an index page but your settings are incorrect
Check your apache config for something like this:
DirectoryIndex index.html index.php
Your directory index should list the name(s) of the file(s) that you want to use as the index page. Cross reference the two and you should be able to get it working.
Finally, make sure you always run httpd -t to test your apache configuration after making changes, prior to restarting it.

Change the content of c:\wamp\alias\phpmyadmin.conf file to the following.
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
And Restart your Apache server after making these changes.

Related

Overwhelmed with Apache mod passenger / Ruby on Rails

i tried to migrate a ruby on rails project from a server to another.
Everything is pretty much working. Now only mod passenger and apache gives me big problems.
Just as a not - i set the following command else i couldnt start apache "a2enmod mod_access_compat"
Now here is my config file:
LoadModule passenger_module /home/homeuser/.rvm/gems/ruby-2.1.10/gems/passenger-4.0.41/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/homeuser/.rvm/gems/ruby-2.1.10/gems/passenger-4.0.41
PassengerDefaultRuby /home/homeuser/.rvm/gems/ruby-2.1.10/wrappers/ruby
</IfModule>
ServerAdmin ME
ServerName server.ip
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#DocumentRoot /srv/www/vhosts/default/
DocumentRoot /home/homeuser/projectx/public/
# if not specified, the global error log is used
ErrorLog /var/log/apache2/error_log
CustomLog /var/log/apache2/access_log combined
# don't loose time with IP address lookups
HostnameLookups Off
# needed for named virtual hosts
UseCanonicalName Off
# configures the footer on server-generated documents
ServerSignature On
#ScriptAlias /cgi-bin/ "/srv/www/vhosts/default/cgi-bin/"
#<Directory "/srv/www/vhosts/default/cgi-bin">
# AllowOverride None
# Options +ExecCGI -Includes
# Order allow,deny
# Allow from all
#</Directory>
<Directory "/home/homeuser/projectx/public/">
#
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Options Multiviews Indexes
RailsEnv development
</Directory>
</VirtualHost>
Now the problem.
On my other server i can just call the IP of the server, and the rails installation just opens fine.
Here is just goes into the "public" directory and indexes me all its contents.
I know a fix where you can alter the routes within the routes config file:
get '/something', to: 'start#index'
Now i can reach the website via browser if i type the adress:
server.ip/something
But like i said - i need a pretty much identical version.
So what i need is being able to reach the site via:
server.ip and not server.ip/something
Any help appreciated. Me and my collegues are going crazy about this :-).
EDIT:As an answer to #Aakash Gupta-
Actually "something" is just any string i set in the routes file so i can enter the webapp via browser. What i want instead is to enter the webapp just by typing the pure IP of the server into the browser. Without the "something". So lets make an example: If i type into the browser: www.website.com - it doesnt work. But if i set a route in the routes file, as shown above, i can enter the site by e.g. www.website/start.com or www.website/whatever.com. But i really dont want to have to type something after the url as it has effects on other stuff. So i just want to type in the pure domain/ server address which would be website.com. And then the webapp should appear - but instead i just get shown the contents of the public folder, as there is no index file inside. But on my other server mod passenger is clever enough to still start the webapp, even if i set the public folder is a document root. Hope that clarifies my problem. Like i said - i didnt have problems on other servers. : /

Tomcat7 / Apache2 URL Wildcard Mapping

I have a Java Servlet that takes the path of a provided URL request and retrieves database resources from it. For example:
www.mydomain.com/gateway/databasename/tablename
Would retrieve information from the specified table, all nice and REST like. This works just fine on a localhost Tomcat7 server on Windows and Netbeans, but I'm having trouble deploying it on an Apache2 web server running Ubuntu.
This is what my VirtualHost file looks like:
<VirtualHost *:80>
ServerAdmin andrew#mydomain.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /var/www/wordpress
<Directory />
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Alias /manager /usr/share/tomcat7-admin/manager
<Directory "/usr/share/tomcat7-admin/manager">
Options FollowSymLinks
AllowOverride None
Allow from all
</Directory>
JkMount /gateway* ajp13_worker
JkMount /manager* ajp13_worker
JkMount /host-manager* ajp13_worker
ErrorLog ${APACHE_LOG_DIR}/wordpress_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I'm able to navigate to www.mydomain.com/gateway and view the index page for the servlet. If I go to www.mydomain.com/gateway/databasename, I get a 404 error from Tomcat saying the requested resource is unavailable.
However! If I go to www.mydomain.com/gateway/gateway, I then get my servlet's response that "gateway" is an invalid database name.
So I think the problem is somewhere in the VirtualHost file and mapping the URL. Anything at www.mydomain.com/gateway/gateway/* works, but www.mydomain.com/gateway/* does not.
Also the servlet mapping for my deployment's web.xml is correct:
<servlet-mapping>
<servlet-name>Gateway</servlet-name>
<url-pattern>/gateway/*</url-pattern>
</servlet-mapping>
And the mod-jk's worker.properties file looks right:
worker.list=ajp13_worker
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
I'm not sure where I'm going wrong, and I know it's going to be something obvious. If anyone can help me out, I'd greatly appreciate it!
My guess is that Tomcat is serving the webapp at the / (root) context path when you run it from Netbeans, and the server is serving it at the /gateway context path.
So from Netbeans the base webapp path is: /hostname
But on the server it is: /hostname/gateway
Since the URL pattern of your servlet is /gateway/*, the result is that on the server you have to add an additional /gateway.
To fix it for the server, you need to change the URL pattern of your servlet to /* instead of /gateway/*
Then to make it work again from Netbeans, you need to change the context path from /ROOT to /gateway. I'm not familiar with Netbeans, but from a quick googling you need to right click your webapp go to Properties -> Run, and there you should be able to change the Context Path.

Changing the root directory in WAMP

I'm looking to change the root directory to point the directory to the following location:
C:\Documents and Settings\User\My Documents[documents]\wamp
I know that I have to change the apache http.conf file in the following lines
DocumentRoot "c:/Documents and Settings/User/My Documents/[documents]/"
However, it seems that the square brackets besides [documents] are causing the Forbidden Error to be displayed:
Forbidden
You don't have permission to access /login/ on this server.
Is there any way to use square brackets in the directory tree? [documents] is named for a particular purpose, and it needs to stay that way. Otherwise, I will need to do alot of recoding.
What are the rules if any when pointing to a directory tree?
Thanks in advance.
I was getting same forbidden error (In windows machine for wamp), after lot of r & d I found that there is need to change default virtual host in httpd-vhosts.conf file which is present in:
C:\wamp\bin\apache\Apache2.2.17\conf\extra
(change directory c:/wamp/www to what you want)
From :
ServerAdmin webmaster#localhost
DocumentRoot “c:/wamp/www”
ServerName localhost
ErrorLog “logs/localhost-error.log”
CustomLog “logs/localhost-access.log” common
To:
ServerAdmin webmaster#localhost
DocumentRoot “E:/wamp/www”
ServerName localhost
ErrorLog “logs/localhost-error.log”
CustomLog “logs/localhost-access.log” common
Right click your folder, select properties, then go to security tab. Edit proper permission for that folder so that apache user can have permission to access that folder.
I have tested that scenario in my system and DocumentRoot folder with bracket inside the name can work without problem.
Just in case someone comes across this as I did.
I had permissions problems on the parent folder of the directory I was trying to set as the DocumentRoot.
I found allowing the SYSTEM user Full Control privileges fixed the problem.
If you have permission problems (403 denied), and you are using newer WAPMs, e.g.
-wampserver2.5 with
-Apache-2.4.9
-Mysql-5.6.17
-php5.5.12-64b
you may want to check httpd.conf code (ca #240):
AllowOverride none
Require all denied
and change it to:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Also, you may want to: take a look at this

Rails not rendering assets over SSL (404 Not Found error)

I am kind of new to Rails and am struggling with an issue that is preventing my assets to be found if I try to access my test app using an SSL connection.
As an example of what I am referring to, if you try to access
http://domain.com/testapp the default rails page loads fine and I have no issues at all.
You can also access a page I created using this route
http://domain.com/testapp/static_pages/home
However the same address, if accessed via HTTPS is returning 404 errors for all of my assets. I am also unable to access any routes (they all return 404).
https://domain.com/testapp
https://domain.com/testapp/static_pages/home
I am currently using an Apache server with Passenger installed, and here is what my virtual host configuration looks like:
<Directory /var/www/testapp/public>
PassengerEnabled on
PassengerAppRoot /var/www/testapp
RailsBaseURI /testapp
</Directory>
Any ideas of why this might be happening?
Thanks,
Rog
Thanks all, I finally figured out what was going on so in the interest of others having the same issue, the virtual host configuration was only being applied to the default port (80) so I had to specify port 443 as well.
<VirtualHost *:80 *:443>
<Directory /var/www/testapp/public>
PassengerEnabled on
PassengerAppRoot /var/www/testapp
RailsBaseURI /testapp
</Directory>
</VirtualHost>
For people using Media Temple's DV server, this configurations has to be specified in two separate files (make sure you remove the VirtualHost tags).
vhost.conf
vhost_ssl.conf
And don't forget to restart apache.
/usr/sbin/apachectl -K graceful

When deploying a Rails 3 app with Capistrano 2.5.19, what should be in shared/system?

I am running Passenger with Apache2 on Ubuntu. I'm trying to get an idea what I should be looking at, and my suspicion lies with my Capistrano configuration / permissions.
My application seems to be deployed to current as expected. I can see all the project files. I see a symlink in the current/public directory to shared/system. When I look at the contents of shared/system, there is nothing, no symlink or files. Is this correct? Is a symlink missing?
Capistrano deployment file:
https://github.com/danieldbower/passhasher/blob/master/config/deploy.rb
Logged message in Apache:
Apache/2.2.16 (Ubuntu) Phusion_Passenger/3.0.2 mod_ssl/2.2.16 OpenSSL/0.9.8o configured -- resuming normal operations
Directory index forbidden by Options directive: /var/www/passhasher/
Apache Config:
Alias /passhasher /var/www-rails/passhasher/current/public
<Directory /var/www-rails/passhasher/current/public>
AllowOverride all
Options -MultiViews
</Directory>
This is the default folder in which you keep all files not related to a particular version of your deployment.
I put the users' uploads inside.
Have a look here:
http://blog.alastairdawson.com/2007/03/13/stop-uploaded-files-getting-deleted-with-capistrano/

Resources