From a live magento setup I made a tar.gz, moved that to an domains of another DirectAdmin user, extracted the tar.gz, copied the database, changed the URL of domain in the database. Front-end works good.
Backend gives me the following error:
Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.”
I already check the folder and file permission. Also tried to change the rights from the user:group settings with SSH access to the same user as the DirectAdmin user name. But that did not work either.
Note that this installation is on the same server as the live environment.
Live: (working) http://imageshack.us/photo/my-images/197/nrhj.png/
Test: (not working) http://imageshack.us/photo/my-images/542/uklz.png/
Specifically check the permissions on app/etc/local.xml as usually this means it is world readable.
Also, there is supposed to be a .htaccess file in app/etc/ that denies the contents from being served out by the web server. Check just in case your tar backup didn't include it. Usually this problem comes about from using an FTP client to do the transfer that has had hidden file visibility turned off.
For Apache 2.4.x you have to add Require all granted So it would look something like this:
<Directory /var/www/magento>
AllowOverride All
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>
Source: Apache: client denied by server configuration
Im using a Debian 7 with Apache 2.2.22 and Magento 1.9.1, adding
<Directory /var/www/magento/>
AllowOverride All
</Directory>
in /etc/apache2/sites-available/default
works for me
Similar to John Veldboom's answer I added this to /etc/apache2/apache2.conf since my magento install was in a different directory /var/www/html (eg. the directory path is wherever magento was extracted):
<Directory /var/www/html/>
AllowOverride All
Require all granted
</Directory>
With the following apache2 and ubuntu distro:
root#test-VirtualBox:/var/www/html# dpkg -l apache2 && lsb_release -a
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii apache2 2.4.7-1ubunt amd64 Apache HTTP Server
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
I had this issue on Debian and found my server-level site config (in /etc/apache2/sites-available/default) had AllowOverride None set. Changing that line to AllowOverride All fixed it.
Thanks Haselnussstrauch, your answer worked for me. My setting was in apache2.conf
sudo nano /etc/apache2/apache2.conf
Change the default AllowOverride None to AllowOverride All
<Directory /var/www/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Then restart Apache:
sudo service apache2 restart
Many other places suggest that you can block ip addresses to your server by adding this to your httpd.conf
<Location />
order allow,deny
allow from all
deny from aa.bb.cc.dd
</Location>
however this for some reason causes all other .htaccess files to be ignored, including .htaccess files that are in place to protect magento.
I have fixed issue, there is no .htaccess fine inside sub folder (especially app).
Related
I'm starting to learn how to set up a lamp on a vps, and i'm trying to run a laravel project.
This is my 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
Alias /laravelproject /var/www/laravelproject/public
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
I'm trying to access using the /laravelproject and it works cause i'm redirected to a login page ip/laravelproject/login (like I set using the middleware for not logged users and it works on my local homestead virtual machine). But i got a 404 file not found error. Not a pretty designed laravel one, but a raw and ugly server error
Not Found
The requested URL /laravelproject/login was not found on this server.
Apache/2.4.10 (Ubuntu) Server at '' Port 80
Of course i don't have any laravelproject.com domain to set up, i want to access it simply with my_server_ip/laravelproject.
How can i set up a virtualhost or an alias to run it with all the routes working?
You could also try enabling apache mod-rewrite if not enabled yet.
sudo a2enmod rewrite
sudo systemctl restart apache2
You'll need to make sure the /var/www/laravelproject/public directory is set to AllowOverride All (which I believe you have taken care of by setting /var/www to All). Then make sure the .htaccess file in your public directory is correctly set up: https://github.com/laravel/laravel/blob/master/public/.htaccess
this is because Apache is looking for /public/login/index.html which is not a file. Laravel's .htaccess redirects these requests appropriately, but it has to be in your public folder and Apache has to AllowOverride
edit:
<Directory /var/www/laravelproject/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
I know there are a lot of posts on this issue but none of them address the issue I'm having. I am trying to set up a virtual machine following a tutorial on Lynda.com.
Host is a Surface Pro 2 running Windows 10, guest is Virtual Box 5.0.4 with Ubuntu 14.04.3 LTS. People have had a lot of issues with VirtualBox on Windows 10 but mine installed just fine, I have made it all the way to installing Apache, MySQL etc and I'm able to access the Apache2 server status page on my local browser. I don't seem to be having any port issues and I've followed the tutorial's instructions which were step by step.
The issue I'm having is that I can't access the shared folder. I'm ready to configure PHP and I can't access a file placed in the shared folder, even though I've followed all the directions exactly. The shared folder shows up in the VM manager console with the correct path, but when I place a file in the shared folder and try to hit it through the browser on the host machine I get a 404 error. I've gone over the steps to configure the apache server several times, and it looks like I have everything correct:
**blakers**#sandbox:~$ cd /media/**sf_vbsandbox**
blakers#sandbox:/media/sf_vbsandbox$ id
uid=1000(blakers) gid=1000(blakers) groups=1000(blakers),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin), 109(sambashare),**999(vboxsf)**
blakers#sandbox:/media/sf_vbsandbox$ **getent group vboxsf
vboxsf:x:999:blakers,www-data**
This is from sites-available/vboxsf.conf:
<VirtualHost *:80 *:8282>
ServerName sandbox
ServerAlias *.dev
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/dev-error.log
CustomLog ${APACHE_LOG_DIR}/dev-access.log combined
RewriteEngine On
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /media/>
Order allow,deny
Allow from all
Require all granted
<Location /server-status>
SetHandler server-status
Order allow,deny
Allow from all
Require all granted
</Location>
UseCanonicalName Off
VirtualDocumentRoot /media/sf_%1
</VirtualHost>
Any help would be awesome!!
hi the problem is in this line :
VirtualDocumentRoot /media/sf_%1 , change this folder to be named like the folder that you are sharing. if its called "vbsandbox" then sf_vbsandbox.
you can confirm by:
ls -la /media/
then the folder name will be there.
you will have to restart apache at the end
sudo service apache2 restart
I have just been trying to setup a local apache server on osx. Everything was going well until I enabled vhosts.
When I navigate to a site setup in vhosts (local.dev) all I get is a 403 forbidden error saying you do not have permission to access / on this server.
The route of the site in question is '/www/local/public/'. The folder path exists and running apachectl -S and the syntax of the vhosts file was correct.
I have looked at the permissions of the folder and have even tried setting everyone to read and write, but no luck. I have set my permissions on the folder to read/write as well as permissions for the _www group.
If you have any ideas on where I am going wrong that would be much appreciated!
I have looked for a few answers on here but not been able to find anything that has worked for me.
Looking at the default document root for apache, the only permission I have missing on the /www/ folder is for an account called 'system'. I am unable to add this system account to the permissions of the folder as it does not appear in the get info option on the folder.
Thanks,
Joe
As with all of my questions it seems, I have found an answer!
I managed to get everything working smoothly by adding the following to my /private/etc/apache2/extra/httpd-vhosts.conf file inside of the <VirtualHost *:80> that was setup for local.dev
<Directory "/www/local/public">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
So the overall vhosts config for local.dev would look like the following:
<VirtualHost *:80>
DocumentRoot "/www/local/public"
ServerName local.dev
<Directory "/www/local/public">
... Above code here ...
</Directory>
</VirtualHost>
I added this, then restarted apache, and everything worked smoothly.
I have looked at many similar questions on SO such as this one and I can even solve my problem by making the changes in the global directory. However, I want to do the changes inside of the httpd-vhosts.conf file. Here is what I currently have:
<VirtualHost *:80>
ServerAdmin someEmail#gmail.com
DocumentRoot "c:/www/firstSite.dev"
<Directory "c:/www/firstSite.dev/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ServerName firstSite.dev
</VirtualHost>
However, I am still getting the error:
Forbidden
You don't have permission to access / on this server.
Any help would be appreciated.
You need to add your users explicitly in the httpd.conf file. The following line will do the trick
User daemon
Group daemon
User *user here*
If you happen to be on a linux distro that includes SELinux such as CentOS, you need to make sure SELinux permissions are set correctly for your document root files or you will get this error. On RedHat / CentOS / Scientific Linux this can be done by editing /etc/sysconfig/selinux - find the parameter "selinux" and change the option "enforcing" to "disabled":
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
Then reboot the server and test it out. If that solves it, you can either leave SELinux disabled, or configure SELinux so you can access your sites. Here is a good tutorial for configuring SELinux: http://beginlinux.com/server_training/web-server/976-apache-and-selinux
I'm running a XAMPP server on my laptop and I'm trying to setup a virtual host.
My hosts-file looks like this:
127.0.0.1 localhost
127.0.0.1 localhost.com
127.0.0.1 ehc.local
127.0.0.1 bal.local
The httpd-vhosts.conf file looks like this:
NameVirtualHost *:80
<VirtualHost ehc.local:80>
DocumentRoot "C:/wamp/EHC/src/main/php/www"
ServerName ehc.local
SetEnv APPLICATION_ENV "local"
<Directory "C:/wamp/EHC/src/main/php/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/ehc.dev-error_log"
CustomLog "logs/ehc.dev-access_log" common
</VirtualHost>
When I browse to 'ehc.local', I only get the default 403-error page.
How can I fix this?
Thanks!
This is for osx but must be the same (or similar) in windows:
Because Apache runs as the ‘nobody’ user by default, it may not have adequate permission to browse your [OSX/Win] user directory or some of its subdirectories, in which case you’ll see a 403 ‘access forbidden’ error when you try and view your development site. Similarly, you may find that although you can view your dev site, PHP throws errors when you attempt to write files or make directories on the filesystem.
To fix this you can configure Apache to run as your [OSX/Win] user. Open httpd.conf and look for the following lines:
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User nobody
Group nogroup
Change User to your [OSX/Win] username, and save the file:
User yourusername
Restart Apache and you should now be able to navigate your site without any issues, including manipulating files and folders using PHP.
Source
I Hope it will be helpful, Greetings!
Changing user didn't work.
For me it was this answer that did the trick:
Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)
Just add Require all granted to your <Directory> setup and it should work as expected.
you should try this:
-> go to XAMPP folder,
-> open apache-conf-extra folder
-> open httpd-xampp.conf with the text-editor of your choice
Scroll all the way down until you find Deny from all and change that too Allow from all