Softaculous


Topic : Easily Configure a Different Document Root


Posted By: AlanJames1987 on April 17, 2013, 10:56 pm
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.

Posted By: tidus on April 18, 2013, 6:55 am | Post: 1
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

Posted By: AlanJames1987 on April 18, 2013, 9:21 pm | Post: 2
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.

Posted By: tidus on April 19, 2013, 12:34 pm | Post: 3
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

Posted By: AlanJames1987 on April 19, 2013, 10:58 pm | Post: 4
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.

Posted By: tidus on April 22, 2013, 12:20 pm | Post: 5
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

Posted By: AlanJames1987 on April 23, 2013, 9:39 pm | Post: 6
Awesome. I am very much looking forward to the next release and so are all my students.

Posted By: grumpy_robot on May 14, 2014, 4:35 pm | Post: 7
Did this by chance get updated in the latest (2.4)?

Posted By: AlexG2 on November 17, 2015, 2:08 pm | Post: 8
Any news on this
+1 for this feature.

Posted By: nickwuk on June 28, 2017, 10:40 pm | Post: 9
Quote From : AlexG2 November 17, 2015, 2:08 pm
Any news on this
+1 for this feature.

+1

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.