Apache 2.4: How to allow access to a whole directory except a subdirectory in it - apache

I tried this in httpd.conf but it doesn't work, I still gives me access to the subfolder "report".
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Require all denied
</Directory>

You need Allow or Deny in the Directory.
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Allow from None
Order allow,deny
</Directory>
More details in the Apache docs: http://httpd.apache.org/docs/current/mod/mod_access_compat.html#allow

Related

Apache apache2.conf issue

I wantend to access two different version of my site(based on yii2 framework) via slash: http://url.com and http://url.com/something would bring me to another version.
For achieving this i took "something" directory and put it into "url" directory.
It was fine, but not exactly what i wanted, because it seemed like "something" part wasnt loading it's .css and scripts.
I went to apache2.conf file, and modified it -
before:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/bahruz/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
after:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/bahruz/www/etap/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
After i did this, https://url.com opens site without css and scripts and reverting apache2.conf doesn't help. I tried to restart the apache server, but it does not help.
Please, tell me why this happens and how can i bring everything back?
Thanks in advance.
I could not solve the issue, but restoring previous backup of the www helped. Maybe something happened with .htaccess, because sometimes it becomes invisible or smth.

Apache: Install Baikal besides Seafile

I need a hint in which direction I should look for an answer on this.
I have set up a Seafile server which is accessible under https://subdomain.no-ip.org, i now want baikal to be accessible under https://subdomain.no-ip.org/baikal
However, I can't get it running because i always get a message from Seafile that this directory does not exist. (I guess seafile thinks it should be a subdirectory)
my recent try to configure apache -
sites-enabled/default-ssl
<VirtualHost *:443>
ServerAdmin webmaster#localhost
Servername gasslnet.no-ip.org
DocumentRoot /var/www
Alias /media /home/andie/seafile-directory/seafile-server-latest/seahub$
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/baikal/html">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
My Seafile-Settings:
ccnet/ccnet.conf
SERVICE_URL = https://subdomain.no-ip.org
seahub_settings.py
FILE_SERVER_ROOT = 'http://subdomain.no-ip.org/seafhttp'
I think the issue is in the seafile configuration, if seafile would be accessible under url/seafile and not only the url the problem should be solved. I tried changing the SERVICE_URL, but no effect.
Do you have any ideas about this?
You have to set
SITE_ROOT = '/seafile'
in the seahub_settings.py to access Seafile under
http://subdomain.no-ip.org/seafile

Apache 2.4 upgrade

We have upgraded apache2.2 to 2.4 after upgrade siteminder advanced password cgi script is not working and it returning 503 service unavailable webpage. but the same script working via cli. Any idea ?
Alias /siteminderagent/pwcgi/ "/opt/siteminder/webagent/pw/"
<Directory "/opt/siteminder/webagent/pw/">
Options Indexes MultiViews ExecCGI
AllowOverride None
Require all granted
</Directory>
Alias /siteminderagent/pw/ "/opt/siteminder/webagent/pw/"
<Directory "/opt/siteminder/webagent/pw/">
Options Indexes MultiViews ExecCGI
AllowOverride None
Require all granted
</Directory>
Alias /siteminderagent/ "/opt/siteminder/webagent/samples/"
<Directory "/opt/siteminder/webagent/samples/">
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>

You don't have permission to access /files/theme/icons on this server

I've recently got an error on my site while trying to get Apaxy to work.
After a while I realized that the icons are not accessible. When I try to open them I get this error message:
Error
You don't have permission to access /files/theme/icons on this server.
This is a part of my apache2.conf (httpd.conf) and everything seems alright in it:
Code
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/>
AllowOverride All
Require all granted
</Directory>
I tried everything I found on SO but it didn't work.
I'm not overriding the permissions with any .htaccess file.
I'm running Apache 2.4.7
I solved this problem by changing permissions to read+execute.

Apache forbidden access

Here is a part of my httpd.conf file:
<Directory C:\wamp\www>
Options Indexes FollowSymLinks +ExecCGI
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
And the error log says:
client denied by server configuration: C:/wamp/www/Bugzilla
I try to access:
localhost/bugzilla
Try putting the following:
<Directory "C:\wamp\www">
Options Indexes FollowSymLinks +ExecCGI
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
Add this to its config:
Require all granted