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
Related
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. : /
I have set up a new virtual host on WAMP Server version 3.0.6 which contains a dot in the name (specifically bowla300.local)
My vhosts.conf file is configured to call it bowla300.local, as is also my hosts file. When I restart WAMP the localhost page shows this name correctly in both the Your Projects and Your Virtual Hosts columns and the links work as expected. So far so good... But on the Your Virtual Hosts menu from the main WAMP server the server name appears only as bowla300 without the .local at the end and the link does not work. I don't know what I need to change to correct this. It is possible that I initially set the site name up incorrectly without the ".local" but having subsequently revisited vhosts.conf the name is now definitely correct and the fact it appears correct on the localhost page also suggests it is valid. Any ideas why the menu entry may not be including the ".local"?
I attach my vshosts entries as below (which I admit I did hand edit as I have only just noticed the option on the local host page to create a virtual host that way):-
<VirtualHost *:8080>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8080>
ServerName bowla300.local
DocumentRoot "c:/wamp64/www/bowla300.local"
<Directory "c:/wamp64/www/bowla300.local/">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
The problem resolved itself after a clean reboot. Restarting WAMP was not sufficient but restarting the operating system fixed it.
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.
I have installed the Skeleton Application manually. My application is kept in "D:\xampp\htdocs\zf2". I've created a virtual host in the following way, in httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerName zf2
DocumentRoot "D:/xampp/htdocs/zf2/public/index.php"
<Directory "D:/xampp/htdocs/zf2/public/index.php">
#DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
but it does not shown properly and it gives the output
and the remain ing application with module and database shows also not shows in the proper way
but if i slightly modify in virtual host settings of
DocumentRoot "D:/xampp/htdocs/zf2/public/index.php"
to
DocumentRoot "D:/xampp/htdocs/zf2/public"
then, skeleton application shows fine but when i configure module and database it gives 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. zend sleleton application error"
can any one help me i have waste lot of time to set it but didn't.
You need to set document root to the folder not a file. The page looks messed up when pointing to index.php as documentroot because it cannot find the stylesheets.
The issue with configuring the module/database is probably a different issue, and you would have to post your module/database configuration to get help there.
This one has got me stumped. I'm deploying a Rails 3 app to Slicehost running Apache 2 and Passenger. My server is running Ruby 1.9.1 using RVM.
I am receiving a permission denied error on the "public" folder in my app. My Virtual Host is setup as follows:
<VirtualHost *:80>
ServerName sharerplane.com
ServerAlias www.sharerplane.com
ServerAlias *.sharerplane.com
DocumentRoot /home/robinjfisher/public_html/sharerplane.com/current/public/
<Directory "/home/robinjfisher/public_html/sharerplane.com/public/">
AllowOverride all
Options -MultiViews
Order allow,deny
Allow from all
</Directory>
PassengerDefaultUser robinjfisher
</VirtualHost>
I've tried the following things: trailing slash on public; no trailing slash on public; PassengerUserSwitching on and off; PassengerDefaultUser set and not set; with and without the block.
The public folder is owned by robinjfisher:www-data and Passenger is running as robinjfisher so I can't see why there are permission issues.
Does anybody have any thoughts?
Thanks
Robin
PS. Have disabled the site for the time being to avoid indexing so what is there currently is not the site in question.
Check your actual home directory. /home/robinjfisher to ensure its "other" executable bit is set. I.e., the dir has permissions of NN1 or higher where N is whatever you like (i.e., 751 or 701).
I found the problem. I had moved some js/css files relating to a plugin and the plugin was then trying to reinstall them as it couldn't find them where it thought they should be.
I commented out the installation code and it works fine now.
Robin