Website not loading on LAMP but test page displays - apache

I have set up my LAMP server on Ubuntu 14.04. I have created a virtual machine to host a website. The directory structure is:
var/www/DS/public_html
I have set up my configuration files so that the server responds to the url:
http://ds.local
I have created test pages inside public_html called index.html and index.php. I have modified the configurations so that index.php is the default page that gets served. In the test page named index.php, the only line of code is:
<?php phpinfo(); ?>
when I go to http://ds.local frrom my browser, the page gets served up and I can see all my php configurations. So. everything good till now.
I have a website which I had developed on WAMP. Now, when I try transferring the files of this website into public_html and try reloading the browser, nothing happens. I have looked at the developer tools window, and I am certain that no page loads.
I have ensured that I have copied all the files and folders making up the website, including all the folders containing js and css. I have also ensured that there exists a file called index.php
Where am I going wrong?

I have a website which I had developed on WAMP
Are you sure that all files are referenced by correct case?
Windows file systems are by default case-insensitive.
http://localhost/DS and http://localhost/ds
are same on windows but not on linux/unix.

Related

Blazor Server App routing 404 - File or directory not found

I have created a blazor server app. it is working on my machine when it is running using localhost. There is a folder configured in the IIS for this project.
I have published the project to a folder and then copied/paste the dll files to the configured folder in the IIS.
The main page (index page) is running perfect , but when I tried to click to move to another page, I got the error "404 - File or directory not found".
Note :- when I browse the project from the IIS , the name of the project has been replaced from localhost to abcdef.com.
Could anyone help me to correct the routing problem ?
I think its related to your page definition of your Balzor components. "/" means the root folder of your website. If you want to add this application to your existing website, you probably upload it in a new folder in your host. For example https yourwebsite/app. In this scenario your new application is not root of your website anymore. So your page address should be something like this:
#page "/app/address".

How to disable the download of files in an Apache2 webserver?

I took over a website which I'm supposed to admin and somebody brought to my attention that certain Indexes and Files are available, which shouldn't be. I will be using dummy names.
You were able to access example.com/intern before, but I changed a line in /etc/apache2/apache2.conf according to this https://stackoverflow.com/a/31445273 . This worked partly, as I get a 403-Forbidden when I now navigate to example.com/intern and that's basically what I want.
However the directory intern governs a file called file.php.bak aswell as file.php. When I navigate to example.com/intern/file.php I get a white website. I am however not sure, if you are able to access file.php in another way, because the site does load and I don't get a 403 like before. What is way worse and the reason I am struggling with this is: If I go to example.com/intern/file.php.bak then my Browser (Firefox) offers me to download file.php.bak, which I can read in plaintext. I want all files in intern to not be accessible via the website, but I have no idea how to do this. Can anybody help?
Things I've tried:
Removing the Indexes from the apache2.conf file like mentioned above. It only puts the 403 on the directory itself and not recursively for all the files in it.
Writing a .htaccess file as described here: https://fedingo.com/how-to-prevent-direct-file-download-in-apache-server/ and putting it in intern with the same result as in 1)
Putting an empty index.html file in the intern directory. This leads to no more 403 in example.com/intern, but the download on example.com/intern/file.php.bak is still possible. I've also tried index.php with the same result.
File System:
The application runs from /var/www/application which is also the folder for the /var/www/application/index.php I want to use. The /var/www/application/intern directory is also there. While it isn't browsable anymore, the files in it still are accessible. /var/www/application/intern/file.php can be navigated to via example.com/intern/file.php, but it seems like it can't be downloaded or read as it results in a white page. /var/www/application/intern/file.php.bak can however be downloaded via example.com/intern/file.php.bak.
Let's say Apache document root is set to DocumentRoot "/folder_one/folder_two"
Placing files in a folder_one will prevent people browsing your apache server and requesting the files directly.
Place index file in folder_two and include some code such as PHP to tell apache to include whatever files you want from folder_one.
In this manor Apache will still be able to serve whatever files you want from folder_one and people will not be able to request the files directly as the are located in a directory above the Apache document root.

Apache routing without htaccess

I am working with a custom website built in PHP running on Apache server. The client wants to move it to a new server. I moved everything including the .htaccess file, the homepage loads fine but all the other urls like site.com/register isn't working. I'm sure this is not handled by code in the old server because I renamed everything (including .htaccess) and it still works. If I create a file like test.php in the old server, I can access it like site.com/test. It doesn't even hit the index.php file. Also, not all the urls work like this, some are loading through files in other folders.
So my question is - what are the possible ways that Apache can let user access site.com/test without the .php extension. It must not be using .htaccess. Also, we should be able to add exceptions to this so that some urls can be loaded differently.
you can achieve same thing in hosts file if you are using Linux server. you need to define same rules in hosts configuration file.

.htaccess in symfony2 web folder hides the whole folder

I recently installed symfony2 its running on xampp the .htaccess in the /symfony/web folder hides the whole web folder and return a 500 error . i tried deleting the .htaccess in symfony web folder then it shows the folder back in the browser. can you please help me with this please

Working with local and live websites. issues with subfolders in www folder

I have a live site, example.com and when i have pulled it off to a local enviroment using wampserver i am having some issues
on the live site everything works ok and if I click on a link it will resolve properly
example.com/offices
However on the localcopy because I have other sites in the www folder(as subfolders) I have to access it by
127.0.0.1:8888/example/
and when I click on the same link on the local website it will go to
127.0.0.1:8888/offices/
instead of
127.0.0.1:8888/example/offices/
And the same goes with images as the are all looking for folders in the root rather than the subfolder (www/example)
I have tried using virtual hosts and couldn't get it to work
is there a rule I can put in the htaccess or would I need a seperate install of wamp so it all resides in the www folder?