Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > Suggestions > Topic : Easily Configure a Different Document Root



Threaded Mode | Print  

 Easily Configure a Different Document Root (9 Replies, Read 30024 times)
AlanJames1987
Group: Member
Post Group: Newbie
Posts: 4
Status:
I am looking to move from MAMP to AMPPS in an educational environment. My students have several PHP and Python projects from several classes on their computers and often need to change their Apache document root to run the different projects. MAMP allows them to change the document root easily, but AMPPS does not and often results in 403 Forbidden Error. However, in general, AMPPS is an overall easier to use software stack for my students.

I would love to see an easy way to change the document root, possibly with a GUI instead of a configuration file, and without getting a forbidden error.
IP: --   

Easily Configure a Different Document Root
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Hi,

Is it necessary to change a DocumentRoot ? I would recommend to create an Alias for each project they have. Creating an alias is easy from Enduser Panel.
http://localhost/ampps/index.php?act=alias

Currently we dont have any provision to change the DocumentRoot. Though you can create a VirtualHost which will have its own DocumentRoot. Domains can be created from Enduser Panel too.
http://localhost/ampps/index.php?act=ampps_domainadd
(don't forget to check in advance settings to add the entry in hosts file.)


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Easily Configure a Different Document Root
AlanJames1987
Group: Member
Post Group: Newbie
Posts: 4
Status:
We link our files with absolute paths from the root of the web server. For example a css file called “style.css” would be loaded from “/css/style.css”. This means that if we use an alias, which is basically a folder in the document root, we would have to load files with relative paths instead of absolute paths. While this fairly easily doable, we like to minimize complexity in projects for the sake of clear teaching.

Currently we use MAMP because it allows new students to keep their css, js, and other assets loaded with absolute paths. When they finally upload the site to a web server it continues to work.

This is mostly a feature we think would be nice to have.
IP: --   

Easily Configure a Different Document Root
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Hi,

Relative Path is actually the short one(less complex) while absolute is the full path.

With alias you will still be able to use the short path.

Create a file index.html and a style.css with respective contents.

index.html file should contain the following line in the head tag:
Code
<link rel="stylesheet" href="style.css">
Copy it into some folder. Then from Ampps Enduser Panel create an Alias with any name and with the path of the folder where these two files are located.

It should work.


Edited by tidus : April 19, 2013, 12:36 pm

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Easily Configure a Different Document Root
AlanJames1987
Group: Member
Post Group: Newbie
Posts: 4
Status:
I don't believe that a server should make me conform my code to it. The server should conform to my code through configuration files.

Also, if I am using a shared PHP head with relative paths my program requires additional programming logic to make the paths work. A css file located in /css/ is linked differently from /page/ and /page/subpage/ with relative paths, while it is always the same with absolute paths.

from /page/
css = ../css/style.css

from /page/subpage
css = ../../css/style.css

This is the same for images, videos, anchor tags, javascript and any other asset you could load, several of which are linked through a single head file.
IP: --   

Easily Configure a Different Document Root
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Hi,

Okay. We have added this in our task list. In next version you will be able to change DocumentRoot via GUI.

Currently vhosts file also rebuilds everytime which has Ampps\www path for localhost. So there might be issue changing the DocumentRoot. You can comment that files Include directive in Apache Configuration if its not important.



-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Easily Configure a Different Document Root
AlanJames1987
Group: Member
Post Group: Newbie
Posts: 4
Status:
Awesome. I am very much looking forward to the next release and so are all my students.
IP: --   

Easily Configure a Different Document Root
grumpy_robot
Group: Member
Post Group: Newbie
Posts: 3
Status:
Did this by chance get updated in the latest (2.4)?
IP: --   

Easily Configure a Different Document Root
AlexG2
Group: Member
Post Group: Newbie
Posts: 6
Status:
Any news on this
+1 for this feature.
IP: --   

Easily Configure a Different Document Root
nickwuk
Group: Member
Post Group: Newbie
Posts: 3
Status:
Quote From : AlexG2 November 17, 2015, 2:08 pm
Any news on this
+1 for this feature.
+1
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is July 27, 2017, 8:54 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.936