AH01630: client denied by server configuration - server

I am assuming that I have tried all possible solutions mentioned here, but I am still unable to fix the problem.
The problem is with the httpd.conf and .htaccess files.
If I run tail -f access.log I get :
AH01630: client denied by server configuration: /opt/rpkica/share/rpki/wsgi/rpki.wsgi
This is the configuration I'm using :
<Directory /opt/rpkica/share/rpki/wsgi>
Order allow,deny
AllowOverride All
Allow from All
#Require all granted
</Directory>

Try to find .htaccess file recursively from "document root" for that virtual host. .htacces have a precedence over main configuration so check if you have deny configuration in any .htaccess file.

you need to check httpd.conf file
<Directory /path/to/directory>
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
If you may get an error on XAMPP server, open httpd-xampp.conf file under the path /opt/lampp/etc/extra
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
# Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Just command the "Require local" then restart your lampp service
# /opt/lampp/lampp restart

Related

TYPO3 all pages return page not found errors except the Home page

I have installed TYPO3 9.5.27 Locally.
All pages Except the Root Page showing the following error
Image
Not Found
The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at t3v9.local Port 80
Why this is happening? Anybody please help me?
Please check, that your apache has enabled mod_rewrite and that the TYPO3 default .htaccess file (see typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess for recommended example) is located in the document root.
Finally, I found the answer.
Here in apache2.conf in /etc/apache2 change
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
to
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Where will be the myserver.conf, hosts, and ports.conf in cPanel/WHM?

I want to customize my client's site with virtual host block. Manually I did this request on the Ubuntu server 18.04. But now I have the cPanel and the WHM access.
I read these official links.
Modify Apache Virtual Hosts with Include Files
Modify Virtualhost Containers With Include Files
But I messed regrading the include files and those directories as,
/usr/local/apache/conf/userdata/ssl/2_2/$user/$domain/$includename.conf
and
/etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf
And the following scripts
To rebuild the httpd.conf file, run the following script:
/usr/local/cpanel/scripts/rebuildhttpdconf
To restart Apache, run the following script:
/usr/local/cpanel/scripts/restartsrv_httpd
Please clearly tell how can I merge this to be put using cPanel and WHM.
vhost
<VirtualHost *:9876>
ServerName 139.59.xxx.xxx
DocumentRoot /home/username/newfile/doneapi/public
<Directory /home/username/newfile/doneapi/public>
AllowOverride All
</Directory>
</VirtualHost>
hosts file
127.0.0.1 139.59.xxx.xxx
ports.conf
Listen 9876
Thanks in advance

ngrok setup with travis ci gives 404 error

I am trying to tunnel the localhost in travis ci with ngrok. So far I have been able to expose the site, but unfortunately any curl request to a simple text file gives me 404 error. Only index pages are visible/downloadable. How can I configure it, so that files can be downloaded.
This is my virtual host config:
<VirtualHost *:80>
DocumentRoot $1
<Directory $1>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
DirectoryIndex index.php index.html
</VirtualHost>
$1 is the random subdomain name given by ngrok (I am storing the virtual host config as a string) .
This is the /etc/hosts file at some point:
127.0.0.1 a3a1a93a.ngrok.io
127.0.0.1 8dbc2f3e.ngrok.io
## cookbook:: travis_build_environment
## file:: templates/default/etc/cloud/templates/hosts.tmpl.erb
127.0.1.1 testing-gce-478a98cf-1fda-48f0-9b75-4c72e55e1305 testing-gce-478a98cf-1fda-48f0-9b75-4c72e55e1305 ip4-loopback trusty64
The first two entries are the tunneled subdomains by ngrok.

/phppgadmin Forbidden You don't have permission to access /phppgadmin/ on this server

