Add a custom http header to subdirectories - iis-6

Here is the code I am using
cscript adsutil.vbs set w3svc/1/ROOT/Test/css/HttpCustomHeaders "Cache-Control: max-age=36000"
When I use it an error appears
The path requested could not be found.
ErrNumber: -2147024893 (0x80070003) Error
Trying To Get the Object: w3svc/1/ROOT/Test/css
w3svc/1/ROOT/Test is the virtual directory
I want to apply my script to subdirectory CSS
The question I have is it possible to apply to a subdirectory.

Related

How to fix the "Not allowed to load local resource" Vue.js

I tried to load some icons and logos into my site using localhost, files are detected but are not loaded and it says "Not allowed to load local resource", I also tried to run the app using "npm install -g http-server" in terminal, but I had another error: "Failed to load resource: the server responded with a status of 404 (Not Found) #build.js:1"
There are two common options for loading images.
Through the public folder. e.g. <img src='/image/myImageName.png'>
Note: by specifying the root directory / vue is directed to the public folder
Or through the assets folder. e.g. <img src='#/assets/images/myImageName.png'>
Note: by supplying the # sign vue is directed to the src directory

AWS Lambda package-deployed functions require() of a relative path, not found

I have a zip file containing the following structure (this is the root of the archive, not nested in a top-level folder, which I understand is a common cause of errors for aws-s3-lambda deployments):
- support/
- shared.js
- one.js
- two.js
and then in one.js and two.js:
var shared = require("./support/shared");
// ...
When I run this code locally, it works. I use the aws-sdk to upload the zip file to AWS-S3 and then use aws.lambda.createFunction() to create a function with that name and handler and everything. The created function DOES show up in my Lambda dashboard, but when I test it, I get "Cannot find module './support/shared'". I have also tried var shared = require("./support/shared.js"); and that gives "Cannot find module './support/shared.js'".
This is for runtime node6.10. The filename cases are correct for case-sensitive lambda.
Shouldn't this work?? What's the gotcha?
Is there a way to verify the file structure that Lambda is working in to show that the additional ./support/shared.js file actually made it to the working directory or whatever it uses?
The gotcha is that the zip file created on a windows machine has the wrong chmod permissions set in it for when AWS unpacks it. The files are there, but inaccessible but node just gives a generic warning about not found instead of that the folder access is denied.

How to organize folders for Laravel on a conventional web host?

If I have the entire Laravel project inside public_html, I have to go to http://domain.com/public to access it, but if I put the contents of Laravel's public inside public_html, the rest of the files in Laravel would be looking for a folder called public, that is now called public_html.
Also, if I rename public_html to public, it won't work either.
I've tried changing 'public' => __DIR__.'/../public to 'public' => __DIR__.'/../public_html' on /bootstrap/paths.php
When I try to load http:/domain.com it says:
Warning: require() [function.require]: open_basedir restriction in effect. File(/home/domain/bootstrap/autoload.php) is not within the allowed path(s): (/home/domain/public_html:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/domain/public_html/index.php on line 21
Warning: require(/home/domain/bootstrap/autoload.php) [function.require]: failed to open stream: Operation not permitted in /home/domain/public_html/index.php on line 21
Fatal error: require() [function.require]: Failed opening required '/home/domain/public_html/../bootstrap/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/index.php on line 21
'public' => __DIR__.'/../public to 'public' => __DIR__.'/../www' on /bootstrap/paths.php doesn't work either
Support disabled open_basedir restriction, so once again I changed the paths from public to public_html and it works now, no .htaccess magic needed either.

SimplePie: Autoloader.php opening stream

Good afternoon, using Simplepie to load RSS feeds onto my site. Godaddy hosted site, with a WP blog for the RSS feed. Have read through Simplepie docs, and searched forums, but can't seem to figure this out. I'm wondering if my folder permissions aren't correct for the ../cache folder?
Error MSG:
Warning: require_once(../php/autoloader.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\12074013\html\test.php on line 15
Fatal error: require_once() [function.require]: Failed opening required '../php/autoloader.php' (include_path='.;C:\php\pear') in D:\Hosting\12074013\html\test.php on line 15
Thanks for your help!!!
It's not permissions on the cache directory, it's likely a problem with how you set up the SimplePie directories or your include statement.
The file you are running is in D:\Hosting\12074013\html\test.php
and it's trying to include the autoloader.php file, which the include
require_once(../php/autoloader.php)
thinks is in D:\Hosting\12074013\php, which is below the web root. Check your install path and set the include to the correct directory path.

CGI working directory (trying to load a template file)

I have a CGI-script which tries to load a template file. However, I get an error where the file location of the CGI-script itself is added to the path where I try to load the template:
let template_string = Jg_template.from_file "/home/d37433/templates/startpage.tmpl" in
Error:
file /home/d37433/public_html/cgi-bin//home/d37433/templates/startpage.tmpl not found
Is there an error in my Apache config? The same code worked on another machine of mine (unfortunately, I don't have access to it at the moment).
Solved by programmatically change the working directory inside the CGI script.