Solved

How can I set Plesk settings for a virtual directory?

Posted on 2014-10-24
8
543 Views
Last Modified: 2014-10-27
I have a an iis 7 website at godaddy under the old hosting manager system which allows me to include a file in a page using the following:   <!--#include file="../includes/linked-filename.asp"-->

I'm moving the site to a new plesk site and encounter a server error when a page references the linked-filename.
The server error only occurs when I need to go up the chain to the linked directory (i.e., ../includes/...).
If the included/linked file is in the current directory or a subdirectory (i.e., <!--#include file="includes/linked-filename.asp"--> or members/includes/linked-filename), there is no error.

It would be inconvenient to need a separate file for each subdirectory. If i changed a DB password that would mean changing every file.

I'm not sure how to set the plesk virtual directory settings and the plesk help didn't help me as much as i had hoped.

Thanks for any help you can provide.

Sally
0
Comment
Question by:sallywizard
  • 4
  • 3
8 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40402722
it looks like you're using parent paths in your code, which is a security risk and is disabled by default in the newer versions of IIS, and is probably disabled by default in PLESK. it is better to get in the habit of using absolute paths, however if that's not an option to you right now, you may be able to turn them on (remember, PLESK is just a admin tool that sits on IIS so it should have all the features IIS has.I believe the option for Parent Paths lie under the Virtual Directory settings, it's a checkbox that says "Enable Parent Paths"

see this link for more info on parent paths:
http://windowsitpro.com/systems-management/benefits-and-pitfalls-disabling-parent-paths
0
 

Author Comment

by:sallywizard
ID: 40402832
I understand, now, the security issue. Based on the article and the comments, there doesn't seem to be an easy route.
 
I checked the enable parent path but either it takes a while to be effective or checking it didn't accomplish the task. I set the permissions for the specific directory to read and execute but that appears to have not had an impact.

I also tried referencing the live site by file="http://domain/includes" but that didn't work. Do i need to us a file directory such as "D:\..."? That could be problematic when i port to a live site.

The solution appears to be to move the site's pages, currently in subdirectories by topic to the top web level and reference a subdirectory to all pages that call the file. that's a crowded folder when the site has many pages.

I'm considering moving my development site - that visitors access to see how their sites will appear when they're copied to their hosting. In some older sites, this would mean a bit of rework just to port them to the plesk hosting. Something to think about.

Thanks,
Sally
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40402843
you may need to restart iis in order for the changes to take place, cant remember off the top of my head.

you do NOT need to reference by drive letter, just need to start the path with a "/".

what's the exact error message you're getting?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:sallywizard
ID: 40403022
it's a generic "internal Server Error".  
The server encountered an internal error or misconfiguration and was unable to complete your request.
...
More information about this error may be available in the server error log.

I've started looking at logs but determined the fail point by creating simple test pages.

I see that I can create custom redirects for different messages and think I'll try that This is my first time using plesk with older sites. i've set up some new ones including databases but my calls to the include directories are all subdirectories.

Do you recommend i call godaddy and ask them to restart iis? i have no problems doing that-just wait time. Plesk has a robust control panel but i'm just getting to know it.

Thanks. I'm awarding you the points.
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40403030
it may be worth calling them, although I'm not confident they would restart it for you...

to get more detailed errors, make sure you have the following in your web.config file, which should be located in the root folder of your site
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40403034
forgot to put in the web.config file :)

<system.web>
    <customErrors mode="Off" />
  ...
  </system.web>

Open in new window

0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 40403426
>I understand, now, the security issue. Based on the article and the comments, there doesn't seem to be an easy route.

The answer given and selected only explains why you are getting the error and why you should not enable parent paths. The is the actual solution is very easy.  Simply change any reference of the include file to include virtual

FROM
 <!--#include file="../includes/linked-filename.asp"-->

Open in new window

TO
 <!--#include virtual="/includes/linked-filename.asp"-->

Open in new window


assuming the includes folder is top level.
0
 

Author Comment

by:sallywizard
ID: 40406657
Scott,
Thanks for the recommendation. This solution works.   I have a bit of work to do to transfer folders but I know now how to set everything up.

How can i add points that I can award you?

Thanks,
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web site error 3 41
Grunt Copy file to another destination. 1 35
ASP.NET(C#) Eliminating weekends from a date range 2 34
innerHTML 7 16
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question