Search the Community
Showing results for tags 'document root'.
-
Hi all !! I have finally setup my ubuntu linux VM on Virtual box for web development. My document root is /vagrant/myproject.com/public. which is the same as /var/www/myproject.com/public. This is the directory structure by default if i understand correct. My project folder which contains the index.php and all other files and folders is in say a folder called Magical. Now I am supposed to place my project folder at this location: /vagrant/myproject.com/public/Magical. If I now type, http://myproject/magical in the URL, the index.php inside Magical is invoked correcty and displays the webpage. However this is rather odd and not in accordance with the manner websites are normally invoked. I would like to type, just like everyone else, http://Magical.com to invoke the index.php. That would be like placing Magical in place of myproject in the folder hierarchy so that the document root is /vagrant/Magical.com/public. That seems to go against the convention and the tutorial followed. The root folder should be below the public folder. So what should I do to rectifyy this ? Do I need to change some settings in the conf files or in the placement of my folder so that I just type http://Macical.com to invoke the index.php ? Please help clarify. Thanks all !
-
Hello everyone, I'm making some improvements to site I haven't created so please tell me how it exactly works as I have problems to configure it properly. I've downloaded all files and run localhost using XAMPP. Site should run when accessing /home/some_domain/public_html/index.php so I've created : <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/SomeProject/home/some_domain/public_html" ServerName some_project <Directory "C:/xampp/htdocs/SomeProject/home/some_domain/public_html"> AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> That means, when I'm accessing http://some_project it runs index.php And that's ok. In index.php there's some include: include_once("includes/startup.php"); So it includes relatively there: /home/some_domain/public_html/includes/startup.php And that's fine. However... In startup.php there's something like this: define("_ROOTPATH_","/home/some_domain/public_html/"); and next line: include_once(_ROOTPATH_ ."includes/config.php"); And that's my problem as index.php was executed from C:/xampp/htdocs/SomeProject/home/some_domain/public_html/ so that include_once will behave this way: C:/xampp/htdocs/SomeProject/home/some_domain/public_html/home/some_domain/public_html/includes/config.php Of course such file is not available as it should direct to: C:/xampp/htdocs/SomeProject/home/some_domain/public_html/includes/config.php I'm not sure how it works on server and what I should do with my localhost to achieve that same environment. $_SERVER['DOCUMENT_ROOT'] for real site is: /home/some_domain/public_html Please help me to understand what I'm doing wrong.