I recently upgrade my server from Debian Wheezy to Debian Jessie (Debian 8).
A lot of packages was updated and now, I don't have the right to access to phppgadmin from http://myIP/phppgadmin
Forbidden
You don't have permission to access /phppgadmin/ on this server.
I try a lot of thinks to solve the problem but absolutely nothing works...
In /etc/apache2/conf.d/phppgadmin:
Alias /phppgadmin /usr/share/phppgadmin
<Directory /usr/share/phppgadmin>
DirectoryIndex index.php
AllowOverride None
order allow,deny
# deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
In /etc/apache2/sites-enabled/000-default.conf I add:
<Directory /usr/share/phppgadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I try to change the permissions of /usr/share/phppgadmin/, /var/www...
And I have the same message even if I uninstall the package phpgpadmin !
apt-get remove phppgadmin
Big thanks for help...
In Debian 8, apache2 configurations are now in /etc/apache2/conf-available and soft-linked from /etc/apache2/conf-enabled when enabled, just like virtualhosts or modules.
The phppgadmin package in its latest version comes with a predefined configuration file:
/etc/apache2/conf-available/phppgadmin.conf
This configuration should be activated by default, but otherwise it can be activated with a2enconf phppgadmin
Your old configuration /etc/apache2/conf.d/phppgadmin should be removed as well as the mentioned addition in /etc/apache2/sites-enabled/000-default.conf.
Then edit phppgadmin.conf and remove the Require local directive that you don't want if you previously had Allow from all.
you can easily solve this problem by replacing Require local directive to Allow from all in configuration file /etc/apache2/conf-available/phppgadmin.conf

Forbidden: CGI Programming With Apache and Perl on Mac OS X

I'd like to do the CGI programming with Apache and Perl in Max OS X 10.8.5.
I followed the guide : CGI Programming With Apache and Perl on Mac OS X. The steps are:
edit /etc/apache2/httpd.conf, uncomment the following:
AddHandler cgi-script .cgi .pl
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
edit /etc/apache2/userName.conf:
Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
DirectoryIndex index.html index.cgi
AllowOverride None
Order allow,deny
Allow from all
start apache:
sudo apachectl restart
put a cgi file into the folder: ~/Sites. I have update the privilege of test.cgi:
sudo chmod 755 test.cgi
That's all I have done. However, when I visit :
ht tp://localhost/~userName/test.cgi, the result:
Forbidden
You don't have permission to access /~username/test.cgi on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I try to put a html into the ~/Sites, and it can be shown correctly. It seems there is something wrong with the cgi configurations, but I can't find it. Could anyone give some guides?
thanks!
The following steps worked for me on High Sierra running Apache 2.4
( Based on the following excellent tutorial: http://www.cgi101.com/book/connect/mac.html , updated with additional steps for version differences)
1) Move the file to:
/Library/WebServer/CGI-Executables
2) Verify that the file has execution permissions:
ls -l /Library/WebServer/CGI-Executables
If not use:
chmod -x /Library/WebServer/CGI-Executables/myfile.cgi
3) Uncomment the following lines in /etc/apache2/httpd.conf
AddHandler cgi-script .cgi .pl
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
LoadModule cgi_module libexec/apache2/mod_cgi.so
4) Also change the Directory "/Library/WebServer/CGI-Executables" stanza to:
<Directory "/Library/WebServer/CGI-Executables">
AllowOverride None
Options ExecCGI
Require all granted
</Directory>
5) Then restart Apache:
sudo apachectl -k restart
Almost with every new Mac OS version, the changes will become lost and you will need to redo the work, and even do different steps to fix it. Your best friend are the Apache logs located in /var/log/apache2/ (/var/log/apache2/error_log)
The OSX Apache serves "two" servers. One public directly for the localhost and one for each user. Check out the configuration of your user directories in /etc/apache2. There is a users directory having each OSX user on that machine a own configuration like that:
<Directory "/Users/markus/Sites/">
Options Indexes MultiViews FollowSymLinks Includes ExecCGI
AllowOverride All
Allow from all
</Directory>
<VirtualHost *:80>
ServerName sencha
DocumentRoot "/Users/markus/Sites/sencha"
</VirtualHost>
Also make sure, the userprofiles are enabled in the httpd.conf
# User home directories
Include /private/etc/apache2/extra/httpd-userdir.conf
The steps in CGI Programming With Apache and Perl on Mac OS X are correct. If restarting apache does not work, restart the mac! And Now I can use the cgi!