Apache - url not found in some cases - apache

I've got some problem with my Zend application uploaded on Ubuntu server. While such urls: http://www.domain.com, http://www.domain.com/admin/panel work, only this type of links: http://www.domain.com/index/51-picture.html show: Not found.The requested URL /index/51-picture.html was not found on this server.
Apache.conf
<Directory/>
Options FollowSymLinks
Allow from All
</Direcory>
<Directory /var/www/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sites-available/domain.conf
<VirtualHost *:80>
ServerAdmin admin#domain.com
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/domain
<Directory /var/www/domain/>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I've also enabled: a2enmod rewrite
Thanks for your help.

Ok, I've found the solution. Just removed MultiViews from domain configuration file. Now everything's fine.

Related

My apache2 VirtualHost keep showing "It's working" instead of my site

I'm doing a project for school where I have to host 2 pages on a web server. I chose to do a VirtualHost using Apache2 but when it keeps showing me a "It works" page. The page is located here.
We are using a DNS server but the probleme seems to not be coming from this one.
Here is one of the .conf file :
<VirtualHost *:80>
ServerAdmin jongen.philemon#wt5.ephec-ti.be
ServerName wt5.ephec-ti.be
ServerAlias www.wt5.ephec-ti.be
DocumentRoot /var/www/monsite
<Directory /><br>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/monsite>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
I also changed the apache2.conf like this:
<VirtualHost *:80>
ServerAdmin jongen.philemon#wt5.ephec-ti.be
DocumentRoot /var/www/site
<Directory /var/www/site/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
You can also check our wiki on the GitHub to see all the steps I followed.
Thank's
I got to fix it by re-doing it using a Dockerfile. I uptated the files and the wiki on my github if you have the same issue !

mywebsite.com shows index of / after installing Magento

I am running Virtual server by:
VirtualBox v5.2.12
Ubuntu v18.04
Apache v2.4.29
php 7.1.17
Magento v2.2.4
Everything goes fine till I install magento! Magento works find without any problem in the server but the problem here is when I entered mywebsite.com it shows my files and indexing and I want to show my index.html instead:
Index of /
Name Last modified Size Description
index.html 2018-05-28 03:47 180
info.php 2018-06-04 12:39 20
magento2/ 2018-05-01 23:21 -
Apache/2.4.29 (Ubuntu) Server at mywebsite.com Port 65533
I tried a lot of answer but without any success.
Here is /etc/apache2/apache2.conf
<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>
And Here is /etc/apache2/sites-available/mywebsite.com.conf
Listen 65533
<VirtualHost mywebsite.com:65533>
ServerName www.mywebsite.com
ServerName mywebsite.com
ServerAdmin info#mywebsite.info
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot /var/www/mywebsite.com/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mywebsite.com/html/>
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Here is /etc/apache2/sites-available/000-default.conf.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Finally I solved the issue .. been trying for a week!
The solution is:
Step 1- Inside this file "/etc/apache2/sites-available/mywebsite.com.conf" this should be the first directory strait after the virtualhsost info:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
And it will effect the whole file.. ok so far so good.
Step 2- I added a new directory specially for magento which is
<Directory /var/www/mywebsite.com/html/magento2>
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Require all granted
</Directory>
Step 3- sudo /etc/init.d/apache2 restart in order to restart the apache with status or just use any method to restart.
** The point here is you need to avoid directory Inheritance / one setting for all in order to work with each directory separately.
Hope someone get benefit from this post.
Thank you Andra for the little help.
Regards,
QLF

403 Forbidden vhost Ubuntu

Trying to setup my webserver and allow .htaccess in all www directories. When accessing sub.domain.com on my laptop (with host files adjusted), returns a 403 Forbidden. "You don't have permission to access / on this server."
It feels like the .htaccess file is not allowed, and therefore throws the 403. But as per my understanding the settings are correct isn't? Am I overlooking something?
apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
AllowOverride All
</Directory>
domain.com.conf
<VirtualHost *:80>
ServerName domain.com
ServerAlias sub.domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName domain.com
ServerAlias .domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Either /var/www/domain.com/public_html/support/current doesn't exist, or its rights are not correct for user Apache runs on. Check the User and Group settings in the main Apache config to find out what they are.
You might also want to check the error log to get additional clues.

Apache The Requested URL has not been found on this server

So, I'm trying to get Codiad on my VPS so that me and a friend can work on a project together, and when I try to index localhost/codiad it gives me this error:
The requested URL /codiad was not found on this server.
however, indexing localhost works perfectly fine, it leads me to the normal apache screen. Here are the contents of my default.conf file, if that helps at all:
<VirtualHost *:80>
ServerName www.dsept.cf
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Alias /codiad /home/Tide/Codiad
<Directory "/home/Tide/Codiad">
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
I'm also following this guide if that helps too: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-codiad-a-web-based-ide-on-an-ubuntu-vps, the directory of default.conf is /etc/apache2/sites-available/default.conf
1) are you sure there should be:
localhost/codiad
or :
localhost/Codiad
2) have you ever changed that .conf? If so, you may have to edit that .conf and add codiad alias/path correctly. Is everything accurate there?

Forbidden 403 error when running apache

I am trying to set up a rails app(redmine) on Ubuntu 14.10 running apache2.
log
Cannot server Directory: No matching DirectoryIndex
(index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found,
and server-generated directory index forbidden by Options directive
host.confg
<VirtualHost *:80>
ServerAdmin kanishka#thewolf.in
ServerName app.in
ServerAlias app.in
DocumentRoot /var/www/app.in/public_html/
ErrorLog /var/www/app.in/log/error.log
CustomLog /var/www/tribeapp.in/access.log combined
<Directory /var/www/app.in/public_html/redmine/public>
Options Indexes FollowSymLinks MultiViews
Require all granted
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
Order allow,deny
allow from all
AllowOverride all
</Directory>
</VirtualHost>
New to rails. Let me know if you need more info.
Try this
Options All <--turn on all options
Options Indexes FollowSymLinks <--- replace previously set options with these two