Website link shows Apache HTTP Server Documentation - apache

My website directory /manual shows Apache HTTP Server Version 2.2 Documentation page i have removed this directory from my FTP but still o a, getting this.
I am using Linux Centos bellow is my manual.conf file configuration
There is a manual.conf which shows bellow configurations
#
# This configuration file allows the manual to be accessed at
# http://localhost/manual/
#
AliasMatch ^/manual(?:/(?:de|en|fr|ja|ko|ru))?(/.*)?$ "/var/www/manual$1"
<Directory "/var/www/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>

You may need to remove that link from your server configuration. If you have done this you need also to restart your apache server.
To remove the documentation look into your apache configuration (on Debian e.g. /etc/apache2/sites-enabled/000-default) for a block like this one here:
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
...
</Directory>
And comment them with # out. Than don't forget to restart the apache server to commit the changes.
After your update you seems to have two options:
Delete the whole file. That should remove the link for ever.
Comment all that lines out by adding a # to the beginning of all lines. This is for some cases better if you want to recover the manual in the future.
And restart the server with:
service httpd graceful

In fedora
dnf remove httpd-manual.noarch
service httpd restart

If you still have this behaviour and want to correct it just disable the apache2-doc conf and restart the apache2 service. a2disconf apache2-doc.

Related

403 Forbidden : Apache not working after moving document root folder to iCloud drive

