how to add alias to path behind the webroot

edited September 2012 in Modules
Hello, any idea how to get say, mydomain.com/files to point to somewhere behind the webroot? I have tried and tried but no success. I have setup a virtual host etc with apache and such but no luck. I am not sure if the htaccess in fuel or codeigniter for that matter is overriding the virtual host. Maybe someone out there knows better than I as this stuff is a bit crazy. Seems like it should work. I installed xcache and I am trying to use the admin panel. They say I can just copy the admin folder to the root or down stream but not sure how to make that work with fuel. So I am trying to create an alias instead. Can you help? Anyone?

Comments

  • edited 10:24AM
    Are you referring to moving the "fuel" folder to above the web root or are you referring to some other folder? Also, what error messages are you seeing?
  • edited 10:24AM
    Thanks for the reply. No, I installed xcache because I am using TCPDF to make PDF's and it demands a lot. Xcache has an admin that works to give statistics on how it is improving the performance of the server. Op code caching. the admin can be int he webroot or behind it. My issue is, how can I use this admin? Fuel.. or MVC for that matter requires controllers and such, but this admin is just regular includes and no MVC. So I don't know how to use it with Fuel or any MVC. Next, there is a way to use apache to alias using vhosts as you know, say webroot /files and point that to var/www/html/admin , something like that. Here is the page for the instructions: http://xcache.lighttpd.net/wiki/InstallAdministration .

    It talks about this at the bottom of the page. So, how can I do this using something like: "Alias /xcache /var/www/html/admin" ?
    Using Fuel? When I set it up, it keeps sending me through the Fuel code and gives back the header.php error when you have no place for it to go. I don't have a 404 set up. I can't get it to respond and allow access to the back end. Make sense?

    People talk about this xcache admin issue.. if I was not using MVC it may be easier. I think now i may be up against trying to get a vhost to redirect to the backend admin folder but the Fuel and or Codeignitor htaccess or whatever is overriding the vhosts. I think. I think this is worth discussing because I can't be the only one with this issue using MVC and xcache.
  • edited 10:24AM
    the main .htaccess file that comes with FUEL is setup to route any file/folder requests that don't exist in the specified path, to the index.php CI bootstrap file which would account for you seeing the header / footer 404. You can setup a folder called admin and put your files in there I'd imagine. Have you tried getting it to work without the fuel install?
  • edited 10:24AM
    Thank you for replying. The xcache is installed on the server, so I was trying to keep it behind the webroot since the references in it would be better able to link to the proper place/path. It is a VPS so I have access of course. So you are saying I can put a folder on the root and it will go to it? I have found it keeps trying to route it, or send it to the controller or view page and the header comes up with an error since I pass values into it. If I could make a vhost to point to the admin folder behind the webroot it would be great but no matter what I do it keeps trying to route it through fuel mvc. Make sense? This is proprietary so i can't give out the site. It is behind a login anyways that I adapted from tank_auth.
  • edited 10:24AM
    Have you tried testing it without the .htaccess or simply commenting out line 22 in that file. URIs through FUEL would include the index.php (e.g. index.php/my_page) but it would be good to test that to see if that is causing problem.
  • edited 10:24AM
    I do need the htaccess because I do have 10 months of programming into the web app. I did try commenting out the htaccess but then I got an error. I did not remove it though. I will try what you mentioned. I am not an expert on htaccess files.
  • edited 10:24AM
    I'm just suggesting to temporarily remove the .htaccess to see if you can get the xcache to work. FUEL can still work without .htaccess, you just need to add "index.php" as the value of the $config['index_page'];

    What was the error?
  • edited 10:24AM
    Hi, yes I will try it. I am programming other stuff at same time and also have to wait till after people done working so I don't cause them to lose data rebooting apache if httpd changes. I do remember, it gave 404 and denied access. I can't remember specifically. But this is a good exercise. I do want it to work somehow.
  • edited 10:24AM
    ok, so i was adding the xcache admin folder through root. Turns out that jacks the permissions up when apache tries to load it. So it works now, with no problem. However of course xcache is not working right, but at least i can access the admin. I still did not get ALIAS to work, but it is in the root folder and i guess the commands in it are able to access the home location due to the ini path settings. So, well, a bit drawn out but lesson is, don't put files from root user into the web docs for some things like this or they may not work. I found that out by looking at the error log in cpanel and looking up the error online and some nice person posted the issue.
  • edited 10:24AM
    Glad you were able to get it resolved.
Sign In or Register to comment.