Creating alias directory & index.php offered as download

4 posts / 0 new
Last post
#1 Tue, 01/15/2013 - 08:56
wannabe

Creating alias directory & index.php offered as download

HI everybody,

I have been searching this forum, and other forums hoping to find a solution. But I cannot find any.

I am trying to install crawl-anywhere.com on my system. When I add the alias directory in /etc/apache2/apache2.conf


Alias /crawler/ "/home/crawl/web/crawler/pub/"
<Directory "/home/crawl/web/crawler/pub/">
order allow,deny
allow from all
</Directory>

I can navigate to that folder, but index.php is offered as a download. Which is very odd, because when i navigate to my website all works fine.

To make myself a bit more clear.

my www is in /home/myserver/public_html/ <-- here everything works just fine

I try to install the craw-anywhere in /home/crawl/ <-- inhere, index.php is offered as a download

Does anyone has any idea how I can resolve this? I emptied my browsers cache multiple time. And tried different settings.

Thanks in advance,

W//

Tue, 01/15/2013 - 16:51
andreychek

Howdy,

Well, I'm not familiar with the installation of crawl-anywhere.

However, I can offer that you'd probably have better luck if rather than setting up an alias, you instead performed the installation into a specific DocumentRoot, and then accessed it directly.

So, if you have a domain name "myserver", and want to be able to use crawl-anywhere using it, you could install it in, say, "/home/myserver/public_html/crawl" -- and then crawl-anywhere would be available in myserver.com/crawl.

Would that do what you're after?

-Eric

Wed, 01/16/2013 - 01:18 (Reply to #2)
wannabe

Hi Eric,

Well, that is an option but I rather follow the guide for the moment. And I want it to work :)

I am a bit further.

step 1: webmin -> Apache webserver -> Global Configuration -> Edit Config Files.

Inhere I add the directives as described in my first post.

Then I Save and apply changes.

Step 2: Webmin - > Apache Webserver -> Default server options

Inhere I can see that the alias is added under 'per-directory options' I Can click on it and change the configuration for my newly added alias. I copied the settings of my virtual server public_html directory. After doing this, index.php is no longer offered as a download.

But now I get a new error. (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

I have two questions: 1) How come that my newly added alias is not inheriting the directory settings? Is there an option somwhere that allows me to do so? 2) Where is the best place to add my alias? Global configuration or per virtual server?

thanks in advance,

W//

Wed, 01/16/2013 - 08:39
andreychek

Well, the problem is that what you're trying to do won't work on a default Virtualmin setup, due to security reasons :-)

There aren't any PHP handlers setup for the alias directory you're trying to use... PHP handlers are only setup for the DocumentRoot. That's the reason it's trying to download it.

That actually would have worked, a few months ago... but it relied on a security hole to do so :-)

That security hold has since been closed down.

The issue was that when accessing a directory with no PHP handler setup, it would fall back to using mod_php.

And the problem there is that allowed a user to take advantage of Apache to be able to view any file in /home.

If that's what you want -- if you trust all the users on your system, and you aren't concerned about the security of the files in /home, you could always simply enable mod_php for your domain. Instead of prompting you to download the file, that should actually begin working at that point,

To do that, you can go into Server Configuration -> Website Options, and there you can set the "PHP Execution Mode" to mod_php.

-Eric

Topic locked