So i'm using MacOS Catalina and my Apache environment was running sweet until i decided to move my document root to the iCloud drive, to keep it backed up.
Before my document root was :
/users/admin/www
And now it is
/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www
I edited httpd.conf accordingly :
DocumentRoot "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www"
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www">
Options FollowSymLinks Multiviews SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder">
Options +FollowSymLinks +Multiviews +SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Allow from All
Require all granted
</Directory>
Restarted Apache, restarted the machine but now i can access 127.0.0.1, EXCEPT one specific folder (let's call it www/myfolder). When i try to access 127.0.0.1/myfolder, i get the error below :
Forbidden
You don't have permission to access / on this server.
Checking the apache log file, this is the error i'm getting :
[Thu Oct 24 14:00:24.830700 2019] [access_compat:error] [pid 61703] [client 127.0.0.1:57804] AH01797: client denied by server configuration: /users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder/public_html/
What am i missing here ? Please help, i need to work :D
First thing I am seeing is that you are using Apache 2.4 style syntax in your directory block, but then in your error log the module throwing the error is
access_compat. Per the Apache documentation:
The directives provided by mod_access_compat have been deprecated by mod_authz_host. Mixing old directives like Order, Allow or Deny with new ones like Require is technically possible but discouraged. This module was created to support configurations containing only old directives to facilitate the 2.4 upgrade
Next clue is the error code: AH01797. This is caused by a server configuration issue:
Client denied by server configuration
This error means that the access to the directory on the file system was denied by an Apache configuration.
I am assuming here that you are actually using 2.4, and that access_compat is enabled by mistake.
Take a look through your configuration files again, and find the LoadModule directive that is loading mod_access_compat, and comment it out. It might be in your httpd.conf file, but there are numerous different styles of organizing and configuring an Apache install, so it could be elsewhere. If you have a Debian-style install, you need to remove the symbolic link /etc/apache2/mods_enabled/mod_access_compat. Grep -R access_compat * might help.
EDIT 2 more observations:
In the second directory stanza, you have
Allow from all
Require all granted
Which is mixing old directive syntax with new, and is also redundant. Disable access_compat again, and also remove that Allow from all line before restarting Apache.
I don't think the second directory stanza is even necessary. You could probably delete the whole block and restart the server, and it would work.
First try (1) by disabling access_compat and removing that Allow directive from your httpd.conf file, and restart apache using apache2ctl -k graceful. If that doesn't work, comment out the entire second directory stanza and restart again.
I am about 50% sure this will fix it. If it doesn't then I will really need to see your entire httpd.conf file before I can troubleshoot further.

Apache won't autoindex

Oracle Linux 7.3 (RHEL derivative)
Apache 2.4.6
I'm setting up a repository in /srv/www for yum, scripts, and kickstart files, served via httpd. I want an auto-index, so I don't have any index.html. And, this is the only thing this internal server will do. So, httpd.conf:
DocumentRoot "/srv/www"
<Directory "/srv/www">
AllowOverride all
Options Indexes FollowSymLinks
Require all granted
</Directory>
However, I still get the error message:
[autoindex:error] [pid 12345] [client <IP address>:<port>] AH01276: Cannot serve directory /srv/www: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive.
Except that the Options directive allows auto-indexing! I've tried Options All. I've tried Options +Indexes +FollowSymLinks. I've looked at 7 or 8 Google hits. Nothing is working.
Setting LogLevel debug doesn't increase messaging.
What have I missed?
As noted here, in the absence of an index.html (or other configured index file), the welcome page configured at /etc/httpd/conf.d/welcome.conf will take precedence over other configurations via its LocationMatch directive. Rename the file so it doesn't end in .conf and auto-indexing works.
Obviously landing in another virtualhost or Directory without indexes enabled, or a .htaccess getting in the way.
Set "AllowOverride none" first, since it is absurd to have it active if you are not using any .htaccess file (and since you have access to the main server you don't need it). Once you set AllowOverride, restart the server in case you added Indexes recently and didn't restart to apply changes.
If the issue persists, run apachectl -S and make sure you are landing in the correct virtualhost.
I just want to add that, after updating my mac to Catalina, my apache stopped working with that same error.
I had to:
uncomment the required modules (php7, rewrite, directory, etc...)
add a + sign to the Options (Options +FollowSymLinks +Multiviews +Indexes)
This worked for me.
Solution:
Ensure two apache modules are running:
mod_autoindex.so
mod_dir.so
In your case, mod_autoindex.so is running. Now enable the second one.
PS: Keep Options -Indexes. It's important. It makes sure that directory listings are disabled, as you shouldn't allow anyone to pay a visit to every directory on your server (some with rather private content such as CMS's directories).

Where do you find the interface for phpmyadmin when installed using homebrew

I installed phpmyadmin using homebrew
brew install phpmyadmin
The output came back as follows:
Note that this formula will NOT install mysql. It is not
required since you might want to get connected to a remote
database server.
Webserver configuration example (add this at the end of
your /etc/apache2/httpd.conf for instance) :
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
Then, open http://localhost/phpmyadmin
More documentation : file:///usr/local/Cellar/phpmyadmin/4.3.11.1/share/phpmyadmin/doc/
Configuration has been copied to /usr/local/etc/phpmyadmin.config.inc.php
Don't forget to:
- change your secret blowfish
- uncomment the configuration lines (pma, pmapass ...)
==> Summary
🍺 /usr/local/Cellar/phpmyadmin/4.3.11.1: 1,898 files, 55.2M, built in 2 seconds
I updated httpd.conf with that block of details. I also updated my blowfish and uncommented the configuration lines as it states.
When I go to localhost/phpmyadmin i get a 404 error.
Any ideas where I would find the interface so I can more easily build/update my database(s).
I experienced this problem, too.
In order to use phpMyAdmin in your apache, you have to make symbolic link in /usr/local/var/www/htdocs with this command. (If you didn't changed your DocumentRoot)
cd /usr/local/var/www/htdocs
ln -s /usr/local/Cellar/phpmyadmin/4.3.11.1/share/phpmyadmin ./phpmyadmin

.htaccess ErrorDocument 404 not showing up

I have a server from AWS EC2 service running on Linux ubuntu and I have installed apache, php, and mysql.
I have added a .htaccess file in my document root /var/www/html.
I entered this code in it:
ErrorDocument 404 /var/www/html/404.php and it is still not showing up.
I kept entered this command multiple times: sudo service httpd restart to restart the server but no changes displayed...
How can I fix this... Did I do something wrong?
First, note that restarting httpd is not necessary for .htaccess files. .htaccess files are specifically for people who don't have root - ie, don't have access to the httpd server config file, and can't restart the server. As you're able to restart the server, you don't need .htaccess files and can use the main server config directly.
Secondly, if .htaccess files are being ignored, you need to check to see that AllowOverride is set correctly. See http://httpd.apache.org/docs/2.4/mod/core.html#allowoverride for details. You need to also ensure that it is set in the correct scope - ie, in the right block in your configuration. Be sure you're NOT editing the one in the block, for example.
Third, if you want to ensure that a .htaccess file is in fact being read, put garbage in it.
An invalid line, such as "INVALID LINE HERE", in your .htaccess file, will result in a 500 Server Error when you point your browser at the directory containing that file. If it doesn't, then you don't have AllowOverride configured correctly.
Enable Apache mod_rewrite module
a2enmod rewrite
add the following code to /etc/apache2/sites-available/default
AllowOverride All
Restart apache
/etc/init.d/apache2 restart
If you have tried all of the above, which are all valid and good answers, and your htaccess file is not working or being read change the directive in the apache2.conf file. Under Ubuntu the path is /etc/apache2/apache2.conf
Change the <Directory> directive pointing to your public web pages, where the htaccess file resides. Change from AllowOverride None to AllowOverride All
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I had the same problem and found the answer and explanation on the Ubuntu Ask! forum https://askubuntu.com/questions/421233/enabling-htaccess-file-to-rewrite-path-not-working
For Ubuntu,
First, run this command :-
sudo a2enmod rewrite
Then, edit the file /etc/apache2/sites-available/000-default.conf using nano or vim using this command :-
sudo nano /etc/apache2/sites-available/000-default.conf
Then in the 000-default.conf file, add this after the line DocumentRoot /var/www/html. If your root html directory is something other, then write that :-
<Directory "/var/www/html">
AllowOverride All
</Directory>
After doing everything, restart apache using the command sudo service apache2 restart
Most probably, AllowOverride is set to None. in Directory section of apache2.conf located in /etc/apache2 folder
Try setting it to AllowOverride All
Just follow 3 steps
Enable mode_rewrite using following command
sudo a2enmod rewrite
Password will be asked. So enter your password
Update your 000-default.conf or default.conf file located at /etc/apache2/sites-available/ directory. you can not edit it directly. so use following command to open
sudo gedit /etc/apache2/sites-available/000-default.conf
Or
sudo gedit /etc/apache2/sites-available/default.conf
you will get
DocumentRoot /var/www/html
OR
DocumentRoot /var/www
line. Add following code after it.
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Make user the directory tag path is same as shown in your file.
Restart your apache server using following command
sudo service apache2 restart
In my experience, /var/www/ directory directive prevents subfolder virtualhost directives. So if you had tried all suggestions and still not working and you are using virtualhosts try this ;
1 - Be sure that you have
AllowOverride All directive in
/etc/apache2/sites-available/example.com.conf
2 - Check /var/www/ Directory directives in /etc/apache2/apache2.conf (possibly at line 164), which looks like ;
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
If there is an AllowOverride None directive change it to
AllowOverride All or just escape line
By default, Apache prohibits using an .htaccess file to apply rewrite rules, so
Step 1 — Enabling mod_rewrite (if not Enabled)
First, we need to activate mod_rewrite. It's available but not enabled with a clean Apache 2 installation.
$ sudo a2enmod rewrite
This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.
$ sudo systemctl restart apache2
mod_rewrite is now fully enabled. In the next step we will set up an .htaccess file that we'll use to define rewrite rules for redirects.
Step 2 — Setting Up .htaccess
Open the default Apache configuration file using nano or your favorite text editor.
$ sudo nano /etc/apache2/sites-available/000-default.conf
Inside that file, you will find a block starting on the first line. Inside of that block, add the following new block so your configuration file looks like the following. Make sure that all blocks are properly indented.
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
. . .
</VirtualHost>
Save and close the file. To put these changes into effect, restart Apache.
$ sudo systemctl restart apache2
Done. Your .htacess should work.
This link may actually help somebody https://www.digitalocean.com/community/tutorials/how-to-rewrite-urls-with-mod_rewrite-for-apache-on-ubuntu-16-04
I cleared this use. By using this site click Here , follow the steps, the same steps follows upto the ubuntu version 18.04
Go to /etc/apache2/apache2.conf
You have to edit that file (you should have root permission). Change directory text as bellow:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Now you have to restart apache.
service apache2 restart
In WampServer Open WampServer Tray icon ----> Apache ---> Apache Modules --->rewrite_module
For completeness, if "AllowOverride All" doesn't fix your problem, you could debug this problem using:
Run apachectl -S and see if you have more than one namevhost. It might be that httpd is looking for .htaccess of another DocumentRoot.
Use strace -f apachectl -X and look for where it's loading (or not loading) .htaccess from.
i have a lot of sites on my virtual machine,
and i solved it only by changing config of the site in which i needed .htaccess
what i did:
sudo a2enmod rewrite
next i changed only config for particular site, not for every site "example.com"
sudo nano /etc/apache2/sites-enable/example.com.conf
inside of it i added
<Directory /var/www/example.com>
AllowOverride All
</Directory>
service apache2 restart
so it only applies for 1 site, because when i tried to apply changes to entire server it crashed, don't know why, but this solved my problem

Apache 2 The requested URL / was not found on this server

I'm hosting a couple of webservers. I've set the first one up with no problems. On the second server when I attempt to navigate to it (http://192.168.1.47:99/) I get this error "The requested URL / was not found on this server." I know that the port is being forwarded properly because I can access "http://192.168.1.47:99/phpmyadmin" just fine. I've tried to figure this out for a week or so now and I'm at a loss. Any help would be greatly appreciated!
Ubuntu Linux 10.04
Apache2
php5
I'll provide any additional information that may be needed.
Thanks!
Update - Included config files
* apache2.conf
* httpd.conf
* ports.conf
* sites enabled
we need to change the following lines to /etc/apache2/apache2.conf:
Note :- Change here AllowOverride None to AllowOverride All usingsudo property
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Now :- Restart your web server
sudo /etc/init.d/apache2 restart
It will work now..
As far as I understand you, you want your server to respond on Port 99. Your configuration is listening on Port 80 instead. Change the following line in sites-enabled:
<VirtualHost *:80>
to
<VirtualHost *:99>
and in ports.conf
NameVirtualHost *:80
to
NameVirtualHost *:99
Restart your apache. That should do it.
If you want to make it work without changing port you can follow these steps
sudo nano /etc/apache2/apache2.conf
and add following line at end
Include /etc/phpmyadmin/apache.conf
then restart apache
/etc/init.d/apache2 restart
Better explain here
https://askubuntu.com/questions/55280/phpmyadmin-is-not-working-after-i-installed-it