Categories: apache, ubuntu, xampp, virtualhost

Virtual host Object not found

1 answer

Everytime I try to access https://sub.myproject.test/ this message pops up:

Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 sub.myproject.test Apache/2.4.38 (Unix) OpenSSL/1.0.2q PHP/7.2.15 mod_perl/2.0.8-dev Perl/v5.16.3

On httpd-vhosts.conf I have:

<VirtualHost *:80>     DocumentRoot "/mnt/data/myproject/"     ServerName sub.myproject.test     ServerAlias www.sub.myproject.test     <Directory  "/mnt/data/myproject/">         AllowOverride All         Require local     </Directory> </VirtualHost> 

and on httpd-ssl.conf I have:

# catalog config <VirtualHost *:443>     DocumentRoot "/mnt/data/myproject/"     ServerName sub.myproject.test:443     ServerAlias www.sub.myproject.test:443     ErrorLog "/opt/lampp/logs/error_log"     TransferLog "/opt/lampp/logs/access_log"     SSLEngine on      SSLCertificateFile "/opt/lampp/etc/ssl.crt/server.crt"     SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/server.key"      <FilesMatch "\.(cgi|shtml|phtml|php)$">         SSLOptions +StdEnvVars     </FilesMatch>      <Directory "/mnt/data/myproject/">         SSLOptions +StdEnvVars +FakeBasicAuth          Options Indexes FollowSymLinks MultiViews         AllowOverride All         Allow from all         Require all granted     </Directory>     BrowserMatch "MSIE [2-5]" \              nokeepalive ssl-unclean-shutdown \              downgrade-1.0 force-response-1.0     CustomLog "/opt/lampp/logs/ssl_request_log" \           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </VirtualHost> 

And of course in /mnt/data/myproject path I have the folder

If you could help me fix this, it'd be very appreciated

All answers to this question, which has the identifier 58219934

The best answer:

Your VirtualHost is ok (except you do not need to put :443 in ServerName and ServerAlias directives), but you never tell Apache which page to display by default, when not specified in the request.

Define DirectoryIndex in each VirtualHost.

Ex: DirectoryIndex index.html When the request is ,hence nothing after the domain name, Apache will display index.html, from the DocumentRoot directory.

Unrelated to your question, you should put ServerTokens Prod and ServerSignature Off in your configuration, your error message is displaying way to much information.

Last questions

how do i remove the switch on my home screen?
how to edit the JS date and time to update atuomatically?
How to utilize data stored in a multidimensional array
Powermockito not mocking URL constructor in URI.toURL() method
Android Bluetooth LE Scanner only scans when phone's Location is turned on in some devices
docker wordpress container can't connect to mysql container
How can I declare a number in java that is more than 64-bits? [duplicate]
Optaplanner solutionClass entityCollectionProperty should never return null error when simple JSON object passed to controller
Anylogic, get the time a pedestrain is in a queue
How do I fix this syntax issue with my .flex file?
Optimizing query in PHP
How to find the highest number of a column and print two columns of that row in R?
Ideas on “Error: Type is referenced as an interface from”?
JCIFS SmbFile.exists() and SmbFile.isDirectory() return false when it exists and I can listFiles()
PHP total order
Laravel booking system design
neural net - undefined column selected
How to indicate y axis does not start from 0 in ggplot?
Fragments in backStack
Spinner how to change the data