How to create html/php webpage subdirectory in Azure Website? - php

I want the URL of my site to look like this 'https://example.com/mainPage/subPage/anotherSubPage' to have a better website directory. I am using Azure web app server and I can't seem to find the web.config folder even when using Advanced Tools.
These are the contents of my \wwwroot folder.
I even searched it in every folders. Can't find them. Thank you

If you are using Kudu, you can find the web.config under the folder \home\site\wwwroot.

Related

Add standalone PHP web application to existing site

There is a running website (on Bitrix CMS) located on the simplest shared hosting with cPanel. The task is to create a standalone little web application in PHP (for internal use in the company), which, for simplicity, will be available from the same domain, but, what is important, it will not affect the already running site.
On the hosting, in the file manager, there is a public_html folder - as I understand these are the site files. I created in public_html a subfolder (for example, webapp) and added a couple of test files (for example, test.txt). The test file is supposed to be available at site.com/webapp/test.txt, but nothing is loaded - just a white screen, no error messages.
Trying with text files and simple php-scripts - the same result, just white screen.
How to fix it?
Check your .htaccess on site root, it maybe redirecting all routes to index.php of Bitrix CMS.
Alternatively you can follow above answer and create a subdomain.
Simple tutorial here.
You can create a subdomain and point your public_html folder there.
You need to create an Index.php file in the subdirectory, in hosting any folder must have this file which will be executed any time you access that directory with URL.

How to create a shared resource folder in Active Directory to search for text in files using LDAP or any PHP method?

I have joomla and moodle sites that are running on the same IIS server. I use active directory to manage users to authenticate with the sites. My aim is to maintain same users and resources to be used by these sites.
So far I'm able to login users using LDAP in PHP. My next objective is have a common folder that i can upload and manage files to be used by both sites. I want to search for text for example a word or a sentence inside text files and return the results in joomla or moodle using PHP.
How can i achieve this? Share your ideas and sample code in PHP to help me solve this.

PHP REST Api works on localserver but not on Web Hosting?

I have just created a simple REST Api following this small video using Slim Framework 3.x. I was just getting started and I followed the instructions in the video and created a simple route like this
$app->get('/', function($request, $response)
{
return 'Home';
});
This works on localserver (XAMP) when I open the link `
localserver/project_name/public/
` I get "Home" returned on the page.
After that I simply Zipped the project folder and uploaded it to my Web Hosting, htdocs folder. I extracted the zipped project, which included the "composer.phar" and "vendor" folder. I try the same thing again, i.e., I run the url
www.mysite.com/project_name/public/
All I've done is change "localserver" with www.mysite.com but the browser tells me that my domain
is currently unable to handle this request.
I know this might be something very obvious but I am a novice in php and REST Api's. So any help is appreciated. Also some things I think might matter are, The web hosting that I am using is Plesk based. I have a mysql database Running on the hosting and simple php files run when run individually. For example if I run simple call a test.php file with some database query in it and some echo, it will run successfully. Even if you can point me in the right direction, I would appreciate it. Oh, and I don't have access to php.ini on the hosting. I was only provided with one login that lets me login to the hosting and I can see htdocs folder among some others. I have attached an
image of the view I get after logging in, to give you more perspective of the type of hosting I have. I am hosting a website in the httpdocs directory as well. ASP.NET developed
I just need some direction as to what I need to do to be able to publish my REST api to my hosting and be able to access it through this android app that I am building. What do i need to do on my server? What settings to change to make the api work?

Secure access to all file outside the web directory in Symfony 3.1

I'm currently working on a project in Symfony.
Now i have deployed the project to production.
I've noticed that if i go to domain.com/var/logs/prod.log than i'm able to download the file. Is there a way to protect everything outside the Web directory so that no matter what you type in the url you will be redirected to the web directory.
Or let me know if you have an other method to block access.
Because now i think that the project is not that secure now that i found this error.
Thank you in advance
Even if you have a subdomain you have to point it to web directory and don't upload all symfony files in public folder.
If your subdomain is a subfolder then you can upload symfony project somewhere and make a symbolic link from web folder and place it anywhere you like.

Route/create a sub-domain in CakePHP, how to

I've tried solutions as such, but they don't see to address the problem Im at.
How to create a sub-domain in CakePHP?
I have a CakePHP app in publichtml/lastroarte.com running ok. I went to my DNS and created for a subdomain entries for sandbox.lastroarte.com a test subdomain for the new version of my which we'll be upload the new app.
If I browse to the subdomain now, it redirects me the home page of my domain, still displaying the url sandbox.lastroarte. I've found entries for the pages in the Routes file of Cake, although I have not found way to say a subdomain should display the index of its own folder (public_html/sandbox.lastroarte.com). Am I doing the right approach? How to achieve this?
Appreciate your answers.
(Assuming you are running apache as your web server)
You have created a sub-domain, but have you created sites-available and sites-enabled files and restarted apache?
If you are using your host's control panel it will do this for you, but you will need to associate your public_html/sandbox.lastroarte.com directory to the sandbox.lastroarte.com sub-domain.
In short this doesn't sound like a Cake routing problem, it sounds like apache is routing traffic from sandbox.lastroarte.com to lastroarte.com.

Categories