WebFaction
Community site: login faq

I'm testing a private Apache instance. I created a Custom app and followed the instructions in the following link (with an identical httpd.conf): https://community.webfaction.com/questions/14339/installing-a-private-instance-of-the-shared-apache

The instance works perfectly well, except for the fact that it does not recognize that it is working under a subdirectory (e.g. username.webfactional.com/apachetest/) so the PHP links are based directly on the root (e.g. username.webfactional.com/). The

Is there anyway to fix this?

EDIT:

Below is the VirtualHost part of httpd.conf:

  < VirtualHost 127.0.0.1:12785>
  DocumentRoot /home/username/own-un/
  DirectoryIndex index.html index.htm index.cgi index.php
  ProxyPreserveHost on
  AddDefaultCharset utf-8
  AddHandler cgi-script .cgi
  Alias /cgi-bin/php54.cgi /home/php-cgi/php54.cgi
  Action php54-cgi /cgi-bin/php54.cgi
  SetEnv MOD_X_SENDFILE_ENABLED 1
  XSendFile On
  XSendFilePath /tmp/
  XSendFilePath /home/username/
  RewriteLog /home/username/.rewrite.log
  RewriteLogLevel 3
  Include /home/username/apache-university/conf/extra/httpd-autoindex.conf
  < Directory /home/username/own-un/>
    AllowOverride all
    < FilesMatch \.ht(access|passwd)>
      Deny from all
    < /FilesMatch>
    < FilesMatch (\.user\.ini|php\.ini)>
      Deny from all
    < /FilesMatch>
    < FilesMatch \.php$>
      SetHandler php54-cgi
    < /FilesMatch>
  < /Directory>
< /VirtualHost >

(I intentionally added spaces within the tags to allow proper rendering.)

The .htaccess file in ~/own-un has the following:

< IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /apachetest
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
< /IfModule>

asked 18 Mar '14, 17:56

riyadhlinux
2615
accept rate: 100%

edited 20 Mar '14, 20:27

Could you please clarify what you mean when you say the PHP links are "based" directly on the root?

(18 Mar '14, 23:29) waynek

I'm running ownCloud using that instance. All links (HTML, CSS and JS) have username.webfactional.com as their root instead of username.webfactional.com/apachetest/ (where the Custom app is listening).

(19 Mar '14, 06:15) riyadhlinux

You just have to to add the following configuration item, in the config.php file.

'overwritewebroot' => '/cloud',

After that I could install & access my cloud over a subdirectory with an own apache instance (e.g. http://domain.com/cloud). See here for documentation

p.s.

Now I guess I have just to fix the authentication stuff again, hope they fix it someday :-/

permanent link

answered 12 Aug '14, 22:22

marcel
671616
accept rate: 0%

Try adding "RewriteBase /apachetest" in your ownCloud .htaccess file.

permanent link

answered 19 Mar '14, 15:20

seanf
12.2k41836
accept rate: 37%

Sadly, this still does not work. ownCloud already comes with .htaccess RewriteRules. I added RewriteBase cloud/ after RewriteEngine on, but nothing changed.

(19 Mar '14, 18:07) riyadhlinux

Please try /cloud instead of cloud/.

(19 Mar '14, 18:18) seanf

Oops. That was what I used in the first place. Didn't work.

(19 Mar '14, 18:45) riyadhlinux

Ok, could you perhaps edit your original question to include the relevant parts of your httpd.conf?

(19 Mar '14, 22:36) seanf

just did it.

(20 Mar '14, 20:27) riyadhlinux

Have you tried placing the rules within a Location Directive?

(21 Mar '14, 01:29) johns

Johns, Could you please explain where that should be? The way I understood it is that location limits the rewrites rule to a specific URL, but does this help?

(21 Mar '14, 08:04) riyadhlinux

No, a location directive isn't going to help here.

I don't think you can solve this in your httpd configuration. You're going to need to consult the ownCloud community to see if there is any way, within ownCloud, to force it to use a specific URL prefix.

(21 Mar '14, 19:21) seanf
showing 5 of 8 show 3 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×27

question asked: 18 Mar '14, 17:56

question was seen: 3,870 times

last updated: 12 Aug '14, 22:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM