document-root

Accessing files outside the document root with Apache

旧街凉风 提交于 2019-11-29 10:00:32
I have a project setup and i'm trying to access a file from a temp folder on the server. The document root for the website is similar to this: /a/b/c/d/e/f/g/h/mywebsite.com (of the letters have proper names). The file I need to read lives here: /a/b/c/myfile.txt I've tried symbolic links but may have done them wrong... any ideas? You can create a directory alias: <VirtualHost....> ..... stuff ..... Alias /mydir /a/b/c </VirtualHost> then you could access the text file like so: domain.com/mydir/myfile.txt Note that this needs to take place in the central configuration file, not a .htaccess

Apache multiple DocumentRoot

十年热恋 提交于 2019-11-29 06:14:44
问题 How can I have the following setup in apache? http://server/ABC/* should be served by /var/www/ABC/* http://server/PQR/* should be served by /var/www/PQR/* Every other request should be served by /var/www/Others/index.php (a single file). Thanks, JP 回答1: Use Alias: Alias /ABC/ /var/www/ABC/ Alias /PQR/ /var/www/PQR/ Leave the document root pointing to /var/www/Others/index.php. It could do the trick. :) 回答2: You can do this with mod_alias, which is part of the apache distribution. http:/

Where is the web server root directory in WAMP?

你。 提交于 2019-11-28 19:24:28
Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser? If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www , however this might vary depending on version. Yes, this is where you would put your site files to access them through a browser. In WAMP the files are served by the Apache component (the A in WAMP). In Apache, by default the files served are located in the subdirectory htdocs of the installation directory. But this can be changed, and is actually changed

Accessing files outside the document root with Apache

删除回忆录丶 提交于 2019-11-28 03:20:20
问题 I have a project setup and i'm trying to access a file from a temp folder on the server. The document root for the website is similar to this: /a/b/c/d/e/f/g/h/mywebsite.com (of the letters have proper names). The file I need to read lives here: /a/b/c/myfile.txt I've tried symbolic links but may have done them wrong... any ideas? 回答1: You can create a directory alias: <VirtualHost....> ..... stuff ..... Alias /mydir /a/b/c </VirtualHost> then you could access the text file like so: domain

Where is the web server root directory in WAMP?

♀尐吖头ヾ 提交于 2019-11-27 12:17:33
问题 Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser? 回答1: If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www , however this might vary depending on version. Yes, this is where you would put your site files to access them through a browser. 回答2: In WAMP the files are served by the Apache component (the A in WAMP). In Apache, by default the files served are

Access a file which is located before / outside the server root directory?

我的未来我决定 提交于 2019-11-27 08:43:49
I'm making an intranet for a post-sale customer service entreprise. Employee need to be able to upload img files to the intranet's server and i need to store them in a directory with is BEFORE www (the website's root directory). Doing this using php is pretty easy but how to include these imgs on the website once they're uploaded ? I tried this code <img src="../img/img.png"/> This is not working because i can't send a file if it is OUTSIDE the server's www directory ... Is there any proper way to do that ? Current treeview : server root directory |www |(all server files) |img |(all img files)

How to change xampp localhost to another folder ( outside xampp folder)?

冷暖自知 提交于 2019-11-27 06:46:56
How can I change my default xampp localhost c:xampp/htdoc to another folder i.e. c:/alan ? When I use the IP address I should be able to view my website file in C:/alan . Thanks for helping me. Edit the httpd.conf file and replace the line DocumentRoot "/home/user/www" to your liked one. The default DocumentRoot path will be different for windows [the above is for linux]. Please follow @Sourav's advice. If after restarting the server you get errors, you may need to set your directory options as well. This is done in the <Directory> tag in httpd.conf. Make sure the final config looks like this:

Access a file which is located before / outside the server root directory?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 22:17:49
问题 I'm making an intranet for a post-sale customer service entreprise. Employee need to be able to upload img files to the intranet's server and i need to store them in a directory with is BEFORE www (the website's root directory). Doing this using php is pretty easy but how to include these imgs on the website once they're uploaded ? I tried this code <img src="../img/img.png"/> This is not working because i can't send a file if it is OUTSIDE the server's www directory ... Is there any proper

How to change xampp localhost to another folder ( outside xampp folder)?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 12:09:52
问题 How can I change my default xampp localhost c:xampp/htdoc to another folder i.e. c:/alan ? When I use the IP address I should be able to view my website file in C:/alan . Thanks for helping me. 回答1: Edit the httpd.conf file and replace the line DocumentRoot "/home/user/www" to your liked one. The default DocumentRoot path will be different for windows [the above is for linux]. 回答2: Please follow @Sourav's advice. If after restarting the server you get errors, you may need to set your